Changing protocols bgp neighbor X ttl-security hops on an existing eBGP session can leave the
session down for about 150-170 s (the peer's hold time) instead of a few seconds.
Topology
r1 (AS 65001) ---- r2 (transit, static routes only) ---- r3 (AS 65003) eth1 10.0.2.1 eth1 10.0.2.2 | eth2 10.0.3.2 eth1 10.0.3.3 lo 203.0.113.1 lo 203.0.113.3 svc 198.51.100.1 svc 198.51.100.3
r1 and r3 peer over their loopbacks, two hops apart. Packets sent with TTL 255 arrive with TTL 254, so hops 2 admits the
peer and hops 1 rejects it.
Steps to reproduce
r2
set interfaces ethernet eth1 address '10.0.2.2/24' set interfaces ethernet eth2 address '10.0.3.2/24' set protocols static route 203.0.113.1/32 next-hop 10.0.2.1 set protocols static route 203.0.113.3/32 next-hop 10.0.3.3 commit
r1
set interfaces ethernet eth1 address '10.0.2.1/24' set interfaces dummy dum2 address '203.0.113.1/32' set interfaces dummy dum8 address '198.51.100.1/32' set protocols static route 203.0.113.3/32 next-hop 10.0.2.2 set protocols bgp system-as 65001 set protocols bgp parameters router-id '203.0.113.1' set protocols bgp neighbor 203.0.113.3 remote-as 65003 set protocols bgp neighbor 203.0.113.3 update-source '203.0.113.1' set protocols bgp neighbor 203.0.113.3 ttl-security hops 2 set protocols bgp neighbor 203.0.113.3 address-family ipv4-unicast set protocols bgp address-family ipv4-unicast network '198.51.100.1/32' commit
r3
set interfaces ethernet eth1 address '10.0.3.3/24' set interfaces dummy dum2 address '203.0.113.3/32' set interfaces dummy dum8 address '198.51.100.3/32' set protocols static route 203.0.113.1/32 next-hop 10.0.3.2 set protocols bgp system-as 65003 set protocols bgp parameters router-id '203.0.113.3' set protocols bgp neighbor 203.0.113.1 remote-as 65001 set protocols bgp neighbor 203.0.113.1 update-source '203.0.113.3' set protocols bgp neighbor 203.0.113.1 ttl-security hops 2 set protocols bgp neighbor 203.0.113.1 address-family ipv4-unicast set protocols bgp address-family ipv4-unicast network '198.51.100.3/32' commit
Check on r1: show ip route bgp has B> 198.51.100.3/32 .
On r1, change limit:
set protocols bgp neighbor 203.0.113.3 ttl-security hops 1 commit
r1 shows BGP state = Connect, while r3 shows
BGP state = Established
Wait about 20 s, then on r1 restore the limit and time how long until the route returns:
set protocols bgp neighbor 203.0.113.3 ttl-security hops 2 commit
show ip route bgp show bgp neighbor 203.0.113.3 | match "BGP state|Last reset"
And on r3: show bgp neighbor 203.0.113.1 | match "BGP state|Last reset".
Actual: r1 goes Idle with `Last reset ... Notification received (Cease/Connection Collision
Resolution)`.
The route comes back only after r3 logs Last reset ... Notification sent (Hold Timer Expired), about
150-170 s after the commit.
Expected: r3 shows Last reset ... Peer closed the session, it reconnects at once,
and the route is back within a few seconds.