Skip to content

Commit

Permalink
topotests: add bgp test for backup routes
Browse files Browse the repository at this point in the history
There is no test that illustrate how BGP can handle backup
routes.
This test creates a core topology with multiple P devices,
and CEs devices.
The ce9 device is reachable via rt11, rt5 and rt6, while the
ce7 device is reachable via rt1.
The expectation is to test incoming routes on rt1.
The test does the following:
- at startup, backup routes support is configured, and 2 ECMP
routes, and 1 backup path should be present.
- the IGP metric of rt6 is set to 10: the route to rt6 becomes
ECMP, like the other 2.
- the IGP metric of rt5 and rt11 is set to 20: the route to rt6
becomes primary, and the other two are backup and backup-multipath
- the unconfiguration of addpath backup support should remove
the backup and backup-multipath
- the reconfiguraiton of addpath backup support should add
the backup and backup-multipath
- the test of the addpath-tx-backup functionality.

The below output can be visible on rt1 during the tests:

> rt1# show bgp ipv4
> BGP table version is 2, local router ID is 192.0.2.1, vrf id 0
> Default local pref 100, local AS 64500
> Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
>                i internal, r RIB-failure, S Stale, R Removed
> Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
> Origin codes:  i - IGP, e - EGP, ? - incomplete
> RPKI validation codes: V valid, I invalid, N Not found
>
>    Network          Next Hop            Metric LocPrf Weight Path
> *>i192.0.2.9/32     192.0.2.5                0    100      0 64511 i
> b i                 192.0.2.6                0    100      0 64511 i
> *>i192.0.2.89/32    192.0.2.2                0    100      0 64499 i
>

Signed-off-by: Philippe Guibert <[email protected]>
  • Loading branch information
pguibert6WIND committed Oct 25, 2023
1 parent e443091 commit ca2b13f
Show file tree
Hide file tree
Showing 25 changed files with 1,132 additions and 0 deletions.
Empty file.
8 changes: 8 additions & 0 deletions tests/topotests/bgp_backup_route/ce7/bgpd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
router bgp 64499
bgp router-id 192.0.2.7
no bgp ebgp-requires-policy
neighbor 172.31.10.1 remote-as 64500
address-family ipv4 unicast
neighbor 172.31.10.1 addpath-tx-all-paths
!

10 changes: 10 additions & 0 deletions tests/topotests/bgp_backup_route/ce7/zebra.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
log stdout
interface lo
ip address 192.0.2.7/32
!
interface loop2
ip address 192.0.2.89/32
!
interface ce7-eth0
ip address 172.31.10.7/24
!
11 changes: 11 additions & 0 deletions tests/topotests/bgp_backup_route/ce9/bgpd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
router bgp 64511
bgp router-id 192.0.2.7
no bgp ebgp-requires-policy
neighbor 172.31.12.5 remote-as 64500
neighbor 172.31.13.6 remote-as 64500
neighbor 172.31.20.11 remote-as 64500
address-family ipv4 unicast
network 192.0.2.9/32
!
!

16 changes: 16 additions & 0 deletions tests/topotests/bgp_backup_route/ce9/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.9/32
!
interface loop2
ip address 192.0.2.9/32
!
interface ce9-eth0
ip address 172.31.12.9/24
!
interface ce9-eth1
ip address 172.31.13.9/24
!
interface ce9-eth2
ip address 172.31.20.9/24
!
16 changes: 16 additions & 0 deletions tests/topotests/bgp_backup_route/r1/bgpd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
debug bgp updates out
router bgp 64500
bgp router-id 192.0.2.1
no bgp ebgp-requires-policy
neighbor 172.31.10.7 remote-as 64499
neighbor rrserver peer-group
neighbor rrserver remote-as 64500
neighbor rrserver update-source lo
neighbor 192.0.2.3 peer-group rrserver
address-family ipv4 unicast
addpath path-selection backup
neighbor rrserver next-hop-self
neighbor rrserver addpath-tx-all-paths
neighbor 172.31.10.7 addpath-tx-all-paths
exit-address-family
!
22 changes: 22 additions & 0 deletions tests/topotests/bgp_backup_route/r1/isisd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
hostname r1
interface lo
ip router isis 1
isis passive
!
interface r1-eth1
ip router isis 1
isis network point-to-point
!
interface r1-eth2
ip router isis 1
isis network point-to-point
!
router isis 1
net 49.0123.6452.0001.00
is-type level-2-only
mpls-te on
segment-routing on
segment-routing global-block 16000 17000
segment-routing node-msd 10
segment-routing prefix 192.0.2.1/32 index 1
!
17 changes: 17 additions & 0 deletions tests/topotests/bgp_backup_route/r1/zebra.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
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
!
interface r1-eth2
ip address 172.31.2.1/24
!
interface r1-eth3
ip address 172.31.15.1/24
!

