Skip to content

Commit b2bf62c

Browse files
authored
Merge pull request FRRouting#19298 from donaldsharp/bgp_dual_as_fixes
Bgp dual as fixes
2 parents 1a616e0 + b9e6921 commit b2bf62c

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

bgpd/bgp_packet.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1654,6 +1654,9 @@ static int bgp_collision_detect(struct peer_connection *connection,
16541654
*/
16551655
if (peer_established(other) ||
16561656
other->status == Clearing) {
1657+
if (bgp_debug_neighbor_events(peer))
1658+
zlog_debug("New connection starting from %pI4 but a competing connection is already in established or clearing",
1659+
&remote_id.s_addr);
16571660
bgp_notify_send(connection, BGP_NOTIFY_CEASE,
16581661
BGP_NOTIFY_CEASE_COLLISION_RESOLUTION);
16591662
return -1;
@@ -1691,6 +1694,9 @@ static int bgp_collision_detect(struct peer_connection *connection,
16911694
BGP_NOTIFY_CEASE_COLLISION_RESOLUTION);
16921695
return 1;
16931696
} else {
1697+
if (bgp_debug_neighbor_events(peer))
1698+
zlog_debug("New Connection received, but existing connection from %pI4 will win collision detection so dropping this new connection",
1699+
&remote_id.s_addr);
16941700
bgp_notify_send(connection, BGP_NOTIFY_CEASE,
16951701
BGP_NOTIFY_CEASE_COLLISION_RESOLUTION);
16961702
return -1;

doc/user/bgp.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1877,7 +1877,10 @@ Configuring Peers
18771877

18781878
The ``dual-as`` keyword is used to configure the neighbor to establish a peering
18791879
session using the real autonomous-system number (``router bgp ASN``) or by using
1880-
the autonomous system number configured with the ``local-as``.
1880+
the autonomous system number configured with the ``local-as``. If ``dual-as`` is
1881+
used be aware of connection collision ordering and attempt to configure this system
1882+
with a higher ip address so that this connection is preferred. As that the other
1883+
side will reject the incoming connection.
18811884

18821885
This command is only allowed for eBGP peers.
18831886

tests/topotests/bgp_dual_as/r1/frr.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
!
22
interface r1-eth0
3-
ip address 10.0.0.1/24
3+
ip address 10.0.0.3/24
44
!
55
router bgp 65000
66
no bgp ebgp-requires-policy

tests/topotests/bgp_dual_as/r2/frr.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ interface r2-eth0
44
!
55
router bgp 65002
66
no bgp ebgp-requires-policy
7-
neighbor 10.0.0.1 remote-as 65000
8-
neighbor 10.0.0.1 timers 3 10
9-
neighbor 10.0.0.1 timers connect 1
7+
neighbor 10.0.0.3 remote-as 65000
8+
neighbor 10.0.0.3 timers 3 10
9+
neighbor 10.0.0.3 timers connect 1
1010
!

0 commit comments

Comments
 (0)