]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgp_l3vpn_to_bgp_vrf: assign different RDs to customers on r4
authorG. Paul Ziemba <paulz@labn.net>
Fri, 23 Feb 2018 01:46:34 +0000 (17:46 -0800)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 28 Nov 2018 01:22:13 +0000 (20:22 -0500)
Signed-off-by: G. Paul Ziemba <paulz@labn.net>
tests/topotests/bgp_l3vpn_to_bgp_vrf/r4/bgpd.conf
tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_routes.py
tests/topotests/lib/bgprib.py

index aa1c2a086d93509f62c483187d6d719707d46ba0..58c547647ab2796a7194aaf1677e3da93bb1ba4f 100644 (file)
@@ -31,7 +31,7 @@ router bgp 5227 vrf r4-cust1
 
    vpn-policy ipv4
        label 1041
-       rd 10:4
+       rd 10:41
        rt both 52:100
       !  nexthop 192.168.1.1
    exit
@@ -53,7 +53,7 @@ router bgp 5228 vrf r4-cust2
 
    vpn-policy ipv4
        label 1042
-       rd 10:4
+       rd 10:42
         #note RT same as r4-cust1 for inter-vrf route leaking
        rt both 52:100
       !  nexthop 192.168.1.1
index d2dfb0707143f97f869c5f2a0abd0702c81ff5e0..d6736c3574a1bf4fb2215c47465e822654e3fad9 100644 (file)
@@ -91,7 +91,18 @@ luCommand('r1','vtysh -c "show bgp ipv4 vpn"','Distinguisher:  *10:1.*5.1.0.0/24
 
 luCommand('r3','vtysh -c "show bgp ipv4 vpn"','Distinguisher:  *10:3.*5.1.0.0/24 *3.3.3.3 .*5.1.1.0/24 *3.3.3.3 .*99.0.0.2/32 *3.3.3.3 ','pass','vrf->vpn routes')
 
-luCommand('r4','vtysh -c "show bgp ipv4 vpn"','Distinguisher:  *10:4.*5.1.2.0/24 *4.4.4.4 .*5.1.3.0/24 *4.4.4.4 .*5.4.2.0/24 *4.4.4.4 .*5.4.3.0/24 *4.4.4.4 .*99.0.0.3/32  *4.4.4.4 .*99.0.0.4/32 *4.4.4.4 ','pass','vrf->vpn routes')
+#luCommand('r4','vtysh -c "show bgp ipv4 vpn"','Distinguisher:  *10:4.*5.1.2.0/24 *4.4.4.4 .*5.1.3.0/24 *4.4.4.4 .*5.4.2.0/24 *4.4.4.4 .*5.4.3.0/24 *4.4.4.4 .*99.0.0.3/32  *4.4.4.4 .*99.0.0.4/32 *4.4.4.4 ','pass','vrf->vpn routes')
+
+want = [
+    {'rd':'10:41', 'p':'5.1.2.0/24', 'n':'4.4.4.4'},
+    {'rd':'10:41', 'p':'5.1.3.0/24', 'n':'4.4.4.4'},
+    {'rd':'10:41', 'p':'99.0.0.3/32', 'n':'4.4.4.4'},
+
+    {'rd':'10:42', 'p':'5.4.2.0/24', 'n':'4.4.4.4'},
+    {'rd':'10:42', 'p':'5.4.3.0/24', 'n':'4.4.4.4'},
+    {'rd':'10:42', 'p':'99.0.0.4/32', 'n':'4.4.4.4'},
+]
+bgpribRequireVpnRoutes('r4','vrf->vpn routes',want)
 
 ########################################################################
 # PE routers: exporting vrfs set MPLS vrf labels in kernel
@@ -114,13 +125,13 @@ want_rd_routes = [
     {'rd':'10:3', 'p':'5.1.0.0/24', 'n':'3.3.3.3'},
     {'rd':'10:3', 'p':'99.0.0.2/32', 'n':'3.3.3.3'},
 
-    {'rd':'10:4', 'p':'5.1.2.0/24', 'n':'4.4.4.4'},
-    {'rd':'10:4', 'p':'5.1.3.0/24', 'n':'4.4.4.4'},
-    {'rd':'10:4', 'p':'99.0.0.3/32', 'n':'4.4.4.4'},
+    {'rd':'10:41', 'p':'5.1.2.0/24', 'n':'4.4.4.4'},
+    {'rd':'10:41', 'p':'5.1.3.0/24', 'n':'4.4.4.4'},
+    {'rd':'10:41', 'p':'99.0.0.3/32', 'n':'4.4.4.4'},
 
-    {'rd':'10:4', 'p':'5.4.2.0/24', 'n':'4.4.4.4'},
-    {'rd':'10:4', 'p':'5.4.3.0/24', 'n':'4.4.4.4'},
-    {'rd':'10:4', 'p':'99.0.0.3/32', 'n':'4.4.4.4'},
+    {'rd':'10:42', 'p':'5.4.2.0/24', 'n':'4.4.4.4'},
+    {'rd':'10:42', 'p':'5.4.3.0/24', 'n':'4.4.4.4'},
+    {'rd':'10:42', 'p':'99.0.0.4/32', 'n':'4.4.4.4'},
 ]
 bgpribRequireVpnRoutes('r2','Customer routes in provider vpn core',want_rd_routes)
 
@@ -135,13 +146,13 @@ want_r1_remote_vpn_routes = [
     {'rd':'10:3', 'p':'5.1.1.0/24', 'n':'3.3.3.3'},
     {'rd':'10:3', 'p':'99.0.0.2/32', 'n':'3.3.3.3'},
 
-    {'rd':'10:4', 'p':'5.1.2.0/24', 'n':'4.4.4.4'},
-    {'rd':'10:4', 'p':'5.1.3.0/24', 'n':'4.4.4.4'},
-    {'rd':'10:4', 'p':'99.0.0.3/32', 'n':'4.4.4.4'},
+    {'rd':'10:41', 'p':'5.1.2.0/24', 'n':'4.4.4.4'},
+    {'rd':'10:41', 'p':'5.1.3.0/24', 'n':'4.4.4.4'},
+    {'rd':'10:41', 'p':'99.0.0.3/32', 'n':'4.4.4.4'},
 
-    {'rd':'10:4', 'p':'5.4.2.0/24', 'n':'4.4.4.4'},
-    {'rd':'10:4', 'p':'5.4.3.0/24', 'n':'4.4.4.4'},
-    {'rd':'10:4', 'p':'99.0.0.3/32', 'n':'4.4.4.4'},
+    {'rd':'10:42', 'p':'5.4.2.0/24', 'n':'4.4.4.4'},
+    {'rd':'10:42', 'p':'5.4.3.0/24', 'n':'4.4.4.4'},
+    {'rd':'10:42', 'p':'99.0.0.4/32', 'n':'4.4.4.4'},
 ]
 bgpribRequireVpnRoutes('r1','Remote Customer routes in R1 vpn',want_r1_remote_vpn_routes)
 
@@ -150,13 +161,13 @@ want_r3_remote_vpn_routes = [
     {'rd':'10:1', 'p':'5.1.1.0/24', 'n':'1.1.1.1'},
     {'rd':'10:1', 'p':'99.0.0.1/32', 'n':'1.1.1.1'},
 
-    {'rd':'10:4', 'p':'5.1.2.0/24', 'n':'4.4.4.4'},
-    {'rd':'10:4', 'p':'5.1.3.0/24', 'n':'4.4.4.4'},
-    {'rd':'10:4', 'p':'99.0.0.3/32', 'n':'4.4.4.4'},
+    {'rd':'10:41', 'p':'5.1.2.0/24', 'n':'4.4.4.4'},
+    {'rd':'10:41', 'p':'5.1.3.0/24', 'n':'4.4.4.4'},
+    {'rd':'10:41', 'p':'99.0.0.3/32', 'n':'4.4.4.4'},
 
-    {'rd':'10:4', 'p':'5.4.2.0/24', 'n':'4.4.4.4'},
-    {'rd':'10:4', 'p':'5.4.3.0/24', 'n':'4.4.4.4'},
-    {'rd':'10:4', 'p':'99.0.0.3/32', 'n':'4.4.4.4'},
+    {'rd':'10:42', 'p':'5.4.2.0/24', 'n':'4.4.4.4'},
+    {'rd':'10:42', 'p':'5.4.3.0/24', 'n':'4.4.4.4'},
+    {'rd':'10:42', 'p':'99.0.0.4/32', 'n':'4.4.4.4'},
 ]
 bgpribRequireVpnRoutes('r3','Remote Customer routes in R3 vpn',want_r3_remote_vpn_routes)
 
index 39cb0e71f71894a0b1e14d7c2359ccf7c165d2a6..9bd038e675b680e7160b95a2b6e9fb0034297a71 100644 (file)
@@ -98,8 +98,8 @@ class BgpRib:
 
 BgpRib=BgpRib()
 
-def bgpribRequireVpnRoutes(target, title, wantroutes):
-    BgpRib.RequireVpnRoutes(target, title, wantroutes)
+def bgpribRequireVpnRoutes(target, title, wantroutes, debug=0):
+    BgpRib.RequireVpnRoutes(target, title, wantroutes, debug)
 
-def bgpribRequireUnicastRoutes(target, afi, vrf, title, wantroutes):
-    BgpRib.RequireUnicastRoutes(target, afi, vrf, title, wantroutes)
+def bgpribRequireUnicastRoutes(target, afi, vrf, title, wantroutes, debug=0):
+    BgpRib.RequireUnicastRoutes(target, afi, vrf, title, wantroutes, debug)