30 changes: 30 additions & 0 deletions tests/topotests/bgp_backup_route/r10/isisd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
hostname r10
interface lo
ip router isis 1
isis passive
!
interface r10-eth0
ip router isis 1
isis network point-to-point
!
interface r10-eth1
ip router isis 1
isis network point-to-point
!
interface r10-eth2
ip router isis 1
isis network point-to-point
!
interface r10-eth3
ip router isis 1
isis network point-to-point
!
router isis 1
net 49.0123.6452.0010.00
is-type level-2-only
mpls-te on
segment-routing on
segment-routing global-block 16000 17000
segment-routing node-msd 10
segment-routing prefix 192.0.2.10/32 index 10
!
17 changes: 17 additions & 0 deletions tests/topotests/bgp_backup_route/r10/zebra.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
log stdout
interface lo
ip address 192.0.2.10/32
!
interface r10-eth0
ip address 172.31.14.10/24
!
interface r10-eth1
ip address 172.31.15.10/24
!
interface r10-eth2
ip address 172.31.16.10/24
!
interface r10-eth3
ip address 172.31.17.10/24
!

13 changes: 13 additions & 0 deletions tests/topotests/bgp_backup_route/r11/bgpd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
router bgp 64500
bgp router-id 192.0.2.11
no bgp ebgp-requires-policy
neighbor 172.31.20.9 remote-as 64511
neighbor rrserver peer-group
neighbor rrserver remote-as 64500
neighbor rrserver update-source lo
neighbor 192.0.2.3 peer-group rrserver
address-family ipv4 unicast
neighbor rrserver next-hop-self
neighbor rrserver addpath-tx-all-paths
exit-address-family
!
26 changes: 26 additions & 0 deletions tests/topotests/bgp_backup_route/r11/isisd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
hostname r11
interface lo
ip router isis 1
isis passive
!
interface r11-eth0
ip router isis 1
isis network point-to-point
!
interface r11-eth1
ip router isis 1
isis network point-to-point
!
interface r11-eth2
ip router isis 1
isis network point-to-point
!
router isis 1
net 49.0123.6452.0011.00
is-type level-2-only
mpls-te on
segment-routing on
segment-routing global-block 16000 17000
segment-routing node-msd 10
segment-routing prefix 192.0.2.11/32 index 11
!
17 changes: 17 additions & 0 deletions tests/topotests/bgp_backup_route/r11/zebra.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
log stdout
interface lo
ip address 192.0.2.11/32
!
interface r11-eth0
ip address 172.31.17.11/24
!
interface r11-eth1
ip address 172.31.18.11/24
!
interface r11-eth2
ip address 172.31.19.11/24
!
interface r11-eth3
ip address 172.31.20.11/24
!

