From 1160c390931c750a8b3c1ffb1b22b6d56225d930 Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Fri, 14 Mar 2025 11:03:57 +0100 Subject: [PATCH 01/12] topotests: move bgp_srv6l3vpn_to_bgp_vrf to unified configuration Use the unified configuration for bgp_srv6l3vpn_to_bgp_vrf test. Signed-off-by: Philippe Guibert --- .../bgp_srv6l3vpn_to_bgp_vrf/ce1/bgpd.conf | 8 --- .../ce1/{zebra.conf => frr.conf} | 7 +-- .../bgp_srv6l3vpn_to_bgp_vrf/ce2/bgpd.conf | 8 --- .../ce2/{zebra.conf => frr.conf} | 7 +-- .../bgp_srv6l3vpn_to_bgp_vrf/ce3/bgpd.conf | 8 --- .../ce3/{zebra.conf => frr.conf} | 7 +-- .../bgp_srv6l3vpn_to_bgp_vrf/ce4/bgpd.conf | 8 --- .../ce4/{zebra.conf => frr.conf} | 7 +-- .../bgp_srv6l3vpn_to_bgp_vrf/ce5/bgpd.conf | 8 --- .../ce5/{zebra.conf => frr.conf} | 7 +-- .../bgp_srv6l3vpn_to_bgp_vrf/ce6/bgpd.conf | 8 --- .../ce6/{zebra.conf => frr.conf} | 7 +-- .../r1/{bgpd.conf => frr.conf} | 54 ++++++++++++------ .../bgp_srv6l3vpn_to_bgp_vrf/r1/zebra.conf | 41 -------------- .../r2/{bgpd.conf => frr.conf} | 56 +++++++++++++------ .../bgp_srv6l3vpn_to_bgp_vrf/r2/zebra.conf | 41 -------------- .../test_bgp_srv6l3vpn_to_bgp_vrf.py | 10 +--- 17 files changed, 85 insertions(+), 207 deletions(-) delete mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/bgpd.conf rename tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/{zebra.conf => frr.conf} (68%) delete mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/bgpd.conf rename tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/{zebra.conf => frr.conf} (68%) delete mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce3/bgpd.conf rename tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce3/{zebra.conf => frr.conf} (68%) delete mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce4/bgpd.conf rename tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce4/{zebra.conf => frr.conf} (68%) delete mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce5/bgpd.conf rename tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce5/{zebra.conf => frr.conf} (68%) delete mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce6/bgpd.conf rename tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce6/{zebra.conf => frr.conf} (68%) rename tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/{bgpd.conf => frr.conf} (53%) delete mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/zebra.conf rename tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/{bgpd.conf => frr.conf} (52%) delete mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/zebra.conf diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/bgpd.conf deleted file mode 100644 index 3459796629..0000000000 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/bgpd.conf +++ /dev/null @@ -1,8 +0,0 @@ -frr defaults traditional -! -hostname ce1 -password zebra -! -log stdout notifications -log commands -log file bgpd.log diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/frr.conf similarity index 68% rename from tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/zebra.conf rename to tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/frr.conf index 665808a0e7..e48629cdac 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/zebra.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/frr.conf @@ -1,6 +1,4 @@ -log file zebra.log -! -hostname ce1 +frr defaults traditional ! interface eth0 ipv6 address 2001:1::2/64 @@ -9,6 +7,3 @@ ip forwarding ipv6 forwarding ! ipv6 route ::/0 2001:1::1 -! -line vty -! diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/bgpd.conf deleted file mode 100644 index 8ed9978749..0000000000 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/bgpd.conf +++ /dev/null @@ -1,8 +0,0 @@ -frr defaults traditional -! -hostname ce2 -password zebra -! -log stdout notifications -log commands -log file bgpd.log diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/frr.conf similarity index 68% rename from tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/zebra.conf rename to tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/frr.conf index cc9b90a3b0..36dc3bd8e9 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/zebra.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/frr.conf @@ -1,6 +1,4 @@ -log file zebra.log -! -hostname ce2 +frr defaults traditional ! interface eth0 ipv6 address 2001:2::2/64 @@ -9,6 +7,3 @@ ip forwarding ipv6 forwarding ! ipv6 route ::/0 2001:2::1 -! -line vty -! diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce3/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce3/bgpd.conf deleted file mode 100644 index a85d9701c7..0000000000 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce3/bgpd.conf +++ /dev/null @@ -1,8 +0,0 @@ -frr defaults traditional -! -hostname ce3 -password zebra -! -log stdout notifications -log commands -log file bgpd.log diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce3/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce3/frr.conf similarity index 68% rename from tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce3/zebra.conf rename to tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce3/frr.conf index beca0b1211..65e08ce23d 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce3/zebra.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce3/frr.conf @@ -1,6 +1,4 @@ -log file zebra.log -! -hostname ce3 +frr defaults traditional ! interface eth0 ipv6 address 2001:3::2/64 @@ -9,6 +7,3 @@ ip forwarding ipv6 forwarding ! ipv6 route ::/0 2001:3::1 -! -line vty -! diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce4/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce4/bgpd.conf deleted file mode 100644 index 93fb32fd1b..0000000000 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce4/bgpd.conf +++ /dev/null @@ -1,8 +0,0 @@ -frr defaults traditional -! -hostname ce4 -password zebra -! -log stdout notifications -log commands -log file bgpd.log diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce4/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce4/frr.conf similarity index 68% rename from tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce4/zebra.conf rename to tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce4/frr.conf index 7b21074df0..00d1f076e0 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce4/zebra.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce4/frr.conf @@ -1,6 +1,4 @@ -log file zebra.log -! -hostname ce4 +frr defaults traditional ! interface eth0 ipv6 address 2001:4::2/64 @@ -9,6 +7,3 @@ ip forwarding ipv6 forwarding ! ipv6 route ::/0 2001:4::1 -! -line vty -! diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce5/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce5/bgpd.conf deleted file mode 100644 index 2ab6f2d2a7..0000000000 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce5/bgpd.conf +++ /dev/null @@ -1,8 +0,0 @@ -frr defaults traditional -! -hostname ce5 -password zebra -! -log stdout notifications -log commands -log file bgpd.log diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce5/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce5/frr.conf similarity index 68% rename from tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce5/zebra.conf rename to tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce5/frr.conf index b5ad48e709..dd5144bce5 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce5/zebra.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce5/frr.conf @@ -1,6 +1,4 @@ -log file zebra.log -! -hostname ce5 +frr defaults traditional ! interface eth0 ipv6 address 2001:5::2/64 @@ -9,6 +7,3 @@ ip forwarding ipv6 forwarding ! ipv6 route ::/0 2001:5::1 -! -line vty -! diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce6/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce6/bgpd.conf deleted file mode 100644 index e0b6540514..0000000000 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce6/bgpd.conf +++ /dev/null @@ -1,8 +0,0 @@ -frr defaults traditional -! -hostname ce6 -password zebra -! -log stdout notifications -log commands -log file bgpd.log diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce6/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce6/frr.conf similarity index 68% rename from tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce6/zebra.conf rename to tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce6/frr.conf index 7d19d9880b..47947dce85 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce6/zebra.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce6/frr.conf @@ -1,6 +1,4 @@ -log file zebra.log -! -hostname ce6 +frr defaults traditional ! interface eth0 ipv6 address 2001:6::2/64 @@ -9,6 +7,3 @@ ip forwarding ipv6 forwarding ! ipv6 route ::/0 2001:6::1 -! -line vty -! diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/frr.conf similarity index 53% rename from tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/bgpd.conf rename to tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/frr.conf index 8079bb0c2a..716369d48a 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/bgpd.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/frr.conf @@ -1,23 +1,45 @@ -frr defaults traditional +! debug zebra packet +! debug zebra dplane +! debug zebra kernel +! debug bgp neighbor-events +! debug bgp zebra +! debug bgp vnc verbose +! debug bgp update-groups +! debug bgp updates in +! debug bgp updates out +! debug bgp vpn label +! debug bgp vpn leak-from-vrf +! debug bgp vpn leak-to-vrf +! debug bgp vpn rmap-event ! -bgp send-extra-data zebra +interface eth0 + ipv6 address 2001::1/64 ! -hostname r1 -password zebra +interface eth1 vrf vrf10 + ipv6 address 2001:1::1/64 ! -log stdout notifications -log commands +interface eth2 vrf vrf10 + ipv6 address 2001:3::1/64 ! -!debug bgp neighbor-events -!debug bgp zebra -!debug bgp vnc verbose -!debug bgp update-groups -!debug bgp updates in -!debug bgp updates out -!debug bgp vpn label -!debug bgp vpn leak-from-vrf -!debug bgp vpn leak-to-vrf -!debug bgp vpn rmap-event +interface eth3 vrf vrf20 + ipv6 address 2001:5::1/64 +! +segment-routing + srv6 + locators + locator loc1 + prefix 2001:db8:1:1::/64 func-bits 8 + ! + ! +! +ip forwarding +ipv6 forwarding +! +ipv6 route 2001:db8:2:1::/64 2001::2 +ipv6 route 2001:db8:2:2::/64 2001::2 +ipv6 route 2001:db8:2:3::/64 2001::2 +! +line vty ! router bgp 1 bgp router-id 1.1.1.1 diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/zebra.conf deleted file mode 100644 index c84106f2bb..0000000000 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/zebra.conf +++ /dev/null @@ -1,41 +0,0 @@ -log file zebra.log -! -hostname r1 -password zebra -! -log stdout notifications -log commands -! -! debug zebra packet -! debug zebra dplane -! debug zebra kernel -! -interface eth0 - ipv6 address 2001::1/64 -! -interface eth1 vrf vrf10 - ipv6 address 2001:1::1/64 -! -interface eth2 vrf vrf10 - ipv6 address 2001:3::1/64 -! -interface eth3 vrf vrf20 - ipv6 address 2001:5::1/64 -! -segment-routing - srv6 - locators - locator loc1 - prefix 2001:db8:1:1::/64 func-bits 8 - ! - ! -! -ip forwarding -ipv6 forwarding -! -ipv6 route 2001:db8:2:1::/64 2001::2 -ipv6 route 2001:db8:2:2::/64 2001::2 -ipv6 route 2001:db8:2:3::/64 2001::2 -! -line vty -! diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/frr.conf similarity index 52% rename from tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/bgpd.conf rename to tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/frr.conf index c2e8530273..38f6bdaeab 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/bgpd.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/frr.conf @@ -1,24 +1,46 @@ -frr defaults traditional +! debug zebra packet +! debug zebra dplane +! debug zebra kernel +! debug bgp neighbor-events +! debug bgp zebra +! debug bgp vnc verbose +! debug bgp update-groups +! debug bgp updates in +! debug bgp updates out +! debug bgp updates +! debug bgp vpn label +! debug bgp vpn leak-from-vrf +! debug bgp vpn leak-to-vrf +! debug bgp vpn rmap-event ! -bgp send-extra-data zebra +interface eth0 + ipv6 address 2001::2/64 ! -hostname r2 -password zebra +interface eth1 vrf vrf10 + ipv6 address 2001:2::1/64 ! -log stdout notifications -log commands +interface eth2 vrf vrf20 + ipv6 address 2001:4::1/64 ! -!debug bgp neighbor-events -!debug bgp zebra -!debug bgp vnc verbose -!debug bgp update-groups -!debug bgp updates in -!debug bgp updates out -!debug bgp updates -!debug bgp vpn label -!debug bgp vpn leak-from-vrf -!debug bgp vpn leak-to-vrf -!debug bgp vpn rmap-event +interface eth3 vrf vrf20 + ipv6 address 2001:6::1/64 +! +segment-routing + srv6 + locators + locator loc1 + prefix 2001:db8:2:2::/64 func-bits 8 + ! + ! +! +ip forwarding +ipv6 forwarding +! +ipv6 route 2001:db8:1:1::/64 2001::1 +ipv6 route 2001:db8:1:2::/64 2001::1 +ipv6 route 2001:db8:1:3::/64 2001::1 +! +line vty ! router bgp 2 bgp router-id 2.2.2.2 diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/zebra.conf deleted file mode 100644 index 5c12429ff2..0000000000 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/zebra.conf +++ /dev/null @@ -1,41 +0,0 @@ -log file zebra.log -! -hostname r2 -password zebra -! -log stdout notifications -log commands -! -! debug zebra packet -! debug zebra dplane -! debug zebra kernel -! -interface eth0 - ipv6 address 2001::2/64 -! -interface eth1 vrf vrf10 - ipv6 address 2001:2::1/64 -! -interface eth2 vrf vrf20 - ipv6 address 2001:4::1/64 -! -interface eth3 vrf vrf20 - ipv6 address 2001:6::1/64 -! -segment-routing - srv6 - locators - locator loc1 - prefix 2001:db8:2:2::/64 func-bits 8 - ! - ! -! -ip forwarding -ipv6 forwarding -! -ipv6 route 2001:db8:1:1::/64 2001::1 -ipv6 route 2001:db8:1:2::/64 2001::1 -ipv6 route 2001:db8:1:3::/64 2001::1 -! -line vty -! diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/test_bgp_srv6l3vpn_to_bgp_vrf.py b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/test_bgp_srv6l3vpn_to_bgp_vrf.py index a6938668ad..1010bb7bd0 100755 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/test_bgp_srv6l3vpn_to_bgp_vrf.py +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/test_bgp_srv6l3vpn_to_bgp_vrf.py @@ -92,14 +92,8 @@ def setup_module(mod): tgen.start_topology() router_list = tgen.routers() for rname, router in tgen.routers().items(): - if os.path.exists("{}/{}/setup.sh".format(CWD, rname)): - router.run("/bin/bash {}/{}/setup.sh".format(CWD, rname)) - router.load_config( - TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname)) - ) - router.load_config( - TopoRouter.RD_BGP, os.path.join(CWD, "{}/bgpd.conf".format(rname)) - ) + logger.info("Loading router %s" % rname) + router.load_frr_config(os.path.join(CWD, "{}/frr.conf".format(rname))) tgen.gears["r1"].run("ip link add vrf10 type vrf table 10") tgen.gears["r1"].run("ip link set vrf10 up") From 6aeb697e38344c8dc7d1725a1b690cbaad8bae5e Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Fri, 14 Mar 2025 11:07:12 +0100 Subject: [PATCH 02/12] topotests: remove useless zebra aspath control in bgp srv6 test The aspath value has no need to be controlled. Unset the bgp capability to send aspath information to zebra. Signed-off-by: Philippe Guibert --- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/frr.conf | 1 + tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/vrf10_rib.json | 3 +-- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/vrf20_rib.json | 6 ++---- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/frr.conf | 1 + tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vrf10_rib.json | 6 ++---- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vrf20_rib.json | 3 +-- 6 files changed, 8 insertions(+), 12 deletions(-) diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/frr.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/frr.conf index 716369d48a..e46ab948e6 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/frr.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/frr.conf @@ -41,6 +41,7 @@ ipv6 route 2001:db8:2:3::/64 2001::2 ! line vty ! +no bgp send-extra-data-zebra router bgp 1 bgp router-id 1.1.1.1 no bgp ebgp-requires-policy diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/vrf10_rib.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/vrf10_rib.json index 141c1cb957..aee6905d95 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/vrf10_rib.json +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/vrf10_rib.json @@ -53,8 +53,7 @@ "segs": "2001:db8:2:2:100::" } } - ], - "asPath": "2" + ] } ], "2001:3::/64": [ diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/vrf20_rib.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/vrf20_rib.json index e20998061f..0f3c970afe 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/vrf20_rib.json +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/vrf20_rib.json @@ -27,8 +27,7 @@ "segs": "2001:db8:2:2:200::" } } - ], - "asPath": "2" + ] } ], "2001:5::/64": [ @@ -85,8 +84,7 @@ "segs": "2001:db8:2:2:200::" } } - ], - "asPath": "2" + ] } ] } diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/frr.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/frr.conf index 38f6bdaeab..f5729dd8ee 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/frr.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/frr.conf @@ -42,6 +42,7 @@ ipv6 route 2001:db8:1:3::/64 2001::1 ! line vty ! +no bgp send-extra-data-zebra router bgp 2 bgp router-id 2.2.2.2 no bgp ebgp-requires-policy diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vrf10_rib.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vrf10_rib.json index 7f8a930d00..be1c58d3d1 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vrf10_rib.json +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vrf10_rib.json @@ -27,8 +27,7 @@ "segs": "2001:db8:1:1:100::" } } - ], - "asPath": "1" + ] } ], "2001:2::/64": [ @@ -85,8 +84,7 @@ "segs": "2001:db8:1:1:100::" } } - ], - "asPath": "1" + ] } ] } diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vrf20_rib.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vrf20_rib.json index 104bdc30d2..90e0413db2 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vrf20_rib.json +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vrf20_rib.json @@ -53,8 +53,7 @@ "segs": "2001:db8:1:1:200::" } } - ], - "asPath": "1" + ] } ], "2001:6::/64": [ From 57a03cfc545fe3d450241c8db8051d5d285a91a9 Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Fri, 14 Mar 2025 11:59:22 +0100 Subject: [PATCH 03/12] topotests: bgp_srv6l3vpn_to_bgp_vrf, change AS values Use experimental AS values to play the test. Add BGP peering on CEs, and use the default-originate functionality on each PE facing CPEs. Signed-off-by: Philippe Guibert --- .../bgp_srv6l3vpn_to_bgp_vrf/ce1/frr.conf | 9 ++++++++- .../bgp_srv6l3vpn_to_bgp_vrf/ce1/ipv6_rib.json | 7 +++---- .../bgp_srv6l3vpn_to_bgp_vrf/ce2/frr.conf | 10 +++++++++- .../bgp_srv6l3vpn_to_bgp_vrf/ce2/ipv6_rib.json | 7 +++---- .../bgp_srv6l3vpn_to_bgp_vrf/ce3/frr.conf | 9 ++++++++- .../bgp_srv6l3vpn_to_bgp_vrf/ce3/ipv6_rib.json | 7 +++---- .../bgp_srv6l3vpn_to_bgp_vrf/ce4/frr.conf | 9 ++++++++- .../bgp_srv6l3vpn_to_bgp_vrf/ce4/ipv6_rib.json | 7 +++---- .../bgp_srv6l3vpn_to_bgp_vrf/ce5/frr.conf | 9 ++++++++- .../bgp_srv6l3vpn_to_bgp_vrf/ce5/ipv6_rib.json | 7 +++---- .../bgp_srv6l3vpn_to_bgp_vrf/ce6/frr.conf | 9 ++++++++- .../bgp_srv6l3vpn_to_bgp_vrf/ce6/ipv6_rib.json | 7 +++---- .../bgp_srv6l3vpn_to_bgp_vrf/r1/frr.conf | 17 +++++++++++++---- .../bgp_srv6l3vpn_to_bgp_vrf/r1/vpnv6_rib.json | 8 ++++---- .../r1/vpnv6_rib_locator_deleted.json | 8 ++++---- .../r1/vpnv6_rib_locator_recreated.json | 8 ++++---- .../bgp_srv6l3vpn_to_bgp_vrf/r2/frr.conf | 17 +++++++++++++---- .../bgp_srv6l3vpn_to_bgp_vrf/r2/vpnv6_rib.json | 8 ++++---- .../r2/vpnv6_rib_locator_deleted.json | 2 +- .../r2/vpnv6_rib_locator_recreated.json | 8 ++++---- .../test_bgp_srv6l3vpn_to_bgp_vrf.py | 8 ++++---- 21 files changed, 118 insertions(+), 63 deletions(-) diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/frr.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/frr.conf index e48629cdac..c70ad42437 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/frr.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/frr.conf @@ -6,4 +6,11 @@ interface eth0 ip forwarding ipv6 forwarding ! -ipv6 route ::/0 2001:1::1 +router bgp 65500 + bgp router-id 1.1.2.1 + neighbor 2001:1::1 remote-as 65500 + address-family ipv6 unicast + neighbor 2001:1::1 activate + exit-address-family +exit + diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/ipv6_rib.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/ipv6_rib.json index d19e315772..b68f1a1112 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/ipv6_rib.json +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/ipv6_rib.json @@ -2,24 +2,23 @@ "::/0": [ { "prefix": "::/0", - "protocol": "static", + "protocol": "bgp", "vrfId": 0, "vrfName": "default", "selected": true, "destSelected": true, - "distance": 1, + "distance": 200, "metric": 0, "installed": true, "table": 254, "internalStatus": 16, - "internalFlags": 73, + "internalFlags": 13, "internalNextHopNum": 1, "internalNextHopActiveNum": 1, "nexthops": [ { "flags": 3, "fib": true, - "ip": "2001:1::1", "afi": "ipv6", "interfaceName": "eth0", "active": true, diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/frr.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/frr.conf index 36dc3bd8e9..a15c5b48e0 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/frr.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/frr.conf @@ -6,4 +6,12 @@ interface eth0 ip forwarding ipv6 forwarding ! -ipv6 route ::/0 2001:2::1 +router bgp 65501 + bgp router-id 1.1.20.1 + neighbor 2001:2::1 remote-as 65501 + address-family ipv6 unicast + neighbor 2001:2::1 activate + exit-address-family +exit + + diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/ipv6_rib.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/ipv6_rib.json index 35ff14efad..1f42595271 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/ipv6_rib.json +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/ipv6_rib.json @@ -2,24 +2,23 @@ "::/0": [ { "prefix": "::/0", - "protocol": "static", + "protocol": "bgp", "vrfId": 0, "vrfName": "default", "selected": true, "destSelected": true, - "distance": 1, + "distance": 200, "metric": 0, "installed": true, "table": 254, "internalStatus": 16, - "internalFlags": 73, + "internalFlags": 13, "internalNextHopNum": 1, "internalNextHopActiveNum": 1, "nexthops": [ { "flags": 3, "fib": true, - "ip": "2001:2::1", "afi": "ipv6", "interfaceName": "eth0", "active": true, diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce3/frr.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce3/frr.conf index 65e08ce23d..947a4a2551 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce3/frr.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce3/frr.conf @@ -6,4 +6,11 @@ interface eth0 ip forwarding ipv6 forwarding ! -ipv6 route ::/0 2001:3::1 +router bgp 65500 + bgp router-id 1.1.3.1 + neighbor 2001:3::1 remote-as 65500 + address-family ipv6 unicast + neighbor 2001:3::1 activate + exit-address-family +exit + diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce3/ipv6_rib.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce3/ipv6_rib.json index 2f2931f80f..6a373a80b8 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce3/ipv6_rib.json +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce3/ipv6_rib.json @@ -2,24 +2,23 @@ "::/0": [ { "prefix": "::/0", - "protocol": "static", + "protocol": "bgp", "vrfId": 0, "vrfName": "default", "selected": true, "destSelected": true, - "distance": 1, + "distance": 200, "metric": 0, "installed": true, "table": 254, "internalStatus": 16, - "internalFlags": 73, + "internalFlags": 13, "internalNextHopNum": 1, "internalNextHopActiveNum": 1, "nexthops": [ { "flags": 3, "fib": true, - "ip": "2001:3::1", "afi": "ipv6", "interfaceName": "eth0", "active": true, diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce4/frr.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce4/frr.conf index 00d1f076e0..3eaf47961e 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce4/frr.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce4/frr.conf @@ -6,4 +6,11 @@ interface eth0 ip forwarding ipv6 forwarding ! -ipv6 route ::/0 2001:4::1 +router bgp 65501 + bgp router-id 1.1.4.1 + neighbor 2001:4::1 remote-as 65501 + address-family ipv6 unicast + neighbor 2001:4::1 activate + exit-address-family +exit + diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce4/ipv6_rib.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce4/ipv6_rib.json index 8a98768e0d..da6bd55231 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce4/ipv6_rib.json +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce4/ipv6_rib.json @@ -2,24 +2,23 @@ "::/0": [ { "prefix": "::/0", - "protocol": "static", + "protocol": "bgp", "vrfId": 0, "vrfName": "default", "selected": true, "destSelected": true, - "distance": 1, + "distance": 200, "metric": 0, "installed": true, "table": 254, "internalStatus": 16, - "internalFlags": 73, + "internalFlags": 13, "internalNextHopNum": 1, "internalNextHopActiveNum": 1, "nexthops": [ { "flags": 3, "fib": true, - "ip": "2001:4::1", "afi": "ipv6", "interfaceName": "eth0", "active": true, diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce5/frr.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce5/frr.conf index dd5144bce5..5adfc7cfeb 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce5/frr.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce5/frr.conf @@ -6,4 +6,11 @@ interface eth0 ip forwarding ipv6 forwarding ! -ipv6 route ::/0 2001:5::1 +router bgp 65500 + bgp router-id 1.1.5.1 + neighbor 2001:5::1 remote-as 65500 + address-family ipv6 unicast + neighbor 2001:5::1 activate + exit-address-family +exit + diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce5/ipv6_rib.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce5/ipv6_rib.json index 80ff52ad6e..f8ab84d17a 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce5/ipv6_rib.json +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce5/ipv6_rib.json @@ -2,24 +2,23 @@ "::/0": [ { "prefix": "::/0", - "protocol": "static", + "protocol": "bgp", "vrfId": 0, "vrfName": "default", "selected": true, "destSelected": true, - "distance": 1, + "distance": 200, "metric": 0, "installed": true, "table": 254, "internalStatus": 16, - "internalFlags": 73, + "internalFlags": 13, "internalNextHopNum": 1, "internalNextHopActiveNum": 1, "nexthops": [ { "flags": 3, "fib": true, - "ip": "2001:5::1", "afi": "ipv6", "interfaceName": "eth0", "active": true, diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce6/frr.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce6/frr.conf index 47947dce85..3870bd84a3 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce6/frr.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce6/frr.conf @@ -6,4 +6,11 @@ interface eth0 ip forwarding ipv6 forwarding ! -ipv6 route ::/0 2001:6::1 +router bgp 65501 + bgp router-id 1.1.6.1 + neighbor 2001:6::1 remote-as 65501 + address-family ipv6 unicast + neighbor 2001:6::1 activate + exit-address-family +exit + diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce6/ipv6_rib.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce6/ipv6_rib.json index ace6136f06..71ca42e396 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce6/ipv6_rib.json +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce6/ipv6_rib.json @@ -2,24 +2,23 @@ "::/0": [ { "prefix": "::/0", - "protocol": "static", + "protocol": "bgp", "vrfId": 0, "vrfName": "default", "selected": true, "destSelected": true, - "distance": 1, + "distance": 200, "metric": 0, "installed": true, "table": 254, "internalStatus": 16, - "internalFlags": 73, + "internalFlags": 13, "internalNextHopNum": 1, "internalNextHopActiveNum": 1, "nexthops": [ { "flags": 3, "fib": true, - "ip": "2001:6::1", "afi": "ipv6", "interfaceName": "eth0", "active": true, diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/frr.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/frr.conf index e46ab948e6..ef05460b22 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/frr.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/frr.conf @@ -42,11 +42,11 @@ ipv6 route 2001:db8:2:3::/64 2001::2 line vty ! no bgp send-extra-data-zebra -router bgp 1 +router bgp 65500 bgp router-id 1.1.1.1 no bgp ebgp-requires-policy no bgp default ipv4-unicast - neighbor 2001::2 remote-as 2 + neighbor 2001::2 remote-as 65501 neighbor 2001::2 timers 3 10 neighbor 2001::2 timers connect 1 ! @@ -58,12 +58,18 @@ router bgp 1 locator loc1 ! ! -router bgp 1 vrf vrf10 +router bgp 65500 vrf vrf10 bgp router-id 1.1.1.1 no bgp ebgp-requires-policy no bgp default ipv4-unicast ! + neighbor 2001:1::2 remote-as 65500 + neighbor 2001:3::2 remote-as 65500 address-family ipv6 unicast + neighbor 2001:1::2 activate + neighbor 2001:1::2 default-originate + neighbor 2001:3::2 activate + neighbor 2001:3::2 default-originate sid vpn export auto rd vpn export 1:10 rt vpn both 99:99 @@ -72,12 +78,15 @@ router bgp 1 vrf vrf10 redistribute connected exit-address-family ! -router bgp 1 vrf vrf20 +router bgp 65500 vrf vrf20 bgp router-id 1.1.1.1 no bgp ebgp-requires-policy no bgp default ipv4-unicast + neighbor 2001:5::2 remote-as 65500 ! address-family ipv6 unicast + neighbor 2001:5::2 activate + neighbor 2001:5::2 default-originate sid vpn export auto rd vpn export 1:20 rt vpn both 88:88 diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/vpnv6_rib.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/vpnv6_rib.json index 0fdd3d6dc0..d67a3e1cc5 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/vpnv6_rib.json +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/vpnv6_rib.json @@ -3,7 +3,7 @@ "vrfName": "default", "routerId": "1.1.1.1", "defaultLocPrf": 100, - "localAS": 1, + "localAS": 65500, "routes": { "routeDistinguishers": { "1:10": { @@ -101,7 +101,7 @@ "metric": 0, "weight": 0, "peerId": "2001::2", - "path": "2", + "path": "65501", "origin": "incomplete", "nexthops": [ { @@ -127,7 +127,7 @@ "metric": 0, "weight": 0, "peerId": "2001::2", - "path": "2", + "path": "65501", "origin": "incomplete", "nexthops": [ { @@ -151,7 +151,7 @@ "metric": 0, "weight": 0, "peerId": "2001::2", - "path": "2", + "path": "65501", "origin": "incomplete", "nexthops": [ { diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/vpnv6_rib_locator_deleted.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/vpnv6_rib_locator_deleted.json index f2df9be49d..5a7407480b 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/vpnv6_rib_locator_deleted.json +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/vpnv6_rib_locator_deleted.json @@ -3,7 +3,7 @@ "vrfName": "default", "routerId": "1.1.1.1", "defaultLocPrf": 100, - "localAS": 1, + "localAS": 65500, "routes": { "routeDistinguishers": { "1:10": { @@ -92,7 +92,7 @@ "metric": 0, "weight": 0, "peerId": "2001::2", - "path": "2", + "path": "65501", "origin": "incomplete", "nexthops": [ { @@ -118,7 +118,7 @@ "metric": 0, "weight": 0, "peerId": "2001::2", - "path": "2", + "path": "65501", "origin": "incomplete", "nexthops": [ { @@ -142,7 +142,7 @@ "metric": 0, "weight": 0, "peerId": "2001::2", - "path": "2", + "path": "65501", "origin": "incomplete", "nexthops": [ { diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/vpnv6_rib_locator_recreated.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/vpnv6_rib_locator_recreated.json index 0fdd3d6dc0..d67a3e1cc5 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/vpnv6_rib_locator_recreated.json +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/vpnv6_rib_locator_recreated.json @@ -3,7 +3,7 @@ "vrfName": "default", "routerId": "1.1.1.1", "defaultLocPrf": 100, - "localAS": 1, + "localAS": 65500, "routes": { "routeDistinguishers": { "1:10": { @@ -101,7 +101,7 @@ "metric": 0, "weight": 0, "peerId": "2001::2", - "path": "2", + "path": "65501", "origin": "incomplete", "nexthops": [ { @@ -127,7 +127,7 @@ "metric": 0, "weight": 0, "peerId": "2001::2", - "path": "2", + "path": "65501", "origin": "incomplete", "nexthops": [ { @@ -151,7 +151,7 @@ "metric": 0, "weight": 0, "peerId": "2001::2", - "path": "2", + "path": "65501", "origin": "incomplete", "nexthops": [ { diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/frr.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/frr.conf index f5729dd8ee..1bef01d0b3 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/frr.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/frr.conf @@ -43,11 +43,11 @@ ipv6 route 2001:db8:1:3::/64 2001::1 line vty ! no bgp send-extra-data-zebra -router bgp 2 +router bgp 65501 bgp router-id 2.2.2.2 no bgp ebgp-requires-policy no bgp default ipv4-unicast - neighbor 2001::1 remote-as 1 + neighbor 2001::1 remote-as 65500 neighbor 2001::1 timers 3 10 neighbor 2001::1 timers connect 1 ! @@ -59,12 +59,15 @@ router bgp 2 locator loc1 ! ! -router bgp 2 vrf vrf10 +router bgp 65501 vrf vrf10 bgp router-id 2.2.2.2 no bgp ebgp-requires-policy no bgp default ipv4-unicast ! + neighbor 2001:2::2 remote-as 65501 address-family ipv6 unicast + neighbor 2001:2::2 activate + neighbor 2001:2::2 default-originate sid vpn export auto rd vpn export 2:10 rt vpn both 99:99 @@ -73,12 +76,18 @@ router bgp 2 vrf vrf10 redistribute connected exit-address-family ! -router bgp 2 vrf vrf20 +router bgp 65501 vrf vrf20 bgp router-id 2.2.2.2 no bgp ebgp-requires-policy no bgp default ipv4-unicast + neighbor 2001:4::2 remote-as 65501 + neighbor 2001:6::2 remote-as 65501 ! address-family ipv6 unicast + neighbor 2001:4::2 activate + neighbor 2001:4::2 default-originate + neighbor 2001:6::2 activate + neighbor 2001:6::2 default-originate sid vpn export auto rd vpn export 2:20 rt vpn both 88:88 diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vpnv6_rib.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vpnv6_rib.json index 03bbcc008d..114fe1ca25 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vpnv6_rib.json +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vpnv6_rib.json @@ -3,7 +3,7 @@ "vrfName": "default", "routerId": "2.2.2.2", "defaultLocPrf": 100, - "localAS": 2, + "localAS": 65501, "routes": { "routeDistinguishers": { "1:10": { @@ -19,7 +19,7 @@ "metric": 0, "weight": 0, "peerId": "2001::1", - "path": "1", + "path": "65500", "origin": "incomplete", "nexthops": [ { @@ -43,7 +43,7 @@ "metric": 0, "weight": 0, "peerId": "2001::1", - "path": "1", + "path": "65500", "origin": "incomplete", "nexthops": [ { @@ -69,7 +69,7 @@ "metric": 0, "weight": 0, "peerId": "2001::1", - "path": "1", + "path": "65500", "origin": "incomplete", "nexthops": [ { diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vpnv6_rib_locator_deleted.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vpnv6_rib_locator_deleted.json index 25cdf031c3..f0b764dcb2 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vpnv6_rib_locator_deleted.json +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vpnv6_rib_locator_deleted.json @@ -3,7 +3,7 @@ "vrfName": "default", "routerId": "2.2.2.2", "defaultLocPrf": 100, - "localAS": 2, + "localAS": 65501, "routes": { "routeDistinguishers": { "2:10": { diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vpnv6_rib_locator_recreated.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vpnv6_rib_locator_recreated.json index 03bbcc008d..114fe1ca25 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vpnv6_rib_locator_recreated.json +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vpnv6_rib_locator_recreated.json @@ -3,7 +3,7 @@ "vrfName": "default", "routerId": "2.2.2.2", "defaultLocPrf": 100, - "localAS": 2, + "localAS": 65501, "routes": { "routeDistinguishers": { "1:10": { @@ -19,7 +19,7 @@ "metric": 0, "weight": 0, "peerId": "2001::1", - "path": "1", + "path": "65500", "origin": "incomplete", "nexthops": [ { @@ -43,7 +43,7 @@ "metric": 0, "weight": 0, "peerId": "2001::1", - "path": "1", + "path": "65500", "origin": "incomplete", "nexthops": [ { @@ -69,7 +69,7 @@ "metric": 0, "weight": 0, "peerId": "2001::1", - "path": "1", + "path": "65500", "origin": "incomplete", "nexthops": [ { diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/test_bgp_srv6l3vpn_to_bgp_vrf.py b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/test_bgp_srv6l3vpn_to_bgp_vrf.py index 1010bb7bd0..c30410d4dc 100755 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/test_bgp_srv6l3vpn_to_bgp_vrf.py +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/test_bgp_srv6l3vpn_to_bgp_vrf.py @@ -212,7 +212,7 @@ def test_bgp_locator_unset(): get_topogen().gears["r1"].vtysh_cmd( """ configure terminal - router bgp 1 + router bgp 65500 segment-routing srv6 no locator loc1 """ @@ -227,7 +227,7 @@ def test_bgp_locator_reset(): get_topogen().gears["r1"].vtysh_cmd( """ configure terminal - router bgp 1 + router bgp 65500 segment-routing srv6 locator loc1 """ @@ -242,7 +242,7 @@ def test_bgp_srv6_unset(): get_topogen().gears["r1"].vtysh_cmd( """ configure terminal - router bgp 1 + router bgp 65500 no segment-routing srv6 """ ) @@ -256,7 +256,7 @@ def test_bgp_srv6_reset(): get_topogen().gears["r1"].vtysh_cmd( """ configure terminal - router bgp 1 + router bgp 65500 segment-routing srv6 locator loc1 """ From 92ba38bde2d688bfb663e6ab6eadf529397c9f8c Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Fri, 14 Mar 2025 21:11:32 +0100 Subject: [PATCH 04/12] topotests: bgp_srv6l3vpn_to_bgp_vrf, add redistribute BGP update in l3vpn Add a BGP update in CE1 for redistribution. The expectation is that this BGP update will be leaked to the L3VPN. Reversely, if the locator is unset, the L3VPN prefix will be invalidated. Signed-off-by: Philippe Guibert --- .../bgp_srv6l3vpn_to_bgp_vrf/ce1/frr.conf | 2 ++ .../ce2/ipv6_rib.json | 27 ++++++++++++++++ .../r1/vpnv6_rib.json | 30 +++++++++++++++++- .../r1/vpnv6_rib_locator_deleted.json | 27 +++++++++++++++- .../r1/vpnv6_rib_locator_recreated.json | 30 +++++++++++++++++- .../r2/vpnv6_rib.json | 28 ++++++++++++++++- .../r2/vpnv6_rib_locator_deleted.json | 4 ++- .../r2/vpnv6_rib_locator_recreated.json | 28 ++++++++++++++++- .../r2/vrf10_rib.json | 31 +++++++++++++++++++ 9 files changed, 201 insertions(+), 6 deletions(-) diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/frr.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/frr.conf index c70ad42437..ca28d55409 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/frr.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/frr.conf @@ -8,8 +8,10 @@ ipv6 forwarding ! router bgp 65500 bgp router-id 1.1.2.1 + no bgp network import-check neighbor 2001:1::1 remote-as 65500 address-family ipv6 unicast + network 2011:1::1/64 neighbor 2001:1::1 activate exit-address-family exit diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/ipv6_rib.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/ipv6_rib.json index 1f42595271..51076ee194 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/ipv6_rib.json +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/ipv6_rib.json @@ -53,5 +53,32 @@ } ] } + ], + "2011:1::/64": [ + { + "prefix": "2011:1::/64", + "protocol": "bgp", + "vrfId": 0, + "vrfName": "default", + "selected": true, + "destSelected": true, + "distance": 200, + "metric": 0, + "installed": true, + "table": 254, + "internalStatus": 16, + "internalFlags": 13, + "internalNextHopNum": 1, + "internalNextHopActiveNum": 1, + "nexthops": [ + { + "flags": 3, + "fib": true, + "afi": "ipv6", + "interfaceName": "eth0", + "active": true + } + ] + } ] } diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/vpnv6_rib.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/vpnv6_rib.json index d67a3e1cc5..afa713e37f 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/vpnv6_rib.json +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/vpnv6_rib.json @@ -58,6 +58,32 @@ } ] } + ], + "2011:1::/64": [ + { + "valid": true, + "bestpath": true, + "selectionReason": "First path received", + "pathFrom": "external", + "prefix": "2011:1::", + "prefixLen": 64, + "network": "2011:1::/64", + "metric": 0, + "weight": 0, + "peerId": "(unspec)", + "path": "", + "origin": "IGP", + "announceNexthopSelf": true, + "nhVrfName": "vrf10", + "nexthops": [ + { + "ip": "2001:1::2", + "hostname": "r1", + "afi": "ipv6", + "used": true + } + ] + } ] }, "1:20": { @@ -165,5 +191,7 @@ ] } } - } + }, + "totalRoutes": 7, + "totalPaths": 7 } diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/vpnv6_rib_locator_deleted.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/vpnv6_rib_locator_deleted.json index 5a7407480b..a3a5f0438a 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/vpnv6_rib_locator_deleted.json +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/vpnv6_rib_locator_deleted.json @@ -52,6 +52,29 @@ } ] } + ], + "2011:1::/64": [ + { + "pathFrom": "external", + "prefix": "2011:1::", + "prefixLen": 64, + "network": "2011:1::/64", + "metric": 0, + "weight": 0, + "peerId": "(unspec)", + "path": "", + "origin": "IGP", + "announceNexthopSelf": true, + "nhVrfName": "vrf10", + "nexthops": [ + { + "ip": "2001:1::2", + "hostname": "r1", + "afi": "ipv6", + "used": true + } + ] + } ] }, "1:20": { @@ -156,5 +179,7 @@ ] } } - } + }, + "totalRoutes": 7, + "totalPaths": 7 } diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/vpnv6_rib_locator_recreated.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/vpnv6_rib_locator_recreated.json index d67a3e1cc5..afa713e37f 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/vpnv6_rib_locator_recreated.json +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/vpnv6_rib_locator_recreated.json @@ -58,6 +58,32 @@ } ] } + ], + "2011:1::/64": [ + { + "valid": true, + "bestpath": true, + "selectionReason": "First path received", + "pathFrom": "external", + "prefix": "2011:1::", + "prefixLen": 64, + "network": "2011:1::/64", + "metric": 0, + "weight": 0, + "peerId": "(unspec)", + "path": "", + "origin": "IGP", + "announceNexthopSelf": true, + "nhVrfName": "vrf10", + "nexthops": [ + { + "ip": "2001:1::2", + "hostname": "r1", + "afi": "ipv6", + "used": true + } + ] + } ] }, "1:20": { @@ -165,5 +191,7 @@ ] } } - } + }, + "totalRoutes": 7, + "totalPaths": 7 } diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vpnv6_rib.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vpnv6_rib.json index 114fe1ca25..e7695281d9 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vpnv6_rib.json +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vpnv6_rib.json @@ -54,6 +54,30 @@ } ] } + ], + "2011:1::/64": [ + { + "valid": true, + "bestpath": true, + "selectionReason": "First path received", + "pathFrom": "external", + "prefix": "2011:1::", + "prefixLen": 64, + "network": "2011:1::/64", + "metric": 0, + "weight": 0, + "peerId": "2001::1", + "path": "65500", + "origin": "IGP", + "nexthops": [ + { + "ip": "2001::1", + "hostname": "r1", + "afi": "ipv6", + "used": true + } + ] + } ] }, "1:20": { @@ -165,5 +189,7 @@ ] } } - } + }, + "totalRoutes": 7, + "totalPaths": 7 } diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vpnv6_rib_locator_deleted.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vpnv6_rib_locator_deleted.json index f0b764dcb2..caa5803bfe 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vpnv6_rib_locator_deleted.json +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vpnv6_rib_locator_deleted.json @@ -89,5 +89,7 @@ ] } } - } + }, + "totalRoutes": 3, + "totalPaths": 3 } diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vpnv6_rib_locator_recreated.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vpnv6_rib_locator_recreated.json index 114fe1ca25..e7695281d9 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vpnv6_rib_locator_recreated.json +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vpnv6_rib_locator_recreated.json @@ -54,6 +54,30 @@ } ] } + ], + "2011:1::/64": [ + { + "valid": true, + "bestpath": true, + "selectionReason": "First path received", + "pathFrom": "external", + "prefix": "2011:1::", + "prefixLen": 64, + "network": "2011:1::/64", + "metric": 0, + "weight": 0, + "peerId": "2001::1", + "path": "65500", + "origin": "IGP", + "nexthops": [ + { + "ip": "2001::1", + "hostname": "r1", + "afi": "ipv6", + "used": true + } + ] + } ] }, "1:20": { @@ -165,5 +189,7 @@ ] } } - } + }, + "totalRoutes": 7, + "totalPaths": 7 } diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vrf10_rib.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vrf10_rib.json index be1c58d3d1..407dfb9fb4 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vrf10_rib.json +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/vrf10_rib.json @@ -86,5 +86,36 @@ } ] } + ], + "2011:1::/64": [ + { + "prefix": "2011:1::/64", + "protocol": "bgp", + "vrfName": "vrf10", + "selected": true, + "destSelected": true, + "distance": 20, + "metric": 0, + "installed": true, + "table": 10, + "internalStatus": 16, + "internalFlags": 8, + "internalNextHopNum": 1, + "internalNextHopActiveNum": 1, + "nexthops": [ + { + "flags": 3, + "fib": true, + "afi": "ipv6", + "interfaceName": "eth0", + "vrf": "default", + "active": true, + "weight": 1, + "seg6": { + "segs": "2001:db8:1:1:100::" + } + } + ] + } ] } From 11ac6ab650c79bc520e9ad7266c8abc2ed131d6b Mon Sep 17 00:00:00 2001 From: Jonathan Voss Date: Thu, 13 Mar 2025 22:04:48 +0000 Subject: [PATCH 05/12] topotests: extend bgp_srv6_l3vpn_to_bgp_vrf4 test with bgp peers This test ensures route redistribution across an srv6 VPN network is well taken into account. Signed-off-by: Jonathan Voss Signed-off-by: Philippe Guibert --- .../bgp_srv6l3vpn_to_bgp_vrf4/ce1/bgpd.conf | 43 ++++++ .../bgp_srv6l3vpn_to_bgp_vrf4/ce1/ip_rib.json | 59 ++++++++ .../ce1/ipv6_rib.json | 59 ++++++++ .../bgp_srv6l3vpn_to_bgp_vrf4/ce1/setup.sh | 1 + .../bgp_srv6l3vpn_to_bgp_vrf4/ce1/zebra.conf | 16 ++ .../bgp_srv6l3vpn_to_bgp_vrf4/ce2/bgpd.conf | 43 ++++++ .../bgp_srv6l3vpn_to_bgp_vrf4/ce2/ip_rib.json | 59 ++++++++ .../ce2/ipv6_rib.json | 59 ++++++++ .../bgp_srv6l3vpn_to_bgp_vrf4/ce2/setup.sh | 1 + .../bgp_srv6l3vpn_to_bgp_vrf4/ce2/zebra.conf | 16 ++ .../bgp_srv6l3vpn_to_bgp_vrf4/r1/bgpd.conf | 71 +++++++++ .../bgp_srv6l3vpn_to_bgp_vrf4/r1/setup.sh | 4 + .../r1/vpnv4_rib.json | 64 ++++++++ .../r1/vpnv6_rib.json | 63 ++++++++ .../r1/vrf10v4_rib.json | 62 ++++++++ .../r1/vrf10v6_rib.json | 63 ++++++++ .../bgp_srv6l3vpn_to_bgp_vrf4/r1/zebra.conf | 25 +++ .../bgp_srv6l3vpn_to_bgp_vrf4/r2/bgpd.conf | 71 +++++++++ .../bgp_srv6l3vpn_to_bgp_vrf4/r2/setup.sh | 4 + .../r2/vpnv4_rib.json | 64 ++++++++ .../r2/vpnv6_rib.json | 63 ++++++++ .../r2/vrf10v4_rib.json | 63 ++++++++ .../r2/vrf10v6_rib.json | 63 ++++++++ .../bgp_srv6l3vpn_to_bgp_vrf4/r2/zebra.conf | 25 +++ .../test_bgp_srv6l3vpn_to_bgp_vrf4.py | 143 ++++++++++++++++++ 25 files changed, 1204 insertions(+) create mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce1/bgpd.conf create mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce1/ip_rib.json create mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce1/ipv6_rib.json create mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce1/setup.sh create mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce1/zebra.conf create mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce2/bgpd.conf create mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce2/ip_rib.json create mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce2/ipv6_rib.json create mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce2/setup.sh create mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce2/zebra.conf create mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/bgpd.conf create mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/setup.sh create mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/vpnv4_rib.json create mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/vpnv6_rib.json create mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/vrf10v4_rib.json create mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/vrf10v6_rib.json create mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/zebra.conf create mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/bgpd.conf create mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/setup.sh create mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/vpnv4_rib.json create mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/vpnv6_rib.json create mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/vrf10v4_rib.json create mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/vrf10v6_rib.json create mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/zebra.conf create mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/test_bgp_srv6l3vpn_to_bgp_vrf4.py diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce1/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce1/bgpd.conf new file mode 100644 index 0000000000..224d59b37d --- /dev/null +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce1/bgpd.conf @@ -0,0 +1,43 @@ +frr defaults traditional +! +bgp send-extra-data zebra +! +hostname ce1 +password zebra +! +log stdout notifications +log commands +! +!debug bgp neighbor-events +!debug bgp zebra +!debug bgp vnc verbose +!debug bgp update-groups +!debug bgp updates in +!debug bgp updates out +!debug bgp vpn label +!debug bgp vpn leak-from-vrf +!debug bgp vpn leak-to-vrf +!debug bgp vpn rmap-event +! +router bgp 65001 + bgp router-id 1.0.0.1 + no bgp ebgp-requires-policy + !no bgp default ipv4-unicast + neighbor fd01::1 remote-as 1 + neighbor fd01::1 timers 3 10 + neighbor fd01::1 timers connect 1 + neighbor fd01::1 interface eth0 + neighbor fd01::1 update-source fd01::2 + neighbor fd01::1 capability extended-nexthop + ! + address-family ipv4 unicast + network 192.168.1.0 mask 255.255.255.0 + neighbor fd01::1 activate + exit-address-family + ! + address-family ipv6 unicast + network 2001:1::/64 + neighbor fd01::1 activate + exit-address-family + ! +! diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce1/ip_rib.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce1/ip_rib.json new file mode 100644 index 0000000000..352c48b1b2 --- /dev/null +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce1/ip_rib.json @@ -0,0 +1,59 @@ +{ + "192.168.1.0/24": [ + { + "prefix": "192.168.1.0/24", + "prefixLen": 24, + "protocol": "connected", + "vrfName": "default", + "selected": true, + "destSelected": true, + "distance": 0, + "metric": 0, + "installed": true, + "table": 254, + "internalStatus": 16, + "internalFlags": 8, + "internalNextHopNum": 1, + "internalNextHopActiveNum": 1, + "nexthops": [ + { + "flags": 3, + "fib": true, + "directlyConnected": true, + "interfaceName": "dum0", + "active": true, + "weight": 1 + } + ] + } + ], + "192.168.2.0/24": [ + { + "prefix": "192.168.2.0/24", + "prefixLen": 24, + "protocol": "bgp", + "vrfName": "default", + "selected": true, + "destSelected": true, + "distance": 20, + "metric": 0, + "installed": true, + "table": 254, + "internalStatus": 16, + "internalFlags": 8, + "internalNextHopNum": 1, + "internalNextHopActiveNum": 1, + "nexthops": [ + { + "flags": 3, + "fib": true, + "afi": "ipv6", + "interfaceName": "eth0", + "active": true, + "weight": 1 + } + ], + "asPath": "1 2 65002" + } + ] +} diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce1/ipv6_rib.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce1/ipv6_rib.json new file mode 100644 index 0000000000..fd10ee326f --- /dev/null +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce1/ipv6_rib.json @@ -0,0 +1,59 @@ +{ + "2001:1::/64": [ + { + "prefix": "2001:1::/64", + "prefixLen": 64, + "protocol": "connected", + "vrfName": "default", + "selected": true, + "destSelected": true, + "distance": 0, + "metric": 0, + "installed": true, + "table": 254, + "internalStatus": 16, + "internalFlags": 8, + "internalNextHopNum": 1, + "internalNextHopActiveNum": 1, + "nexthops": [ + { + "flags": 3, + "fib": true, + "directlyConnected": true, + "interfaceName": "dum0", + "active": true, + "weight": 1 + } + ] + } + ], + "2001:2::/64": [ + { + "prefix": "2001:2::/64", + "prefixLen": 64, + "protocol": "bgp", + "vrfName": "default", + "selected": true, + "destSelected": true, + "distance": 20, + "metric": 0, + "installed": true, + "table": 254, + "internalStatus": 16, + "internalFlags": 8, + "internalNextHopNum": 1, + "internalNextHopActiveNum": 1, + "nexthops": [ + { + "flags": 3, + "fib": true, + "afi": "ipv6", + "interfaceName": "eth0", + "active": true, + "weight": 1 + } + ], + "asPath": "1 2 65002" + } + ] +} diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce1/setup.sh b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce1/setup.sh new file mode 100644 index 0000000000..88bdcbda82 --- /dev/null +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce1/setup.sh @@ -0,0 +1 @@ +ip link add dum0 type dummy diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce1/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce1/zebra.conf new file mode 100644 index 0000000000..b6866f8a43 --- /dev/null +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce1/zebra.conf @@ -0,0 +1,16 @@ +log file zebra.log +! +hostname ce1 +! +interface eth0 + ipv6 address fd01::2/64 +! +interface dum0 + ip address 192.168.1.1/24 + ipv6 address 2001:1::1/64 +! +ip forwarding +ipv6 forwarding +! +line vty +! diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce2/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce2/bgpd.conf new file mode 100644 index 0000000000..df9a93b033 --- /dev/null +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce2/bgpd.conf @@ -0,0 +1,43 @@ +frr defaults traditional +! +bgp send-extra-data zebra +! +hostname ce2 +password zebra +! +log stdout notifications +log commands +! +!debug bgp neighbor-events +!debug bgp zebra +!debug bgp vnc verbose +!debug bgp update-groups +!debug bgp updates in +!debug bgp updates out +!debug bgp vpn label +!debug bgp vpn leak-from-vrf +!debug bgp vpn leak-to-vrf +!debug bgp vpn rmap-event +! +router bgp 65002 + bgp router-id 2.0.0.2 + no bgp ebgp-requires-policy + !no bgp default ipv4-unicast + neighbor fd02::1 remote-as 2 + neighbor fd02::1 timers 3 10 + neighbor fd02::1 timers connect 1 + neighbor fd02::1 interface eth0 + neighbor fd02::1 update-source fd02::2 + neighbor fd02::1 capability extended-nexthop + ! + address-family ipv4 unicast + network 192.168.2.0 mask 255.255.255.0 + neighbor fd02::1 activate + exit-address-family + ! + address-family ipv6 unicast + network 2001:2::/64 + neighbor fd02::1 activate + exit-address-family + ! +! diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce2/ip_rib.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce2/ip_rib.json new file mode 100644 index 0000000000..936f239ea6 --- /dev/null +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce2/ip_rib.json @@ -0,0 +1,59 @@ +{ + "192.168.1.0/24": [ + { + "prefix": "192.168.1.0/24", + "prefixLen": 24, + "protocol": "bgp", + "vrfName": "default", + "selected": true, + "destSelected": true, + "distance": 20, + "metric": 0, + "installed": true, + "table": 254, + "internalStatus": 16, + "internalFlags": 8, + "internalNextHopNum": 1, + "internalNextHopActiveNum": 1, + "nexthops": [ + { + "flags": 3, + "fib": true, + "afi": "ipv6", + "interfaceName": "eth0", + "active": true, + "weight": 1 + } + ], + "asPath": "2 1 65001" + } + ], + "192.168.2.0/24": [ + { + "prefix": "192.168.2.0/24", + "prefixLen": 24, + "protocol": "connected", + "vrfName": "default", + "selected": true, + "destSelected": true, + "distance": 0, + "metric": 0, + "installed": true, + "table": 254, + "internalStatus": 16, + "internalFlags": 8, + "internalNextHopNum": 1, + "internalNextHopActiveNum": 1, + "nexthops": [ + { + "flags": 3, + "fib": true, + "directlyConnected": true, + "interfaceName": "dum0", + "active": true, + "weight": 1 + } + ] + } + ] +} diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce2/ipv6_rib.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce2/ipv6_rib.json new file mode 100644 index 0000000000..260adbc20c --- /dev/null +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce2/ipv6_rib.json @@ -0,0 +1,59 @@ +{ + "2001:1::/64": [ + { + "prefix": "2001:1::/64", + "prefixLen": 64, + "protocol": "bgp", + "vrfName": "default", + "selected": true, + "destSelected": true, + "distance": 20, + "metric": 0, + "installed": true, + "table": 254, + "internalStatus": 16, + "internalFlags": 8, + "internalNextHopNum": 1, + "internalNextHopActiveNum": 1, + "nexthops": [ + { + "flags": 3, + "fib": true, + "afi": "ipv6", + "interfaceName": "eth0", + "active": true, + "weight": 1 + } + ], + "asPath": "2 1 65001" + } + ], + "2001:2::/64": [ + { + "prefix": "2001:2::/64", + "prefixLen": 64, + "protocol": "connected", + "vrfName": "default", + "selected": true, + "destSelected": true, + "distance": 0, + "metric": 0, + "installed": true, + "table": 254, + "internalStatus": 16, + "internalFlags": 8, + "internalNextHopNum": 1, + "internalNextHopActiveNum": 1, + "nexthops": [ + { + "flags": 3, + "fib": true, + "directlyConnected": true, + "interfaceName": "dum0", + "active": true, + "weight": 1 + } + ] + } + ] +} diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce2/setup.sh b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce2/setup.sh new file mode 100644 index 0000000000..88bdcbda82 --- /dev/null +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce2/setup.sh @@ -0,0 +1 @@ +ip link add dum0 type dummy diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce2/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce2/zebra.conf new file mode 100644 index 0000000000..0faa8a7a05 --- /dev/null +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce2/zebra.conf @@ -0,0 +1,16 @@ +log file zebra.log +! +hostname ce1 +! +interface eth0 + ipv6 address fd02::2/64 +! +interface dum0 + ip address 192.168.2.1/24 + ipv6 address 2001:2::1/64 +! +ip forwarding +ipv6 forwarding +! +line vty +! diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/bgpd.conf new file mode 100644 index 0000000000..b26326ea10 --- /dev/null +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/bgpd.conf @@ -0,0 +1,71 @@ +frr defaults traditional +! +bgp send-extra-data zebra +! +hostname r1 +password zebra +! +log stdout notifications +log commands +! +!debug bgp neighbor-events +!debug bgp nht +!debug bgp zebra +!debug bgp vnc verbose +!debug bgp update-groups +!debug bgp updates in +!debug bgp updates out +!debug bgp vpn label +!debug bgp vpn leak-from-vrf +!debug bgp vpn leak-to-vrf +!debug bgp vpn rmap-event +! +router bgp 1 + bgp router-id 1.1.1.1 + no bgp default ipv4-unicast + no bgp ebgp-requires-policy + neighbor 2001::2 remote-as 2 + neighbor 2001::2 timers 3 10 + neighbor 2001::2 timers connect 1 + neighbor 2001::2 capability extended-nexthop + ! + address-family ipv4 vpn + neighbor 2001::2 activate + exit-address-family + ! + address-family ipv6 vpn + neighbor 2001::2 activate + exit-address-family + ! + segment-routing srv6 + locator loc1 + ! +! +router bgp 1 vrf vrf10 + bgp router-id 1.1.1.1 + no bgp ebgp-requires-policy + sid vpn per-vrf export auto + neighbor fd01::2 remote-as 65001 + neighbor fd01::2 capability extended-nexthop + neighbor fd01::2 description ce1 + neighbor fd01::2 interface eth1 + neighbor fd01::2 update-source fd01::1 + ! + address-family ipv4 unicast + nexthop vpn export 2001::1 + rd vpn export 1:10 + rt vpn both 99:99 + import vpn + export vpn + neighbor fd01::2 activate + exit-address-family + ! + address-family ipv6 unicast + nexthop vpn export 2001::1 + rd vpn export 1:10 + rt vpn both 99:99 + import vpn + export vpn + neighbor fd01::2 activate + exit-address-family +! diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/setup.sh b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/setup.sh new file mode 100644 index 0000000000..ac1844f733 --- /dev/null +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/setup.sh @@ -0,0 +1,4 @@ +sysctl net.vrf.strict_mode=1 +ip link add vrf10 type vrf table 10 +ip link set vrf10 up +ip link set eth1 master vrf10 diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/vpnv4_rib.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/vpnv4_rib.json new file mode 100644 index 0000000000..6cdeac2991 --- /dev/null +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/vpnv4_rib.json @@ -0,0 +1,64 @@ +{ + "vrfId": 0, + "vrfName": "default", + "routerId": "1.1.1.1", + "defaultLocPrf": 100, + "localAS": 1, + "routes": { + "routeDistinguishers": { + "1:10": { + "192.168.1.0/24": [ + { + "valid": true, + "bestpath": true, + "selectionReason": "First path received", + "pathFrom": "external", + "prefix": "192.168.1.0", + "prefixLen": 24, + "network": "192.168.1.0/24", + "metric": 0, + "weight": 0, + "peerId": "(unspec)", + "path": "65001", + "origin": "IGP", + "nhVrfName": "vrf10", + "nexthops": [ + { + "ip": "2001::1", + "hostname": "r1", + "afi": "ipv6", + "used": true + } + ] + } + ] + }, + "2:10": { + "192.168.2.0/24": [ + { + "valid": true, + "bestpath": true, + "selectionReason": "First path received", + "pathFrom": "external", + "prefix": "192.168.2.0", + "prefixLen": 24, + "network": "192.168.2.0/24", + "metric": 0, + "weight": 0, + "peerId": "2001::2", + "path": "2 65002", + "origin": "IGP", + "nexthops": [ + { + "ip": "2001::2", + "hostname": "r2", + "afi": "ipv6", + "used": true + } + ] + } + ] + } + } + } +} diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/vpnv6_rib.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/vpnv6_rib.json new file mode 100644 index 0000000000..77b272de65 --- /dev/null +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/vpnv6_rib.json @@ -0,0 +1,63 @@ +{ + "vrfId": 0, + "vrfName": "default", + "routerId": "1.1.1.1", + "defaultLocPrf": 100, + "localAS": 1, + "routes": { + "routeDistinguishers": { + "1:10": { + "2001:1::/64": [ + { + "valid": true, + "bestpath": true, + "selectionReason": "First path received", + "pathFrom": "external", + "prefix": "2001:1::", + "prefixLen": 64, + "network": "2001:1::/64", + "metric": 0, + "weight": 0, + "peerId": "(unspec)", + "path": "65001", + "origin": "IGP", + "nhVrfName": "vrf10", + "nexthops": [ + { + "hostname": "r1", + "afi": "ipv6", + "used": true + } + ] + } + ] + }, + "2:10": { + "2001:2::/64": [ + { + "valid": true, + "bestpath": true, + "selectionReason": "First path received", + "pathFrom": "external", + "prefix": "2001:2::", + "prefixLen": 64, + "network": "2001:2::/64", + "metric": 0, + "weight": 0, + "peerId": "2001::2", + "path": "2 65002", + "origin": "IGP", + "nexthops": [ + { + "ip": "2001::2", + "hostname": "r2", + "afi": "ipv6", + "used": true + } + ] + } + ] + } + } + } +} diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/vrf10v4_rib.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/vrf10v4_rib.json new file mode 100644 index 0000000000..f7da30637b --- /dev/null +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/vrf10v4_rib.json @@ -0,0 +1,62 @@ +{ + "192.168.1.0/24": [ + { + "prefix": "192.168.1.0/24", + "prefixLen": 24, + "protocol": "bgp", + "vrfName": "vrf10", + "selected": true, + "destSelected": true, + "distance": 20, + "metric": 0, + "installed": true, + "table": 10, + "internalStatus": 16, + "internalFlags": 8, + "internalNextHopNum": 1, + "internalNextHopActiveNum": 1, + "nexthops": [ + { + "flags": 3, + "fib": true, + "afi": "ipv6", + "interfaceName": "eth1", + "active": true + } + ], + "asPath": "65001" + } + ], + "192.168.2.0/24": [ + { + "prefix": "192.168.2.0/24", + "prefixLen": 24, + "protocol": "bgp", + "vrfName": "vrf10", + "selected": true, + "destSelected": true, + "distance": 20, + "metric": 0, + "installed": true, + "table": 10, + "internalStatus": 16, + "internalFlags": 8, + "internalNextHopNum": 1, + "internalNextHopActiveNum": 1, + "nexthops": [ + { + "flags": 3, + "fib": true, + "afi": "ipv6", + "interfaceName": "eth0", + "vrf": "default", + "active": true, + "seg6": { + "segs": "2001:db8:2:2:1::" + } + } + ], + "asPath": "2 65002" + } + ] +} diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/vrf10v6_rib.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/vrf10v6_rib.json new file mode 100644 index 0000000000..12e7087060 --- /dev/null +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/vrf10v6_rib.json @@ -0,0 +1,63 @@ +{ + "2001:1::/64": [ + { + "prefix": "2001:1::/64", + "prefixLen": 64, + "protocol": "bgp", + "vrfName": "vrf10", + "selected": true, + "destSelected": true, + "distance": 20, + "metric": 0, + "installed": true, + "table": 10, + "internalStatus": 16, + "internalFlags": 8, + "internalNextHopNum": 1, + "internalNextHopActiveNum": 1, + "nexthops": [ + { + "flags": 3, + "fib": true, + "afi": "ipv6", + "interfaceName": "eth1", + "active": true, + "weight": 1 + } + ], + "asPath": "65001" + } + ], + "2001:2::/64": [ + { + "prefix": "2001:2::/64", + "prefixLen": 64, + "protocol": "bgp", + "vrfName": "vrf10", + "selected": true, + "destSelected": true, + "distance": 20, + "metric": 0, + "installed": true, + "table": 10, + "internalStatus": 16, + "internalFlags": 8, + "internalNextHopNum": 1, + "internalNextHopActiveNum": 1, + "nexthops": [ + { + "flags": 3, + "fib": true, + "afi": "ipv6", + "interfaceName": "eth0", + "vrf": "default", + "active": true, + "seg6": { + "segs": "2001:db8:2:2:1::" + } + } + ], + "asPath": "2 65002" + } + ] +} diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/zebra.conf new file mode 100644 index 0000000000..78aa81fcb8 --- /dev/null +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/zebra.conf @@ -0,0 +1,25 @@ +log file zebra.log +! +hostname r1 +! +interface eth0 + ipv6 address 2001::1/64 +! +interface eth1 vrf vrf10 + ipv6 address fd01::1/64 +! +segment-routing + srv6 + locators + locator loc1 + prefix 2001:db8:1:1::/64 + ! + ! +! +ip forwarding +ipv6 forwarding +! +ipv6 route 2001:db8:2:2::/64 2001::2 +! +line vty +! diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/bgpd.conf new file mode 100644 index 0000000000..63dce15ff7 --- /dev/null +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/bgpd.conf @@ -0,0 +1,71 @@ +frr defaults traditional +! +bgp send-extra-data zebra +! +hostname r2 +password zebra +! +log stdout notifications +log commands +! +!debug bgp neighbor-events +!debug bgp nht +!debug bgp zebra +!debug bgp vnc verbose +!debug bgp update-groups +!debug bgp updates in +!debug bgp updates out +!debug bgp vpn label +!debug bgp vpn leak-from-vrf +!debug bgp vpn leak-to-vrf +!debug bgp vpn rmap-event +! +router bgp 2 + bgp router-id 2.2.2.2 + no bgp default ipv4-unicast + no bgp ebgp-requires-policy + neighbor 2001::1 remote-as 1 + neighbor 2001::1 timers 3 10 + neighbor 2001::1 timers connect 1 + neighbor 2001::1 capability extended-nexthop + ! + address-family ipv4 vpn + neighbor 2001::1 activate + exit-address-family + ! + address-family ipv6 vpn + neighbor 2001::1 activate + exit-address-family + ! + segment-routing srv6 + locator loc1 + ! +! +router bgp 2 vrf vrf10 + bgp router-id 2.2.2.2 + no bgp ebgp-requires-policy + sid vpn per-vrf export auto + neighbor fd02::2 remote-as 65002 + neighbor fd02::2 capability extended-nexthop + neighbor fd02::2 description ce2 + neighbor fd02::2 interface eth1 + neighbor fd02::2 update-source fd02::1 + ! + address-family ipv4 unicast + nexthop vpn export 2001::2 + rd vpn export 2:10 + rt vpn both 99:99 + import vpn + export vpn + neighbor fd02::2 activate + exit-address-family + ! + address-family ipv6 unicast + nexthop vpn export 2001::2 + rd vpn export 2:10 + rt vpn both 99:99 + import vpn + export vpn + neighbor fd02::2 activate + exit-address-family +! diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/setup.sh b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/setup.sh new file mode 100644 index 0000000000..ac1844f733 --- /dev/null +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/setup.sh @@ -0,0 +1,4 @@ +sysctl net.vrf.strict_mode=1 +ip link add vrf10 type vrf table 10 +ip link set vrf10 up +ip link set eth1 master vrf10 diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/vpnv4_rib.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/vpnv4_rib.json new file mode 100644 index 0000000000..c1f67a771c --- /dev/null +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/vpnv4_rib.json @@ -0,0 +1,64 @@ +{ + "vrfId": 0, + "vrfName": "default", + "routerId": "2.2.2.2", + "defaultLocPrf": 100, + "localAS": 2, + "routes": { + "routeDistinguishers": { + "1:10": { + "192.168.1.0/24": [ + { + "valid": true, + "bestpath": true, + "selectionReason": "First path received", + "pathFrom": "external", + "prefix": "192.168.1.0", + "prefixLen": 24, + "network": "192.168.1.0/24", + "metric": 0, + "weight": 0, + "peerId": "2001::1", + "path": "1 65001", + "origin": "IGP", + "nexthops": [ + { + "ip": "2001::1", + "hostname": "r1", + "afi": "ipv6", + "used": true + } + ] + } + ] + }, + "2:10": { + "192.168.2.0/24": [ + { + "valid": true, + "bestpath": true, + "selectionReason": "First path received", + "pathFrom": "external", + "prefix": "192.168.2.0", + "prefixLen": 24, + "network": "192.168.2.0/24", + "metric": 0, + "weight": 0, + "peerId": "(unspec)", + "path": "65002", + "origin": "IGP", + "nhVrfName": "vrf10", + "nexthops": [ + { + "ip": "2001::2", + "hostname": "r2", + "afi": "ipv6", + "used": true + } + ] + } + ] + } + } + } +} diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/vpnv6_rib.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/vpnv6_rib.json new file mode 100644 index 0000000000..da3ddd0699 --- /dev/null +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/vpnv6_rib.json @@ -0,0 +1,63 @@ +{ + "vrfId": 0, + "vrfName": "default", + "routerId": "2.2.2.2", + "defaultLocPrf": 100, + "localAS": 2, + "routes": { + "routeDistinguishers": { + "1:10": { + "2001:1::/64": [ + { + "valid": true, + "bestpath": true, + "selectionReason": "First path received", + "pathFrom": "external", + "prefix": "2001:1::", + "prefixLen": 64, + "network": "2001:1::/64", + "metric": 0, + "weight": 0, + "peerId": "2001::1", + "path": "1 65001", + "origin": "IGP", + "nexthops": [ + { + "ip": "2001::1", + "hostname": "r1", + "afi": "ipv6", + "used": true + } + ] + } + ] + }, + "2:10": { + "2001:2::/64": [ + { + "valid": true, + "bestpath": true, + "selectionReason": "First path received", + "pathFrom": "external", + "prefix": "2001:2::", + "prefixLen": 64, + "network": "2001:2::/64", + "metric": 0, + "weight": 0, + "peerId": "(unspec)", + "path": "65002", + "origin": "IGP", + "nhVrfName": "vrf10", + "nexthops": [ + { + "hostname": "r2", + "afi": "ipv6", + "used": true + } + ] + } + ] + } + } + } +} diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/vrf10v4_rib.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/vrf10v4_rib.json new file mode 100644 index 0000000000..5cc093fea8 --- /dev/null +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/vrf10v4_rib.json @@ -0,0 +1,63 @@ +{ + "192.168.1.0/24": [ + { + "prefix": "192.168.1.0/24", + "prefixLen": 24, + "protocol": "bgp", + "vrfName": "vrf10", + "selected": true, + "destSelected": true, + "distance": 20, + "metric": 0, + "installed": true, + "table": 10, + "internalStatus": 16, + "internalFlags": 8, + "internalNextHopNum": 1, + "internalNextHopActiveNum": 1, + "nexthops": [ + { + "flags": 3, + "fib": true, + "afi": "ipv6", + "interfaceName": "eth0", + "vrf": "default", + "active": true, + "seg6": { + "segs": "2001:db8:1:1:1::" + } + } + ], + "asPath": "1 65001" + } + ], + "192.168.2.0/24": [ + { + "prefix": "192.168.2.0/24", + "prefixLen": 24, + "protocol": "bgp", + "vrfName": "vrf10", + "selected": true, + "destSelected": true, + "distance": 20, + "metric": 0, + "installed": true, + "table": 10, + "internalStatus": 16, + "internalFlags": 8, + "internalNextHopNum": 1, + "internalNextHopActiveNum": 1, + "nexthops": [ + { + "flags": 3, + "fib": true, + "afi": "ipv6", + "interfaceName": "eth1", + "active": true, + "weight": 1 + } + ], + "asPath": "65002" + } + ] +} diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/vrf10v6_rib.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/vrf10v6_rib.json new file mode 100644 index 0000000000..5e8114e17b --- /dev/null +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/vrf10v6_rib.json @@ -0,0 +1,63 @@ +{ + "2001:1::/64": [ + { + "prefix": "2001:1::/64", + "prefixLen": 64, + "protocol": "bgp", + "vrfName": "vrf10", + "selected": true, + "destSelected": true, + "distance": 20, + "metric": 0, + "installed": true, + "table": 10, + "internalStatus": 16, + "internalFlags": 8, + "internalNextHopNum": 1, + "internalNextHopActiveNum": 1, + "nexthops": [ + { + "flags": 3, + "fib": true, + "afi": "ipv6", + "interfaceName": "eth0", + "vrf": "default", + "active": true, + "seg6": { + "segs": "2001:db8:1:1:1::" + } + } + ], + "asPath": "1 65001" + } + ], + "2001:2::/64": [ + { + "prefix": "2001:2::/64", + "prefixLen": 64, + "protocol": "bgp", + "vrfName": "vrf10", + "selected": true, + "destSelected": true, + "distance": 20, + "metric": 0, + "installed": true, + "table": 10, + "internalStatus": 16, + "internalFlags": 8, + "internalNextHopNum": 1, + "internalNextHopActiveNum": 1, + "nexthops": [ + { + "flags": 3, + "fib": true, + "afi": "ipv6", + "interfaceName": "eth1", + "active": true, + "weight": 1 + } + ], + "asPath": "65002" + } + ] +} diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/zebra.conf new file mode 100644 index 0000000000..d7ae058a83 --- /dev/null +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/zebra.conf @@ -0,0 +1,25 @@ +log file zebra.log +! +hostname r2 +! +interface eth0 + ipv6 address 2001::2/64 +! +interface eth1 vrf vrf10 + ipv6 address fd02::1/64 +! +segment-routing + srv6 + locators + locator loc1 + prefix 2001:db8:2:2::/64 + ! + ! +! +ip forwarding +ipv6 forwarding +! +ipv6 route 2001:db8:1:1::/64 2001::1 +! +line vty +! diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/test_bgp_srv6l3vpn_to_bgp_vrf4.py b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/test_bgp_srv6l3vpn_to_bgp_vrf4.py new file mode 100644 index 0000000000..88bc9847f3 --- /dev/null +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/test_bgp_srv6l3vpn_to_bgp_vrf4.py @@ -0,0 +1,143 @@ +#!/usr/bin/env python +# SPDX-License-Identifier: ISC + +# Copyright (c) 2025, Onvox LLC +# Authored by Jonathan Voss +# +# Test SRv6 L3VPN with CE BGP peers within a VRF +# + +import os +import re +import sys +import json +import functools +import pytest + +CWD = os.path.dirname(os.path.realpath(__file__)) +sys.path.append(os.path.join(CWD, "../")) + +# pylint: disable=C0413 +# Import topogen and topotest helpers +from lib import topotest +from lib.topogen import Topogen, TopoRouter, get_topogen +from lib.topolog import logger +from lib.common_config import required_linux_kernel_version +from lib.checkping import check_ping + +pytestmark = [pytest.mark.bgpd] + + +def build_topo(tgen): + tgen.add_router("r1") + tgen.add_router("r2") + tgen.add_router("ce1") + tgen.add_router("ce2") + + tgen.add_link(tgen.gears["r1"], tgen.gears["r2"], "eth0", "eth0") + tgen.add_link(tgen.gears["ce1"], tgen.gears["r1"], "eth0", "eth1") + tgen.add_link(tgen.gears["ce2"], tgen.gears["r2"], "eth0", "eth1") + + +def setup_module(mod): + result = required_linux_kernel_version("5.14") + if result is not True: + pytest.skip("Kernel requirements are not met") + + tgen = Topogen(build_topo, mod.__name__) + tgen.start_topology() + for rname, router in tgen.routers().items(): + if os.path.exists("{}/{}/setup.sh".format(CWD, rname)): + router.run("/bin/bash {}/{}/setup.sh".format(CWD, rname)) + router.load_config( + TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname)) + ) + router.load_config( + TopoRouter.RD_BGP, os.path.join(CWD, "{}/bgpd.conf".format(rname)) + ) + + tgen.start_router() + + +def teardown_module(mod): + tgen = get_topogen() + tgen.stop_topology() + + +def open_json_file(filename): + try: + with open(filename, "r") as f: + return json.load(f) + except IOError: + assert False, "Could not read file {}".format(filename) + + +def check_rib(name, cmd, expected_file, count=30, wait=0.5): + def _check(name, dest_addr, match): + logger.info("polling") + tgen = get_topogen() + router = tgen.gears[name] + output = json.loads(router.vtysh_cmd(cmd)) + expected = open_json_file("{}/{}".format(CWD, expected_file)) + return topotest.json_cmp(output, expected) + + logger.info('[+] check {} "{}" {}'.format(name, cmd, expected_file)) + tgen = get_topogen() + func = functools.partial(_check, name, cmd, expected_file) + _, result = topotest.run_and_expect(func, None, count, wait) + assert result is None, "Failed" + + +def test_rib(): + check_rib("r1", "show bgp ipv4 vpn json", "r1/vpnv4_rib.json", 120, 1) + check_rib("r2", "show bgp ipv4 vpn json", "r2/vpnv4_rib.json") + check_rib("r1", "show ip route vrf vrf10 json", "r1/vrf10v4_rib.json") + check_rib("r2", "show ip route vrf vrf10 json", "r2/vrf10v4_rib.json") + check_rib("ce1", "show ip route json", "ce1/ip_rib.json") + check_rib("ce2", "show ip route json", "ce2/ip_rib.json") + + check_rib("r1", "show bgp ipv6 vpn json", "r1/vpnv6_rib.json") + check_rib("r2", "show bgp ipv6 vpn json", "r2/vpnv6_rib.json") + check_rib("r1", "show ipv6 route vrf vrf10 json", "r1/vrf10v6_rib.json") + check_rib("r2", "show ipv6 route vrf vrf10 json", "r2/vrf10v6_rib.json") + check_rib("ce1", "show ipv6 route json", "ce1/ipv6_rib.json") + check_rib("ce2", "show ipv6 route json", "ce2/ipv6_rib.json") + + +def test_ping(): + # IPv4 CE1 to CE2 + check_ping("ce1", "192.168.2.1", True, 10, 3, "192.168.1.1") + # IPv4 CE2 to CE1 + check_ping("ce2", "192.168.1.1", True, 10, 3, "192.168.2.1") + # IPv6 CE1 to CE2 + check_ping("ce1", "2001:2::1", True, 10, 3, "2001:1::1") + # IPv6 CE2 to CE1 + check_ping("ce2", "2001:1::1", True, 10, 3, "2001:2::1") + + +def test_ce_neighbor_reset(): + # Clear CE to R peerings and ensure route exports after + # re-established propogate to VPNv4/VPNv6 and function correctly + tgen = get_topogen() + + for router in ["ce1", "ce2"]: + tgen.gears[router].vtysh_cmd("clear bgp *") + + test_ping() + test_rib() + + +def test_pe_neighbor_reset(): + # Clear R to R peering and ensure route exports after + # re-established propogate to VPNv4/VPNv6 and function correctly + tgen = get_topogen() + + tgen.gears["r1"].vtysh_cmd("clear bgp *") + + test_ping() + test_rib() + + +if __name__ == "__main__": + args = ["-s"] + sys.argv[1:] + sys.exit(pytest.main(args)) From 7b55ca7f1c22c70bd6fd1f7d5ebdcdde62bd9f19 Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Fri, 14 Mar 2025 21:09:29 +0100 Subject: [PATCH 06/12] bgpd: fix do not use srv6 SID for NHT when SID is ours The resulting VPN prefix of a BGP route from a L3VPN in an srv6 setup is not advertised to remote devices. > r1# show bgp ipv6 vpn > BGP table version is 2, local router ID is 1.1.1.1, vrf id 0 > Default local pref 100, local AS 65500 > Status codes: s suppressed, d damped, h history, u unsorted, * 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 > Route Distinguisher: 1:10 > 2011:1::/64 2001:1::2@6< 0 100 0 i > UN=2001:1::2 EC{99:99} label=4096 sid=2001:db8:1:1:: sid_structure=[40,24,8,0] type=bgp, subtype=5 What happens is that the SID of this BGP update is used as nexthop. Consequently, the prefix is not valid because of nexthop unreachable. obviously the locator prefix is not reachable in that L3VRF, and the real nexthop 2001:1::2 should be used. > r1# show bgp vrf vrf10 nexthop detail > Current BGP nexthop cache: > 2001:db8:1:1:100:: invalid, #paths 1 > Last update: Fri Mar 14 21:18:59 2025 > Paths: > 2/3 2011:1::/64 RD 1:10 VRF default flags 0x4000 Fix this by considering the SID of a given BGP update, only if the SID is not ours. Signed-off-by: Philippe Guibert --- bgpd/bgp_nht.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c index 268d804699..76ac6a5e96 100644 --- a/bgpd/bgp_nht.c +++ b/bgpd/bgp_nht.c @@ -38,7 +38,8 @@ extern struct zclient *zclient; static void register_zebra_rnh(struct bgp_nexthop_cache *bnc); static void unregister_zebra_rnh(struct bgp_nexthop_cache *bnc); -static bool make_prefix(int afi, struct bgp_path_info *pi, struct prefix *p); +static bool make_prefix(int afi, struct bgp_path_info *pi, struct prefix *p, + struct bgp *bgp_nexthop); static void bgp_nht_ifp_initial(struct event *thread); DEFINE_HOOK(bgp_nht_path_update, (struct bgp *bgp, struct bgp_path_info *pi, bool valid), @@ -330,7 +331,7 @@ int bgp_find_or_add_nexthop(struct bgp *bgp_route, struct bgp *bgp_nexthop, /* This will return true if the global IPv6 NH is a link local * addr */ - if (!make_prefix(afi, pi, &p)) + if (!make_prefix(afi, pi, &p, bgp_nexthop)) return 1; /* @@ -988,7 +989,7 @@ void bgp_cleanup_nexthops(struct bgp *bgp) * make_prefix - make a prefix structure from the path (essentially * path's node. */ -static bool make_prefix(int afi, struct bgp_path_info *pi, struct prefix *p) +static bool make_prefix(int afi, struct bgp_path_info *pi, struct prefix *p, struct bgp *bgp_nexthop) { int is_bgp_static = ((pi->type == ZEBRA_ROUTE_BGP) @@ -1000,6 +1001,9 @@ static bool make_prefix(int afi, struct bgp_path_info *pi, struct prefix *p) struct in_addr ipv4; struct peer *peer = pi->peer; struct attr *attr = pi->attr; + bool local_sid = false; + struct bgp *bgp = bgp_get_default(); + struct prefix_ipv6 tmp_prefix; if (p_orig->family == AF_FLOWSPEC) { if (!peer) @@ -1029,7 +1033,20 @@ static bool make_prefix(int afi, struct bgp_path_info *pi, struct prefix *p) break; case AFI_IP6: p->family = AF_INET6; - if (attr->srv6_l3vpn) { + if (bgp && bgp->srv6_locator && bgp->srv6_enabled && attr->srv6_l3vpn) { + tmp_prefix.family = AF_INET6; + tmp_prefix.prefixlen = IPV6_MAX_BITLEN; + tmp_prefix.prefix = attr->srv6_l3vpn->sid; + if (bgp_nexthop->vpn_policy[afi].tovpn_sid_locator && + bgp_nexthop->vpn_policy[afi].tovpn_sid) + local_sid = prefix_match(&bgp_nexthop->vpn_policy[afi] + .tovpn_sid_locator->prefix, + &tmp_prefix); + else if (bgp_nexthop->tovpn_sid_locator && bgp_nexthop->tovpn_sid) + local_sid = prefix_match(&bgp_nexthop->tovpn_sid_locator->prefix, + &tmp_prefix); + } + if (local_sid == false && attr->srv6_l3vpn) { p->prefixlen = IPV6_MAX_BITLEN; if (attr->srv6_l3vpn->transposition_len != 0 && BGP_PATH_INFO_NUM_LABELS(pi)) { From 914931ed367a047577c5b084aa4bc025e0eefd4a Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Thu, 20 Mar 2025 16:11:59 +0100 Subject: [PATCH 07/12] bgpd: fix do not export VPN prefix when no SID available on the VRF When detaching the locator from the main BGP instance, the used SIDs and locators are removed from the srv6 per-afi or per-vrf contects. Under those conditions, it is not possible to attempt to export new VPN updates. Do invalidate the nexthop for leaking. Restrict the control for exported VPN prefixes and not for unicast imported prefixes. Signed-off-by: Philippe Guibert --- bgpd/bgp_mplsvpn.c | 12 ++++++------ bgpd/bgp_mplsvpn.h | 31 +++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/bgpd/bgp_mplsvpn.c b/bgpd/bgp_mplsvpn.c index d1d4c5af68..ff64f8361d 100644 --- a/bgpd/bgp_mplsvpn.c +++ b/bgpd/bgp_mplsvpn.c @@ -1112,11 +1112,11 @@ static bool leak_update_nexthop_valid(struct bgp *to_bgp, struct bgp_dest *bn, * If you are using SRv6 VPN instead of MPLS, it need to check * the SID allocation. If the sid is not allocated, the rib * will be invalid. + * If the SID per VRF is not available, also consider the rib as + * invalid. */ - if (to_bgp->srv6_enabled && - (!new_attr->srv6_l3vpn && !new_attr->srv6_vpn)) { - nh_valid = false; - } + if (to_bgp->srv6_enabled && nh_valid) + nh_valid = is_pi_srv6_valid(bpi, bgp_nexthop, afi, safi); if (debug) zlog_debug("%s: %pFX nexthop is %svalid (in %s)", __func__, p, @@ -2337,8 +2337,8 @@ static void vpn_leak_to_vrf_update_onevrf(struct bgp *to_bgp, /* to */ break; } - if (bpi && leak_update_nexthop_valid(to_bgp, bn, &static_attr, afi, safi, - path_vpn, bpi, src_vrf, p, debug)) + if (bpi && leak_update_nexthop_valid(to_bgp, bn, &static_attr, afi, safi, path_vpn, bpi, + src_vrf, p, debug)) SET_FLAG(static_attr.nh_flags, BGP_ATTR_NH_VALID); else UNSET_FLAG(static_attr.nh_flags, BGP_ATTR_NH_VALID); diff --git a/bgpd/bgp_mplsvpn.h b/bgpd/bgp_mplsvpn.h index 56dd33f9b1..75c0264987 100644 --- a/bgpd/bgp_mplsvpn.h +++ b/bgpd/bgp_mplsvpn.h @@ -342,6 +342,37 @@ static inline bool is_pi_family_vpn(struct bgp_path_info *pi) is_pi_family_matching(pi, AFI_IP6, SAFI_MPLS_VPN)); } +/* + * If you are using SRv6 VPN instead of MPLS, it need to check + * the SID allocation. If the sid is not allocated, the rib + * will be invalid. + * If the SID per VRF is not available, also consider the rib as + * invalid. + */ +static inline bool is_pi_srv6_valid(struct bgp_path_info *pi, struct bgp *bgp_nexthop, afi_t afi, + safi_t safi) +{ + if (!pi->attr->srv6_l3vpn && !pi->attr->srv6_vpn) + return false; + + /* imported paths from VPN: srv6 enabled and nht reachability + * are enough to know if that path is valid + */ + if (safi == SAFI_UNICAST) + return true; + + if (bgp_nexthop->vpn_policy[afi].tovpn_sid == NULL && bgp_nexthop->tovpn_sid == NULL) + return false; + + if (bgp_nexthop->tovpn_sid_index == 0 && + !CHECK_FLAG(bgp_nexthop->vrf_flags, BGP_VRF_TOVPN_SID_AUTO) && + bgp_nexthop->vpn_policy[afi].tovpn_sid_index == 0 && + !CHECK_FLAG(bgp_nexthop->vpn_policy[afi].flags, BGP_VPN_POLICY_TOVPN_SID_AUTO)) + return false; + + return true; +} + extern void vpn_policy_routemap_event(const char *rmap_name); extern vrf_id_t get_first_vrf_for_redirect_with_rt(struct ecommunity *eckey); From 99acebcdc9c7c850953106f488004196db1b4da5 Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Thu, 20 Mar 2025 23:15:30 +0100 Subject: [PATCH 08/12] bgpd: fix check validity of a VPN SRv6 route with modified nexthop When exporting a VPN SRv6 route, the path may not be considered valid if the nexthop is not valid. This is the case when the 'nexthop vpn export' command is used. The below example illustrates that the VPN path to 2001:1::/64 is not selected, as the expected nexthop to find in vrf10 is the one configured: > # show running-config > router bgp 1 vrf vrf10 > address-family ipv6 unicast > nexthop vpn export 2001::1 > # show bgp ipv6 vpn > [..] > Route Distinguisher: 1:10 > 2001:1::/64 2001::1@4 0 0 65001 i > UN=2001::1 EC{99:99} label=16 sid=2001:db8:1:1:: sid_structure=[40,24,16,0] type=bgp, subtype=5 The analysis indicates that the 2001::1 nexthop is considered. > 2025/03/20 21:47:53.751853 BGP: [RD1WY-YE9EC] leak_update: entry: leak-to=VRF default, p=2001:1::/64, type=10, sub_type=0 > 2025/03/20 21:47:53.751855 BGP: [VWNP2-DNMFV] Found existing bnc 2001::1/128(0)(VRF vrf10) flags 0x82 ifindex 0 #paths 2 peer 0x0, resolved prefix UNK prefix > 2025/03/20 21:47:53.751856 BGP: [VWC2R-4REXZ] leak_update_nexthop_valid: 2001:1::/64 nexthop is not valid (in VRF vrf10) > 2025/03/20 21:47:53.751857 BGP: [HX87B-ZXWX9] leak_update: ->VRF default: 2001:1::/64: Found route, no change Actually, to check the nexthop validity, only the source path in the VRF has the correct nexthop. Fix this by reusing the source path information instead of the current one. > 2025/03/20 22:43:51.703521 BGP: [RD1WY-YE9EC] leak_update: entry: leak-to=VRF default, p=2001:1::/64, type=10, sub_type=0 > 2025/03/20 22:43:51.703523 BGP: [VWNP2-DNMFV] Found existing bnc fe80::b812:37ff:fe13:d441/128(0)(VRF vrf10) flags 0x87 ifindex 0 #paths 2 peer 0x0, resolved prefix fe80::/64 > 2025/03/20 22:43:51.703525 BGP: [VWC2R-4REXZ] leak_update_nexthop_valid: 2001:1::/64 nexthop is valid (in VRF vrf10) > 2025/03/20 22:43:51.703526 BGP: [HX87B-ZXWX9] leak_update: ->VRF default: 2001:1::/64: Found route, no change Signed-off-by: Philippe Guibert --- bgpd/bgp_evpn.c | 3 +-- bgpd/bgp_fsm.c | 6 ++---- bgpd/bgp_mplsvpn.c | 18 ++++++++++-------- bgpd/bgp_nht.c | 42 +++++++++++++++++++++++++----------------- bgpd/bgp_nht.h | 9 ++++----- bgpd/bgp_route.c | 12 ++++++++---- 6 files changed, 50 insertions(+), 40 deletions(-) diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c index 488f635b81..3962539797 100644 --- a/bgpd/bgp_evpn.c +++ b/bgpd/bgp_evpn.c @@ -3184,8 +3184,7 @@ static int install_evpn_route_entry_in_vrf(struct bgp *bgp_vrf, /* Gateway IP nexthop should be resolved */ if (bre && bre->type == OVERLAY_INDEX_GATEWAY_IP) { - if (bgp_find_or_add_nexthop(bgp_vrf, bgp_vrf, afi, safi, pi, - NULL, 0, NULL)) + if (bgp_find_or_add_nexthop(bgp_vrf, bgp_vrf, afi, safi, pi, NULL, 0, NULL, NULL)) bgp_path_info_set_flag(dest, pi, BGP_PATH_VALID); else { if (BGP_DEBUG(nht, NHT)) { diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c index 607e34e8d3..18a15ae3a5 100644 --- a/bgpd/bgp_fsm.c +++ b/bgpd/bgp_fsm.c @@ -94,10 +94,8 @@ int bgp_peer_reg_with_nht(struct peer *peer) connected = 1; return bgp_find_or_add_nexthop(peer->bgp, peer->bgp, - family2afi( - peer->connection->su.sa.sa_family), - SAFI_UNICAST, NULL, peer, connected, - NULL); + family2afi(peer->connection->su.sa.sa_family), SAFI_UNICAST, + NULL, peer, connected, NULL, NULL); } static void peer_xfer_stats(struct peer *peer_dst, struct peer *peer_src) diff --git a/bgpd/bgp_mplsvpn.c b/bgpd/bgp_mplsvpn.c index ff64f8361d..6f29286030 100644 --- a/bgpd/bgp_mplsvpn.c +++ b/bgpd/bgp_mplsvpn.c @@ -1088,10 +1088,8 @@ static bool leak_update_nexthop_valid(struct bgp *to_bgp, struct bgp_dest *bn, /* the route is defined with the "network " command */ if (CHECK_FLAG(bgp_nexthop->flags, BGP_FLAG_IMPORT_CHECK)) - nh_valid = bgp_find_or_add_nexthop(to_bgp, bgp_nexthop, - afi, SAFI_UNICAST, - bpi_ultimate, NULL, - 0, p); + nh_valid = bgp_find_or_add_nexthop(to_bgp, bgp_nexthop, afi, SAFI_UNICAST, + bpi_ultimate, NULL, 0, p, bpi_ultimate); else /* if "no bgp network import-check" is set, * then mark the nexthop as valid. @@ -1105,8 +1103,12 @@ static bool leak_update_nexthop_valid(struct bgp *to_bgp, struct bgp_dest *bn, * TBD do we need to do anything about the * 'connected' parameter? */ - nh_valid = bgp_find_or_add_nexthop(to_bgp, bgp_nexthop, afi, - safi, bpi, NULL, 0, p); + /* VPN paths: the new bpi may be altered like + * with 'nexthop vpn export' command. Use the bpi_ultimate + * to find the original nexthop + */ + nh_valid = bgp_find_or_add_nexthop(to_bgp, bgp_nexthop, afi, safi, bpi, NULL, 0, p, + bpi_ultimate); /* * If you are using SRv6 VPN instead of MPLS, it need to check @@ -1594,8 +1596,8 @@ vpn_leak_from_vrf_get_per_nexthop_label(afi_t afi, struct bgp_path_info *pi, bgp_nexthop = from_bgp; nh_afi = BGP_ATTR_NH_AFI(afi, pi->attr); - nh_valid = bgp_find_or_add_nexthop(from_bgp, bgp_nexthop, nh_afi, - SAFI_UNICAST, pi, NULL, 0, NULL); + nh_valid = bgp_find_or_add_nexthop(from_bgp, bgp_nexthop, nh_afi, SAFI_UNICAST, pi, NULL, 0, + NULL, NULL); if (!nh_valid && is_bgp_static_route && !CHECK_FLAG(from_bgp->flags, BGP_FLAG_IMPORT_CHECK)) { diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c index 76ac6a5e96..16938ed44d 100644 --- a/bgpd/bgp_nht.c +++ b/bgpd/bgp_nht.c @@ -39,7 +39,7 @@ extern struct zclient *zclient; static void register_zebra_rnh(struct bgp_nexthop_cache *bnc); static void unregister_zebra_rnh(struct bgp_nexthop_cache *bnc); static bool make_prefix(int afi, struct bgp_path_info *pi, struct prefix *p, - struct bgp *bgp_nexthop); + struct bgp *bgp_nexthop, struct bgp_path_info *pi_source); static void bgp_nht_ifp_initial(struct event *thread); DEFINE_HOOK(bgp_nht_path_update, (struct bgp *bgp, struct bgp_path_info *pi, bool valid), @@ -298,10 +298,9 @@ void bgp_unlink_nexthop_by_peer(struct peer *peer) * A route and its nexthop might belong to different VRFs. Therefore, * we need both the bgp_route and bgp_nexthop pointers. */ -int bgp_find_or_add_nexthop(struct bgp *bgp_route, struct bgp *bgp_nexthop, - afi_t afi, safi_t safi, struct bgp_path_info *pi, - struct peer *peer, int connected, - const struct prefix *orig_prefix) +int bgp_find_or_add_nexthop(struct bgp *bgp_route, struct bgp *bgp_nexthop, afi_t afi, safi_t safi, + struct bgp_path_info *pi, struct peer *peer, int connected, + const struct prefix *orig_prefix, struct bgp_path_info *source_pi) { struct bgp_nexthop_cache_head *tree = NULL; struct bgp_nexthop_cache *bnc; @@ -331,7 +330,7 @@ int bgp_find_or_add_nexthop(struct bgp *bgp_route, struct bgp *bgp_nexthop, /* This will return true if the global IPv6 NH is a link local * addr */ - if (!make_prefix(afi, pi, &p, bgp_nexthop)) + if (!make_prefix(afi, pi, &p, bgp_nexthop, source_pi)) return 1; /* @@ -989,7 +988,8 @@ void bgp_cleanup_nexthops(struct bgp *bgp) * make_prefix - make a prefix structure from the path (essentially * path's node. */ -static bool make_prefix(int afi, struct bgp_path_info *pi, struct prefix *p, struct bgp *bgp_nexthop) +static bool make_prefix(int afi, struct bgp_path_info *pi, struct prefix *p, + struct bgp *bgp_nexthop, struct bgp_path_info *source_pi) { int is_bgp_static = ((pi->type == ZEBRA_ROUTE_BGP) @@ -999,12 +999,20 @@ static bool make_prefix(int afi, struct bgp_path_info *pi, struct prefix *p, str struct bgp_dest *net = pi->net; const struct prefix *p_orig = bgp_dest_get_prefix(net); struct in_addr ipv4; - struct peer *peer = pi->peer; - struct attr *attr = pi->attr; + struct peer *peer; + struct attr *attr; bool local_sid = false; struct bgp *bgp = bgp_get_default(); struct prefix_ipv6 tmp_prefix; + if (source_pi) { + attr = source_pi->attr; + peer = source_pi->peer; + } else { + peer = pi->peer; + attr = pi->attr; + } + if (p_orig->family == AF_FLOWSPEC) { if (!peer) return false; @@ -1033,10 +1041,10 @@ static bool make_prefix(int afi, struct bgp_path_info *pi, struct prefix *p, str break; case AFI_IP6: p->family = AF_INET6; - if (bgp && bgp->srv6_locator && bgp->srv6_enabled && attr->srv6_l3vpn) { + if (bgp && bgp->srv6_locator && bgp->srv6_enabled && pi->attr->srv6_l3vpn) { tmp_prefix.family = AF_INET6; tmp_prefix.prefixlen = IPV6_MAX_BITLEN; - tmp_prefix.prefix = attr->srv6_l3vpn->sid; + tmp_prefix.prefix = pi->attr->srv6_l3vpn->sid; if (bgp_nexthop->vpn_policy[afi].tovpn_sid_locator && bgp_nexthop->vpn_policy[afi].tovpn_sid) local_sid = prefix_match(&bgp_nexthop->vpn_policy[afi] @@ -1046,17 +1054,17 @@ static bool make_prefix(int afi, struct bgp_path_info *pi, struct prefix *p, str local_sid = prefix_match(&bgp_nexthop->tovpn_sid_locator->prefix, &tmp_prefix); } - if (local_sid == false && attr->srv6_l3vpn) { + if (local_sid == false && pi->attr->srv6_l3vpn) { p->prefixlen = IPV6_MAX_BITLEN; - if (attr->srv6_l3vpn->transposition_len != 0 && + if (pi->attr->srv6_l3vpn->transposition_len != 0 && BGP_PATH_INFO_NUM_LABELS(pi)) { - IPV6_ADDR_COPY(&p->u.prefix6, &attr->srv6_l3vpn->sid); + IPV6_ADDR_COPY(&p->u.prefix6, &pi->attr->srv6_l3vpn->sid); transpose_sid(&p->u.prefix6, decode_label(&pi->extra->labels->label[0]), - attr->srv6_l3vpn->transposition_offset, - attr->srv6_l3vpn->transposition_len); + pi->attr->srv6_l3vpn->transposition_offset, + pi->attr->srv6_l3vpn->transposition_len); } else - IPV6_ADDR_COPY(&(p->u.prefix6), &(attr->srv6_l3vpn->sid)); + IPV6_ADDR_COPY(&(p->u.prefix6), &(pi->attr->srv6_l3vpn->sid)); } else if (is_bgp_static) { p->u.prefix6 = p_orig->u.prefix6; p->prefixlen = p_orig->prefixlen; diff --git a/bgpd/bgp_nht.h b/bgpd/bgp_nht.h index 345089ac5a..76536d6ebf 100644 --- a/bgpd/bgp_nht.h +++ b/bgpd/bgp_nht.h @@ -25,11 +25,10 @@ extern void bgp_nexthop_update(struct vrf *vrf, struct prefix *match, * peer - The BGP peer associated with this NHT * connected - True if NH MUST be a connected route */ -extern int bgp_find_or_add_nexthop(struct bgp *bgp_route, - struct bgp *bgp_nexthop, afi_t a, - safi_t safi, struct bgp_path_info *p, - struct peer *peer, int connected, - const struct prefix *orig_prefix); +extern int bgp_find_or_add_nexthop(struct bgp *bgp_route, struct bgp *bgp_nexthop, afi_t a, + safi_t safi, struct bgp_path_info *p, struct peer *peer, + int connected, const struct prefix *orig_prefix, + struct bgp_path_info *source_pi); /** * bgp_unlink_nexthop() - Unlink the nexthop object from the path structure. diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 569bec66e0..a5f171fcbf 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -4905,6 +4905,7 @@ bgp_update_nexthop_reachability_check(struct bgp *bgp, struct peer *peer, struct { bool connected; afi_t nh_afi; + struct bgp_path_info *bpi_ultimate = NULL; if (((afi == AFI_IP || afi == AFI_IP6) && (safi == SAFI_UNICAST || safi == SAFI_LABELED_UNICAST || @@ -4920,13 +4921,16 @@ bgp_update_nexthop_reachability_check(struct bgp *bgp, struct peer *peer, struct struct bgp *bgp_nexthop = bgp; - if (pi->extra && pi->extra->vrfleak && pi->extra->vrfleak->bgp_orig) + if (pi->extra && pi->extra->vrfleak && pi->extra->vrfleak->bgp_orig) { bgp_nexthop = pi->extra->vrfleak->bgp_orig; + if (pi->sub_type == BGP_ROUTE_IMPORTED) + bpi_ultimate = bgp_get_imported_bpi_ultimate(pi); + } nh_afi = BGP_ATTR_NH_AFI(afi, pi->attr); if (bgp_find_or_add_nexthop(bgp, bgp_nexthop, nh_afi, safi, pi, NULL, connected, - bgp_nht_param_prefix) || + bgp_nht_param_prefix, bpi_ultimate) || CHECK_FLAG(peer->flags, PEER_FLAG_IS_RFAPI_HD)) { if (accept_own) bgp_path_info_set_flag(dest, pi, BGP_PATH_ACCEPT_OWN); @@ -6941,8 +6945,8 @@ static void bgp_nexthop_reachability_check(afi_t afi, safi_t safi, /* Nexthop reachability check. */ if (safi == SAFI_UNICAST || safi == SAFI_LABELED_UNICAST) { if (CHECK_FLAG(bgp->flags, BGP_FLAG_IMPORT_CHECK)) { - if (bgp_find_or_add_nexthop(bgp, bgp_nexthop, afi, safi, - bpi, NULL, 0, p)) + if (bgp_find_or_add_nexthop(bgp, bgp_nexthop, afi, safi, bpi, NULL, 0, p, + NULL)) bgp_path_info_set_flag(dest, bpi, BGP_PATH_VALID); else { From 03b57b45c668d5858d86eac0cdbfee2806fa08b5 Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Fri, 21 Mar 2025 15:49:47 +0100 Subject: [PATCH 09/12] topotests: fix invalidate exported vpn prefixes on srv6l3vpn vrf3 setup When srv6 is disabled due to misconfiguration, exported VPN prefixes are invalidated, except for the ones that have their nexthop modified with the 'nexthop vpn export' command. The previous commit also invalidates those vpn prefixes. Apply the changes to the test by not considering some prefixes as selected. Enforce the expected route count. Signed-off-by: Philippe Guibert --- .../r1/vpnv4_rib_locator_deleted.json | 6 ------ .../r2/vpnv4_rib_locator_deleted.json | 4 +++- .../r2/vpnv6_rib_locator_deleted.json | 4 +++- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r1/vpnv4_rib_locator_deleted.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r1/vpnv4_rib_locator_deleted.json index 5645540fbb..f1ec26c967 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r1/vpnv4_rib_locator_deleted.json +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r1/vpnv4_rib_locator_deleted.json @@ -9,8 +9,6 @@ "1:10": { "192.168.1.0/24": [ { - "valid": true, - "bestpath": true, "selectionReason": "First path received", "pathFrom": "external", "prefix": "192.168.1.0", @@ -34,8 +32,6 @@ ], "192.168.3.0/24": [ { - "valid": true, - "bestpath": true, "selectionReason": "First path received", "pathFrom": "external", "prefix": "192.168.3.0", @@ -61,8 +57,6 @@ "1:20": { "192.168.5.0/24": [ { - "valid": true, - "bestpath": true, "selectionReason": "First path received", "pathFrom": "external", "prefix": "192.168.5.0", diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r2/vpnv4_rib_locator_deleted.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r2/vpnv4_rib_locator_deleted.json index e3edee172b..e2b7170853 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r2/vpnv4_rib_locator_deleted.json +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r2/vpnv4_rib_locator_deleted.json @@ -86,5 +86,7 @@ ] } } - } + }, + "totalRoutes": 3, + "totalPaths": 3 } diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r2/vpnv6_rib_locator_deleted.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r2/vpnv6_rib_locator_deleted.json index 25cdf031c3..41e8a82e40 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r2/vpnv6_rib_locator_deleted.json +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r2/vpnv6_rib_locator_deleted.json @@ -89,5 +89,7 @@ ] } } - } + }, + "totalRoutes": 3, + "totalPaths": 3 } From 121c2ff1b03d5654be652dda7b35b73ddc914108 Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Mon, 24 Mar 2025 17:35:22 +0100 Subject: [PATCH 10/12] topotests: use json exact test for bgp_srv6l3vpn_to_bgp_vrf3 Add more control on the expected outputs, by using an exact json comparison. Signed-off-by: Philippe Guibert --- .../r1/vpnv4_rib_locator_deleted.json | 82 ++++++++++++++++++- .../r1/vpnv4_rib_sid_vpn_export_disabled.json | 48 +++++++++++ .../r1/vpnv6_rib_locator_deleted.json | 5 +- .../r1/vpnv6_rib_sid_vpn_export_disabled.json | 50 +++++++++++ .../r2/vpnv4_rib_locator_deleted.json | 4 +- .../r2/vpnv6_rib_locator_deleted.json | 4 +- .../test_bgp_srv6l3vpn_to_bgp_vrf3.py | 18 ++-- tests/topotests/lib/bgp.py | 32 ++++++++ 8 files changed, 227 insertions(+), 16 deletions(-) diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r1/vpnv4_rib_locator_deleted.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r1/vpnv4_rib_locator_deleted.json index f1ec26c967..4e803a0514 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r1/vpnv4_rib_locator_deleted.json +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r1/vpnv4_rib_locator_deleted.json @@ -9,7 +9,7 @@ "1:10": { "192.168.1.0/24": [ { - "selectionReason": "First path received", + "multipath": true, "pathFrom": "external", "prefix": "192.168.1.0", "prefixLen": 24, @@ -32,7 +32,7 @@ ], "192.168.3.0/24": [ { - "selectionReason": "First path received", + "multipath": true, "pathFrom": "external", "prefix": "192.168.3.0", "prefixLen": 24, @@ -57,7 +57,7 @@ "1:20": { "192.168.5.0/24": [ { - "selectionReason": "First path received", + "multipath": true, "pathFrom": "external", "prefix": "192.168.5.0", "prefixLen": 24, @@ -78,6 +78,82 @@ ] } ] + }, + "2:10": { + "192.168.2.0/24": [ + { + "valid": true, + "bestpath": true, + "selectionReason": "First path received", + "pathFrom": "external", + "prefix": "192.168.2.0", + "prefixLen": 24, + "network": "192.168.2.0/24", + "metric": 0, + "weight": 0, + "peerId": "2001::2", + "path": "2", + "origin": "incomplete", + "nexthops": [ + { + "ip": "2001::2", + "hostname": "r2", + "afi": "ipv6", + "used": true + } + ] + } + ] + }, + "2:20": { + "192.168.4.0/24": [ + { + "valid": true, + "bestpath": true, + "selectionReason": "First path received", + "pathFrom": "external", + "prefix": "192.168.4.0", + "prefixLen": 24, + "network": "192.168.4.0/24", + "metric": 0, + "weight": 0, + "peerId": "2001::2", + "path": "2", + "origin": "incomplete", + "nexthops": [ + { + "ip": "2001::2", + "hostname": "r2", + "afi": "ipv6", + "used": true + } + ] + } + ], + "192.168.6.0/24": [ + { + "valid": true, + "bestpath": true, + "selectionReason": "First path received", + "pathFrom": "external", + "prefix": "192.168.6.0", + "prefixLen": 24, + "network": "192.168.6.0/24", + "metric": 0, + "weight": 0, + "peerId": "2001::2", + "path": "2", + "origin": "incomplete", + "nexthops": [ + { + "ip": "2001::2", + "hostname": "r2", + "afi": "ipv6", + "used": true + } + ] + } + ] } } } diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r1/vpnv4_rib_sid_vpn_export_disabled.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r1/vpnv4_rib_sid_vpn_export_disabled.json index 205079574c..d49c357432 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r1/vpnv4_rib_sid_vpn_export_disabled.json +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r1/vpnv4_rib_sid_vpn_export_disabled.json @@ -6,6 +6,54 @@ "localAS": 1, "routes": { "routeDistinguishers": { + "1:10": { + "192.168.1.0/24": [ + { + "multipath": true, + "pathFrom": "external", + "prefix": "192.168.1.0", + "prefixLen": 24, + "network": "192.168.1.0/24", + "metric": 0, + "weight": 32768, + "peerId": "(unspec)", + "path": "", + "origin": "incomplete", + "nhVrfName": "vrf10", + "nexthops": [ + { + "ip": "2001::1", + "hostname": "r1", + "afi": "ipv6", + "used": true + } + ] + } + ], + "192.168.3.0/24": [ + { + "multipath": true, + "pathFrom": "external", + "prefix": "192.168.3.0", + "prefixLen": 24, + "network": "192.168.3.0/24", + "metric": 0, + "weight": 32768, + "peerId": "(unspec)", + "path": "", + "origin": "incomplete", + "nhVrfName": "vrf10", + "nexthops": [ + { + "ip": "2001::1", + "hostname": "r1", + "afi": "ipv6", + "used": true + } + ] + } + ] + }, "1:20": { "192.168.5.0/24": [ { diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r1/vpnv6_rib_locator_deleted.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r1/vpnv6_rib_locator_deleted.json index f2df9be49d..547b262d4b 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r1/vpnv6_rib_locator_deleted.json +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r1/vpnv6_rib_locator_deleted.json @@ -9,6 +9,7 @@ "1:10": { "2001:1::/64": [ { + "multipath": true, "pathFrom": "external", "prefix": "2001:1::", "prefixLen": 64, @@ -32,6 +33,7 @@ ], "2001:3::/64": [ { + "multipath": true, "pathFrom": "external", "prefix": "2001:3::", "prefixLen": 64, @@ -57,6 +59,7 @@ "1:20": { "2001:5::/64": [ { + "multipath": true, "pathFrom": "external", "prefix": "2001:5::", "prefixLen": 64, @@ -131,7 +134,7 @@ } ], "2001:6::/64": [ - { + { "valid": true, "bestpath": true, "selectionReason": "First path received", diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r1/vpnv6_rib_sid_vpn_export_disabled.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r1/vpnv6_rib_sid_vpn_export_disabled.json index e289df1d44..8cfe223101 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r1/vpnv6_rib_sid_vpn_export_disabled.json +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r1/vpnv6_rib_sid_vpn_export_disabled.json @@ -6,6 +6,56 @@ "localAS": 1, "routes": { "routeDistinguishers": { + "1:10": { + "2001:1::/64": [ + { + "multipath": true, + "pathFrom": "external", + "prefix": "2001:1::", + "prefixLen": 64, + "network": "2001:1::/64", + "metric": 0, + "weight": 32768, + "peerId": "(unspec)", + "path": "", + "origin": "incomplete", + "announceNexthopSelf": true, + "nhVrfName": "vrf10", + "nexthops": [ + { + "ip": "::", + "hostname": "r1", + "afi": "ipv6", + "used": true + } + ] + } + ], + "2001:3::/64": [ + { + "multipath": true, + "pathFrom": "external", + "prefix": "2001:3::", + "prefixLen": 64, + "network": "2001:3::/64", + "metric": 0, + "weight": 32768, + "peerId": "(unspec)", + "path": "", + "origin": "incomplete", + "announceNexthopSelf": true, + "nhVrfName": "vrf10", + "nexthops": [ + { + "ip": "::", + "hostname": "r1", + "afi": "ipv6", + "used": true + } + ] + } + ] + }, "1:20": { "2001:5::/64": [ { diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r2/vpnv4_rib_locator_deleted.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r2/vpnv4_rib_locator_deleted.json index e2b7170853..e3edee172b 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r2/vpnv4_rib_locator_deleted.json +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r2/vpnv4_rib_locator_deleted.json @@ -86,7 +86,5 @@ ] } } - }, - "totalRoutes": 3, - "totalPaths": 3 + } } diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r2/vpnv6_rib_locator_deleted.json b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r2/vpnv6_rib_locator_deleted.json index 41e8a82e40..25cdf031c3 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r2/vpnv6_rib_locator_deleted.json +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r2/vpnv6_rib_locator_deleted.json @@ -89,7 +89,5 @@ ] } } - }, - "totalRoutes": 3, - "totalPaths": 3 + } } diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/test_bgp_srv6l3vpn_to_bgp_vrf3.py b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/test_bgp_srv6l3vpn_to_bgp_vrf3.py index 530537646b..9e588d1d71 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/test_bgp_srv6l3vpn_to_bgp_vrf3.py +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/test_bgp_srv6l3vpn_to_bgp_vrf3.py @@ -18,6 +18,7 @@ sys.path.append(os.path.join(CWD, "../")) # pylint: disable=C0413 # Import topogen and topotest helpers from lib import topotest +from lib.bgp import bgp_vpn_router_json_cmp_exact_filter from lib.topogen import Topogen, TopoRouter, get_topogen from lib.topolog import logger from lib.common_config import required_linux_kernel_version @@ -95,24 +96,29 @@ def open_json_file(filename): assert False, "Could not read file {}".format(filename) -def check_rib(name, cmd, expected_file, count=30, wait=0.5): - def _check(name, dest_addr, match): +def check_rib(name, cmd, expected_file, count=10, wait=0.5): + def _check(router, cmd, expected): logger.info("polling") tgen = get_topogen() - router = tgen.gears[name] output = json.loads(router.vtysh_cmd(cmd)) - expected = open_json_file("{}/{}".format(CWD, expected_file)) return topotest.json_cmp(output, expected) logger.info('[+] check {} "{}" {}'.format(name, cmd, expected_file)) tgen = get_topogen() - func = functools.partial(_check, name, cmd, expected_file) + router = tgen.gears[name] + expected = open_json_file("{}/{}".format(CWD, expected_file)) + if "show bgp" in cmd and "vpn" in cmd: + func = functools.partial( + bgp_vpn_router_json_cmp_exact_filter, tgen.gears[name], cmd, expected + ) + else: + func = functools.partial(_check, router, cmd, expected) _, result = topotest.run_and_expect(func, None, count, wait) assert result is None, "Failed" def test_rib(): - check_rib("r1", "show bgp ipv4 vpn json", "r1/vpnv4_rib.json", 120, 1) + check_rib("r1", "show bgp ipv4 vpn json", "r1/vpnv4_rib.json", 10, 1) check_rib("r2", "show bgp ipv4 vpn json", "r2/vpnv4_rib.json") check_rib("r1", "show ip route vrf vrf10 json", "r1/vrf10v4_rib.json") check_rib("r1", "show ip route vrf vrf20 json", "r1/vrf20v4_rib.json") diff --git a/tests/topotests/lib/bgp.py b/tests/topotests/lib/bgp.py index 632aa4a10b..01fe2b3714 100644 --- a/tests/topotests/lib/bgp.py +++ b/tests/topotests/lib/bgp.py @@ -5,6 +5,7 @@ # ("NetDEF") in this file. # +import json import ipaddress import sys import traceback @@ -5658,3 +5659,34 @@ def bgp_configure_prefixes(router, asn, safi, prefixes, vrf=None, update=True): ] logger.debug(f"setting prefix: ipv{ip.version} {safi} {ip}") router.vtysh_cmd("".join(cmd)) + + +# compare exact fields of 'show bgp ipv4 vpn' and related commands +# after having removed some attributes that are not relevant. +def bgp_vpn_router_json_cmp_exact_filter(router, cmd, expected): + output = router.vtysh_cmd(cmd) + logger.info("{}: {}\n{}".format(router.name, cmd, output)) + + json_output = json.loads(output) + + # filter out tableVersion, version and nhVrfID + json_output.pop("tableVersion") + if "totalRoutes" in json_output: + json_output.pop("totalRoutes") + if "totalPaths" in json_output: + json_output.pop("totalPaths") + for rd, data in json_output["routes"]["routeDistinguishers"].items(): + for _, attrs in data.items(): + for attr in attrs: + if "nhVrfId" in attr: + attr.pop("nhVrfId") + if "version" in attr: + attr.pop("version") + + # filter out RD with no data (e.g. "444:3": {}) + json_tmp = deepcopy(json_output) + for rd, data in json_tmp["routes"]["routeDistinguishers"].items(): + if len(data.keys()) == 0: + json_output["routes"]["routeDistinguishers"].pop(rd) + + return topotest.json_cmp(json_output, expected, exact=True) From 56c9f1c56662a68a1735ea07aa85cb88ae7acf64 Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Mon, 24 Mar 2025 20:59:18 +0100 Subject: [PATCH 11/12] bgpd: fix dereference of null pointer in bgp_nht Assuming attr is null, a dereference can happen in the function make_prefix(). Add the protection over attr before accessing the variable. Signed-off-by: Philippe Guibert --- bgpd/bgp_nht.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c index 16938ed44d..45deb23ff4 100644 --- a/bgpd/bgp_nht.c +++ b/bgpd/bgp_nht.c @@ -1068,23 +1068,23 @@ static bool make_prefix(int afi, struct bgp_path_info *pi, struct prefix *p, } else if (is_bgp_static) { p->u.prefix6 = p_orig->u.prefix6; p->prefixlen = p_orig->prefixlen; - } else { + } else if (attr) { /* If we receive MP_REACH nexthop with ::(LL) * or LL(LL), use LL address as nexthop cache. */ - if (attr && attr->mp_nexthop_len == BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL && + if (attr->mp_nexthop_len == BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL && (IN6_IS_ADDR_UNSPECIFIED(&attr->mp_nexthop_global) || IN6_IS_ADDR_LINKLOCAL(&attr->mp_nexthop_global))) p->u.prefix6 = attr->mp_nexthop_local; /* If we receive MR_REACH with (GA)::(LL) * then check for route-map to choose GA or LL */ - else if (attr && attr->mp_nexthop_len == BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL) { + else if (attr->mp_nexthop_len == BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL) { if (CHECK_FLAG(attr->nh_flags, BGP_ATTR_NH_MP_PREFER_GLOBAL)) p->u.prefix6 = attr->mp_nexthop_global; else p->u.prefix6 = attr->mp_nexthop_local; - } else if (attr && attr->mp_nexthop_len == BGP_ATTR_NHLEN_IPV6_GLOBAL && + } else if (attr->mp_nexthop_len == BGP_ATTR_NHLEN_IPV6_GLOBAL && IN6_IS_ADDR_LINKLOCAL(&attr->mp_nexthop_global)) { /* If we receive MP_REACH with GUA as LL, we should * check if we have Link-Local Next Hop capability also. From 171231686d0208dde853766e2ed122de922ad1e6 Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Tue, 25 Mar 2025 14:37:29 +0100 Subject: [PATCH 12/12] topotests: remove useless frr commands of bgp_srv6l3vpn_to_bgp* Many useless commande are still persistent in the bgp_srv6l3vpn_to_bgp_vrf tests. Remove the useless commands. Signed-off-by: Philippe Guibert --- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce1/bgpd.conf | 9 ++------- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce1/zebra.conf | 4 ---- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce2/bgpd.conf | 8 +------- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce2/zebra.conf | 4 ---- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce3/bgpd.conf | 7 ------- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce3/zebra.conf | 4 ---- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce4/bgpd.conf | 7 ------- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce4/zebra.conf | 4 ---- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce5/bgpd.conf | 7 ------- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce5/zebra.conf | 4 ---- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce6/bgpd.conf | 7 ------- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce6/zebra.conf | 4 ---- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/r1/bgpd.conf | 8 -------- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/r1/zebra.conf | 8 -------- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/r2/bgpd.conf | 8 -------- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/r2/zebra.conf | 8 -------- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce1/bgpd.conf | 7 ------- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce1/zebra.conf | 4 ---- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce2/bgpd.conf | 7 ------- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce2/zebra.conf | 4 ---- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce3/bgpd.conf | 7 ------- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce3/zebra.conf | 4 ---- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce4/bgpd.conf | 7 ------- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce4/zebra.conf | 4 ---- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce5/bgpd.conf | 7 ------- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce6/bgpd.conf | 7 ------- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce6/zebra.conf | 4 ---- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r1/bgpd.conf | 8 -------- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r1/zebra.conf | 8 -------- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r2/bgpd.conf | 8 -------- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r2/zebra.conf | 8 -------- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce1/bgpd.conf | 8 -------- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce1/zebra.conf | 4 ---- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce2/bgpd.conf | 8 -------- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce2/zebra.conf | 4 ---- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/bgpd.conf | 8 -------- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/zebra.conf | 4 ---- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/bgpd.conf | 8 -------- tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/zebra.conf | 4 ---- 39 files changed, 3 insertions(+), 240 deletions(-) diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce1/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce1/bgpd.conf index 3459796629..188ec7a86c 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce1/bgpd.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce1/bgpd.conf @@ -1,8 +1,3 @@ frr defaults traditional -! -hostname ce1 -password zebra -! -log stdout notifications -log commands -log file bgpd.log + + diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce1/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce1/zebra.conf index 447d1b40c1..6c9abca36f 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce1/zebra.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce1/zebra.conf @@ -1,7 +1,3 @@ -log file zebra.log -! -hostname ce1 -! interface eth0 ip address 192.168.1.2/24 ! diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce2/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce2/bgpd.conf index 8ed9978749..05268f8878 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce2/bgpd.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce2/bgpd.conf @@ -1,8 +1,2 @@ frr defaults traditional -! -hostname ce2 -password zebra -! -log stdout notifications -log commands -log file bgpd.log + diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce2/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce2/zebra.conf index 11652252a4..b0e6470307 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce2/zebra.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce2/zebra.conf @@ -1,7 +1,3 @@ -log file zebra.log -! -hostname ce2 -! interface eth0 ip address 192.168.2.2/24 ! diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce3/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce3/bgpd.conf index a85d9701c7..cd72007f46 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce3/bgpd.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce3/bgpd.conf @@ -1,8 +1 @@ frr defaults traditional -! -hostname ce3 -password zebra -! -log stdout notifications -log commands -log file bgpd.log diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce3/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce3/zebra.conf index 299c6597c7..f0fd4f497a 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce3/zebra.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce3/zebra.conf @@ -1,7 +1,3 @@ -log file zebra.log -! -hostname ce3 -! interface eth0 ip address 192.168.3.2/24 ! diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce4/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce4/bgpd.conf index 93fb32fd1b..cd72007f46 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce4/bgpd.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce4/bgpd.conf @@ -1,8 +1 @@ frr defaults traditional -! -hostname ce4 -password zebra -! -log stdout notifications -log commands -log file bgpd.log diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce4/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce4/zebra.conf index 30f3736fe3..da745f2bd0 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce4/zebra.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce4/zebra.conf @@ -1,7 +1,3 @@ -log file zebra.log -! -hostname ce4 -! interface eth0 ip address 192.168.4.2/24 ! diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce5/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce5/bgpd.conf index 2ab6f2d2a7..cd72007f46 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce5/bgpd.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce5/bgpd.conf @@ -1,8 +1 @@ frr defaults traditional -! -hostname ce5 -password zebra -! -log stdout notifications -log commands -log file bgpd.log diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce5/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce5/zebra.conf index 208dcb1a7a..37391ebb49 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce5/zebra.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce5/zebra.conf @@ -1,7 +1,3 @@ -log file zebra.log -! -hostname ce5 -! interface eth0 ip address 192.168.5.2/24 ! diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce6/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce6/bgpd.conf index e0b6540514..cd72007f46 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce6/bgpd.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce6/bgpd.conf @@ -1,8 +1 @@ frr defaults traditional -! -hostname ce6 -password zebra -! -log stdout notifications -log commands -log file bgpd.log diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce6/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce6/zebra.conf index d68a008e3a..9696993c33 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce6/zebra.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce6/zebra.conf @@ -1,7 +1,3 @@ -log file zebra.log -! -hostname ce6 -! interface eth0 ip address 192.168.6.2/24 ! diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/r1/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/r1/bgpd.conf index 12b9e8fd00..d4be6c7d6a 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/r1/bgpd.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/r1/bgpd.conf @@ -1,13 +1,5 @@ frr defaults traditional -! bgp send-extra-data zebra -! -hostname r1 -password zebra -! -log stdout notifications -log commands -! !debug bgp neighbor-events !debug bgp zebra !debug bgp vnc verbose diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/r1/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/r1/zebra.conf index f202493c53..64e6af0c1b 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/r1/zebra.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/r1/zebra.conf @@ -1,11 +1,3 @@ -log file zebra.log -! -hostname r1 -password zebra -! -log stdout notifications -log commands -! !debug zebra packet !debug zebra dplane !debug zebra kernel diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/r2/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/r2/bgpd.conf index db36c180a0..5ff570069c 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/r2/bgpd.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/r2/bgpd.conf @@ -1,13 +1,5 @@ frr defaults traditional -! bgp send-extra-data zebra -! -hostname r2 -password zebra -! -log stdout notifications -log commands -! !debug bgp neighbor-events !debug bgp zebra !debug bgp vnc verbose diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/r2/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/r2/zebra.conf index 9dfed4f2d6..22b689d538 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/r2/zebra.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/r2/zebra.conf @@ -1,11 +1,3 @@ -log file zebra.log -! -hostname r2 -password zebra -! -log stdout notifications -log commands -! !debug zebra packet !debug zebra dplane !debug zebra kernel diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce1/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce1/bgpd.conf index 3459796629..cd72007f46 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce1/bgpd.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce1/bgpd.conf @@ -1,8 +1 @@ frr defaults traditional -! -hostname ce1 -password zebra -! -log stdout notifications -log commands -log file bgpd.log diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce1/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce1/zebra.conf index 58e851d752..a6eab175f5 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce1/zebra.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce1/zebra.conf @@ -1,7 +1,3 @@ -log file zebra.log -! -hostname ce1 -! interface eth0 ip address 192.168.1.2/24 ipv6 address 2001:1::2/64 diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce2/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce2/bgpd.conf index 8ed9978749..cd72007f46 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce2/bgpd.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce2/bgpd.conf @@ -1,8 +1 @@ frr defaults traditional -! -hostname ce2 -password zebra -! -log stdout notifications -log commands -log file bgpd.log diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce2/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce2/zebra.conf index 0612c53223..3be205a8c9 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce2/zebra.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce2/zebra.conf @@ -1,7 +1,3 @@ -log file zebra.log -! -hostname ce2 -! interface eth0 ip address 192.168.2.2/24 ipv6 address 2001:2::2/64 diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce3/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce3/bgpd.conf index a85d9701c7..cd72007f46 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce3/bgpd.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce3/bgpd.conf @@ -1,8 +1 @@ frr defaults traditional -! -hostname ce3 -password zebra -! -log stdout notifications -log commands -log file bgpd.log diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce3/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce3/zebra.conf index d08fdadc3c..2fb86c74de 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce3/zebra.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce3/zebra.conf @@ -1,7 +1,3 @@ -log file zebra.log -! -hostname ce3 -! interface eth0 ip address 192.168.3.2/24 ipv6 address 2001:3::2/64 diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce4/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce4/bgpd.conf index 93fb32fd1b..cd72007f46 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce4/bgpd.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce4/bgpd.conf @@ -1,8 +1 @@ frr defaults traditional -! -hostname ce4 -password zebra -! -log stdout notifications -log commands -log file bgpd.log diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce4/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce4/zebra.conf index 897ed46c27..3bbbd08558 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce4/zebra.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce4/zebra.conf @@ -1,7 +1,3 @@ -log file zebra.log -! -hostname ce4 -! interface eth0 ip address 192.168.4.2/24 ipv6 address 2001:4::2/64 diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce5/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce5/bgpd.conf index 2ab6f2d2a7..cd72007f46 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce5/bgpd.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce5/bgpd.conf @@ -1,8 +1 @@ frr defaults traditional -! -hostname ce5 -password zebra -! -log stdout notifications -log commands -log file bgpd.log diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce6/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce6/bgpd.conf index e0b6540514..cd72007f46 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce6/bgpd.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce6/bgpd.conf @@ -1,8 +1 @@ frr defaults traditional -! -hostname ce6 -password zebra -! -log stdout notifications -log commands -log file bgpd.log diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce6/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce6/zebra.conf index 5a83e901e8..d39a6a6bcb 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce6/zebra.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce6/zebra.conf @@ -1,7 +1,3 @@ -log file zebra.log -! -hostname ce6 -! interface eth0 ip address 192.168.6.2/24 ipv6 address 2001:6::2/64 diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r1/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r1/bgpd.conf index 57c19e25d7..5e78e5e1a1 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r1/bgpd.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r1/bgpd.conf @@ -1,13 +1,5 @@ frr defaults traditional -! bgp send-extra-data zebra -! -hostname r1 -password zebra -! -log stdout notifications -log commands -! !debug bgp neighbor-events !debug bgp zebra !debug bgp vnc verbose diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r1/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r1/zebra.conf index dd8a756a6e..a7515e12d3 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r1/zebra.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r1/zebra.conf @@ -1,11 +1,3 @@ -log file zebra.log -! -hostname r1 -password zebra -! -log stdout notifications -log commands -! !debug zebra packet !debug zebra dplane !debug zebra kernel diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r2/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r2/bgpd.conf index abf4971a9b..bf04fbc7aa 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r2/bgpd.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r2/bgpd.conf @@ -1,13 +1,5 @@ frr defaults traditional -! bgp send-extra-data zebra -! -hostname r2 -password zebra -! -log stdout notifications -log commands -! !debug bgp neighbor-events !debug bgp zebra !debug bgp vnc verbose diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r2/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r2/zebra.conf index 3c9e4e3b25..27919cc63f 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r2/zebra.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r2/zebra.conf @@ -1,11 +1,3 @@ -log file zebra.log -! -hostname r2 -password zebra -! -log stdout notifications -log commands -! !debug zebra packet !debug zebra dplane !debug zebra kernel diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce1/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce1/bgpd.conf index 224d59b37d..a2f5aef51e 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce1/bgpd.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce1/bgpd.conf @@ -1,13 +1,5 @@ frr defaults traditional -! bgp send-extra-data zebra -! -hostname ce1 -password zebra -! -log stdout notifications -log commands -! !debug bgp neighbor-events !debug bgp zebra !debug bgp vnc verbose diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce1/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce1/zebra.conf index b6866f8a43..16102a055d 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce1/zebra.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce1/zebra.conf @@ -1,7 +1,3 @@ -log file zebra.log -! -hostname ce1 -! interface eth0 ipv6 address fd01::2/64 ! diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce2/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce2/bgpd.conf index df9a93b033..e6b40c4bfe 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce2/bgpd.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce2/bgpd.conf @@ -1,13 +1,5 @@ frr defaults traditional -! bgp send-extra-data zebra -! -hostname ce2 -password zebra -! -log stdout notifications -log commands -! !debug bgp neighbor-events !debug bgp zebra !debug bgp vnc verbose diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce2/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce2/zebra.conf index 0faa8a7a05..f17e96a0da 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce2/zebra.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/ce2/zebra.conf @@ -1,7 +1,3 @@ -log file zebra.log -! -hostname ce1 -! interface eth0 ipv6 address fd02::2/64 ! diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/bgpd.conf index b26326ea10..d0be14f007 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/bgpd.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/bgpd.conf @@ -1,13 +1,5 @@ frr defaults traditional -! bgp send-extra-data zebra -! -hostname r1 -password zebra -! -log stdout notifications -log commands -! !debug bgp neighbor-events !debug bgp nht !debug bgp zebra diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/zebra.conf index 78aa81fcb8..42e3f5bd89 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/zebra.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r1/zebra.conf @@ -1,7 +1,3 @@ -log file zebra.log -! -hostname r1 -! interface eth0 ipv6 address 2001::1/64 ! diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/bgpd.conf index 63dce15ff7..31cf9f9b5d 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/bgpd.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/bgpd.conf @@ -1,13 +1,5 @@ frr defaults traditional -! bgp send-extra-data zebra -! -hostname r2 -password zebra -! -log stdout notifications -log commands -! !debug bgp neighbor-events !debug bgp nht !debug bgp zebra diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/zebra.conf index d7ae058a83..551e7d7692 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/zebra.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf4/r2/zebra.conf @@ -1,7 +1,3 @@ -log file zebra.log -! -hostname r2 -! interface eth0 ipv6 address 2001::2/64 !