Skip to content

Commit

Permalink
topotests: add bgp duplicate nexthop test
Browse files Browse the repository at this point in the history
Add a topotest that ensures that when addpath is enabled and two
paths with same nexthop are received, they are sent to ZEBRA which
detectes 'duplicate nexthop'.

Signed-off-by: Philippe Guibert <[email protected]>
  • Loading branch information
pguibert6WIND committed Jun 6, 2024
1 parent e1fad6f commit e635ddb
Show file tree
Hide file tree
Showing 12 changed files with 690 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/topotests/bgp_duplicate_nexthop/r1/bgpd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
debug bgp bestpath 192.0.2.8/32
router bgp 64500
bgp router-id 192.0.2.1
no bgp ebgp-requires-policy
neighbor rrserver peer-group
neighbor rrserver remote-as 64500
neighbor rrserver update-source lo
neighbor rrserver timers connect 2
neighbor 192.0.2.3 peer-group rrserver
address-family ipv4 unicast
neighbor rrserver next-hop-self
neighbor rrserver activate
exit-address-family
!
24 changes: 24 additions & 0 deletions tests/topotests/bgp_duplicate_nexthop/r1/zebra.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
log stdout
interface lo
ip address 192.0.2.1/32
!
interface r1-eth0
ip address 172.31.10.1/24
!
interface r1-eth1
ip address 172.31.0.1/24
mpls enable
!
interface r1-eth2
ip address 172.31.2.1/24
mpls enable
!
interface r1-eth3
ip address 172.31.11.1/24
mpls enable
!
interface r1-eth4
ip address 172.31.8.1/24
mpls enable
!

16 changes: 16 additions & 0 deletions tests/topotests/bgp_duplicate_nexthop/r3/bgpd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
router bgp 64500 view one
bgp router-id 192.0.2.3
neighbor rr peer-group
neighbor rr remote-as 64500
neighbor rr update-source lo
neighbor 192.0.2.1 peer-group rr
neighbor 192.0.2.5 peer-group rr
neighbor 192.0.2.6 peer-group rr
neighbor 192.0.2.8 peer-group rr
!
address-family ipv4 unicast
neighbor rr activate
neighbor rr route-reflector-client
neighbor rr addpath-tx-all-paths
exit-address-family
!
16 changes: 16 additions & 0 deletions tests/topotests/bgp_duplicate_nexthop/r3/zebra.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
log stdout
interface lo
ip address 192.0.2.3/32
!
interface r3-eth0
ip address 172.31.0.3/24
mpls enable
!
interface r3-eth1
ip address 172.31.4.3/24
mpls enable
!
interface r3-eth2
ip address 172.31.5.3/24
mpls enable
!
20 changes: 20 additions & 0 deletions tests/topotests/bgp_duplicate_nexthop/r4/zebra.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
log stdout
interface lo
ip address 192.0.2.4/32
!
interface r4-eth0
ip address 172.31.2.4/24
mpls enable
!
interface r4-eth1
ip address 172.31.6.4/24
mpls enable
!
interface r4-eth2
ip address 172.31.7.4/24
mpls enable
!
interface r4-eth3
mpls enable
!

19 changes: 19 additions & 0 deletions tests/topotests/bgp_duplicate_nexthop/r5/bgpd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
router bgp 64500
bgp router-id 192.0.2.5
no bgp ebgp-requires-policy
no bgp network import-check
neighbor rrserver peer-group
neighbor rrserver remote-as 64500
neighbor rrserver update-source lo
neighbor rrserver timers connect 2
neighbor 192.0.2.3 peer-group rrserver
address-family ipv4 unicast
network 192.0.2.9/32
network 192.0.2.8/32 route-map rmap
neighbor rrserver activate
neighbor rrserver addpath-tx-all-paths
exit-address-family
!
route-map rmap permit 1
set ip next-hop 192.0.2.9
exit
19 changes: 19 additions & 0 deletions tests/topotests/bgp_duplicate_nexthop/r5/zebra.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
log stdout
mpls label dynamic-block 5000 5999
interface lo
ip address 192.0.2.5/32
!
interface r5-eth0
ip address 172.31.12.5/24
!
interface r5-eth1
ip address 172.31.4.5/24
mpls enable
!
interface r5-eth2
ip address 172.31.7.5/24
mpls enable
!
interface r5-eth3
ip address 172.31.21.5/24
!
19 changes: 19 additions & 0 deletions tests/topotests/bgp_duplicate_nexthop/r6/bgpd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
router bgp 64500
bgp router-id 192.0.2.6
no bgp ebgp-requires-policy
no bgp network import-check
neighbor rrserver peer-group
neighbor rrserver remote-as 64500
neighbor rrserver update-source lo
neighbor rrserver bfd
neighbor 192.0.2.3 peer-group rrserver
address-family ipv4 unicast
network 192.0.2.9/32
network 192.0.2.8/32 route-map rmap
neighbor rrserver activate
neighbor rrserver addpath-tx-all-paths
exit-address-family
!
route-map rmap permit 1
set ip next-hop 192.0.2.9
exit
20 changes: 20 additions & 0 deletions tests/topotests/bgp_duplicate_nexthop/r6/zebra.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
log stdout
mpls label dynamic-block 6000 6999
interface lo
ip address 192.0.2.6/32
!
interface r6-eth0
ip address 172.31.13.6/24
!
interface r6-eth1
ip address 172.31.5.6/24
mpls enable
!
interface r6-eth2
ip address 172.31.6.6/24
mpls enable
!
interface r6-eth3
ip address 172.31.22.6/24
!

Loading

0 comments on commit e635ddb

Please sign in to comment.