12 changes: 12 additions & 0 deletions tests/topotests/bgp_backup_route/r3/bgpd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
router bgp 64500
bgp router-id 192.0.2.3
neighbor rr peer-group
neighbor rr remote-as 64500
neighbor rr update-source lo
bgp listen range 192.0.2.0/24 peer-group rr
!
address-family ipv4 unicast
neighbor rr addpath-tx-all-paths
neighbor rr route-reflector-client
exit-address-family
!
38 changes: 38 additions & 0 deletions tests/topotests/bgp_backup_route/r3/isisd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
hostname r3
interface lo
ip router isis 1
isis passive
!
interface r3-eth0
ip router isis 1
isis network point-to-point
!
interface r3-eth1
ip router isis 1
isis network point-to-point
!
interface r3-eth2
ip router isis 1
isis network point-to-point
!
interface r3-eth3
ip router isis 1
isis network point-to-point
!
interface r3-eth4
ip router isis 1
isis network point-to-point
!
interface r3-eth5
ip router isis 1
isis network point-to-point
!
router isis 1
net 49.0123.6452.0003.00
is-type level-2-only
mpls-te on
segment-routing on
segment-routing global-block 16000 17000
segment-routing node-msd 10
segment-routing prefix 192.0.2.3/32 index 3
!
19 changes: 19 additions & 0 deletions tests/topotests/bgp_backup_route/r3/zebra.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
log stdout
interface lo
ip address 192.0.2.3/32
!
interface r3-eth0
ip address 172.31.0.3/24
!
interface r3-eth1
ip address 172.31.4.3/24
!
interface r3-eth2
ip address 172.31.5.3/24
!
interface r3-eth3
ip address 172.31.14.3/24
!
interface r3-eth4
ip address 172.31.18.3/24
!
30 changes: 30 additions & 0 deletions tests/topotests/bgp_backup_route/r4/isisd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
hostname r4
interface lo
ip router isis 1
isis passive
!
interface r4-eth0
ip router isis 1
isis network point-to-point
!
interface r4-eth1
ip router isis 1
isis network point-to-point
!
interface r4-eth2
ip router isis 1
isis network point-to-point
!
interface r4-eth3
ip router isis 1
isis network point-to-point
!
router isis 1
net 49.0123.6452.0004.00
is-type level-2-only
mpls-te on
segment-routing on
segment-routing global-block 16000 17000
segment-routing node-msd 10
segment-routing prefix 192.0.2.4/32 index 4
!
14 changes: 14 additions & 0 deletions tests/topotests/bgp_backup_route/r4/zebra.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
log stdout
interface lo
ip address 192.0.2.4/32
!
interface r4-eth0
ip address 172.31.2.4/24
!
interface r4-eth1
ip address 172.31.1.4/24
!
interface r4-eth2
ip address 172.31.7.4/24
!

13 changes: 13 additions & 0 deletions tests/topotests/bgp_backup_route/r5/bgpd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
router bgp 64500
bgp router-id 192.0.2.5
no bgp ebgp-requires-policy
neighbor 172.31.12.9 remote-as 64511
neighbor rrserver peer-group
neighbor rrserver remote-as 64500
neighbor rrserver update-source lo
neighbor 192.0.2.3 peer-group rrserver
address-family ipv4 unicast
neighbor rrserver next-hop-self
neighbor rrserver addpath-tx-all-paths
exit-address-family
!
26 changes: 26 additions & 0 deletions tests/topotests/bgp_backup_route/r5/isisd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
hostname r5
interface lo
ip router isis 1
isis passive
!
interface r5-eth1
ip router isis 1
isis network point-to-point
!
interface r5-eth2
ip router isis 1
isis network point-to-point
!
interface r5-eth3
ip router isis 1
isis network point-to-point
!
router isis 1
net 49.0123.6452.0005.00
is-type level-2-only
mpls-te on
segment-routing on
segment-routing global-block 16000 17000
segment-routing node-msd 10
segment-routing prefix 192.0.2.5/32 index 5
!
20 changes: 20 additions & 0 deletions tests/topotests/bgp_backup_route/r5/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.5/32
!
interface r5-eth0
ip address 172.31.12.5/24
!
interface r5-eth1
ip address 172.31.4.5/24
!
interface r5-eth2
ip address 172.31.7.5/24
!
interface r5-eth3
ip address 172.31.16.5/24
!
interface r5-eth4
ip address 172.31.19.5/24
!

Loading

0 comments on commit ca2b13f

Please sign in to comment.