summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--docs/sources/configuration.md1
-rw-r--r--server/fsm.go7
2 files changed, 7 insertions, 1 deletions
diff --git a/docs/sources/configuration.md b/docs/sources/configuration.md
index e308b3ab..71e654fb 100644
--- a/docs/sources/configuration.md
+++ b/docs/sources/configuration.md
@@ -65,6 +65,7 @@
passive-mode = true
local-address = "192.168.10.1"
remote-port = 2016
+ ttl = 64 # default value on Linux
[neighbors.ebgp-multihop.config]
enabled = true
multihop-ttl = 100
diff --git a/server/fsm.go b/server/fsm.go
index 4f19bc39..afd04b3e 100644
--- a/server/fsm.go
+++ b/server/fsm.go
@@ -493,10 +493,15 @@ func (h *FSMHandler) active() (bgp.FSMState, FsmStateReason) {
ttl = 255
ttlMin = int(fsm.pConf.TtlSecurity.Config.TtlMin)
} else if fsm.pConf.Config.PeerAs != 0 && fsm.pConf.Config.PeerType == config.PEER_TYPE_EXTERNAL {
- ttl = 1
if fsm.pConf.EbgpMultihop.Config.Enabled {
ttl = int(fsm.pConf.EbgpMultihop.Config.MultihopTtl)
+ } else if fsm.pConf.Transport.Config.Ttl != 0 {
+ ttl = int(fsm.pConf.Transport.Config.Ttl)
+ } else {
+ ttl = 1
}
+ } else if fsm.pConf.Transport.Config.Ttl != 0 {
+ ttl = int(fsm.pConf.Transport.Config.Ttl)
}
if ttl != 0 {
if err := SetTcpTTLSockopts(conn.(*net.TCPConn), ttl); err != nil {