]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgp_l3vpn_to_bgp_vrf: prepend rtr name to vrf name, per Philippe
authorLou Berger <lberger@labn.net>
Thu, 8 Feb 2018 15:16:51 +0000 (10:16 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 28 Nov 2018 01:22:13 +0000 (20:22 -0500)
Signed-off-by: Lou Berger <lberger@labn.net>
tests/topotests/bgp_l3vpn_to_bgp_vrf/customize.py
tests/topotests/bgp_l3vpn_to_bgp_vrf/r1/bgpd.conf
tests/topotests/bgp_l3vpn_to_bgp_vrf/r3/bgpd.conf
tests/topotests/bgp_l3vpn_to_bgp_vrf/r4/bgpd.conf
tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/add_routes.py
tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_linux_mpls.py
tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_routes.py
tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/cleanup_all.py

index beb9bffcc554b6fa0989c671e09ba41f8e5da188..8d08ad026000806b517ae0779178f9e4a480ac89 100644 (file)
@@ -199,33 +199,33 @@ def ltemplatePreRouterStartHook():
 
     #configure cust1 VRFs & MPLS
     rtrs = ['r1', 'r3', 'r4']
-    cmds = ['ip link add cust1 type vrf table 10',
-            'ip ru add oif cust1 table 10',
-            'ip ru add iif cust1 table 10',
-            'ip link set dev cust1 up']
+    cmds = ['ip link add {0}-cust1 type vrf table 10',
+            'ip ru add oif {0}-cust1 table 10',
+            'ip ru add iif {0}-cust1 table 10',
+            'ip link set dev {0}-cust1 up']
     for rtr in rtrs:
         router = tgen.gears[rtr]
         for cmd in cmds:
-            cc.doCmd(tgen, rtr, cmd)
-        cc.doCmd(tgen, rtr, 'ip link set dev {}-eth4 master cust1'.format(rtr))
-        intfs = ['cust1', 'lo', rtr+'-eth0', rtr+'-eth4']
+            cc.doCmd(tgen, rtr, cmd.format(rtr))
+        cc.doCmd(tgen, rtr, 'ip link set dev {0}-eth4 master {0}-cust1'.format(rtr))
+        intfs = [rtr+'-cust1', 'lo', rtr+'-eth0', rtr+'-eth4']
         for intf in intfs:
             cc.doCmd(tgen, rtr, 'echo 1 > /proc/sys/net/mpls/conf/{}/input'.format(intf))
-        logger.info('setup {0} vrf cust1, {0}-eth4. enabled mpls input.'.format(rtr))
+        logger.info('setup {0} vrf {0}-cust1, {0}-eth4. enabled mpls input.'.format(rtr))
     #configure cust2 VRFs & MPLS
     rtrs = ['r4']
-    cmds = ['ip link add cust2 type vrf table 20',
-            'ip ru add oif cust1 table 20',
-            'ip ru add iif cust1 table 20',
-            'ip link set dev cust2 up']
+    cmds = ['ip link add {0}-cust2 type vrf table 20',
+            'ip ru add oif {0}-cust1 table 20',
+            'ip ru add iif {0}-cust1 table 20',
+            'ip link set dev {0}-cust2 up']
     for rtr in rtrs:
         for cmd in cmds:
-            cc.doCmd(tgen, rtr, cmd)
-        cc.doCmd(tgen, rtr, 'ip link set dev {}-eth5 master cust2'.format(rtr))
-        intfs = ['cust2', rtr+'-eth5']
+            cc.doCmd(tgen, rtr, cmd.format(rtr))
+        cc.doCmd(tgen, rtr, 'ip link set dev {0}-eth5 master {0}-cust2'.format(rtr))
+        intfs = [rtr+'-cust2', rtr+'-eth5']
         for intf in intfs:
             cc.doCmd(tgen, rtr, 'echo 1 > /proc/sys/net/mpls/conf/{}/input'.format(intf))
-        logger.info('setup {0} vrf cust2, {0}-eth5. enabled mpls input.'.format(rtr))
+        logger.info('setup {0} vrf {0}-cust2, {0}-eth5. enabled mpls input.'.format(rtr))
     global InitSuccess
     if cc.getOutput():
         InitSuccess = False
index 2f2abb4233164339c04600372edf653e8630b31f..4c3981e85061f2fdfd1728c9a5552c690e13004c 100644 (file)
@@ -20,7 +20,7 @@ router bgp 5226
    exit-address-family
 !
 #wait for new syntax
-#   vrf-policy cust1
+#   vrf-policy r1-cust1
 #      label 101
 #      rd 10:1
 #      rt both 52:100
@@ -28,11 +28,11 @@ router bgp 5226
 #   exit-vrf-policy
 !
  !vnc export bgp mode group-nve
- !vnc export bgp group-nve group cust1
+ !vnc export bgp group-nve group r1-cust1
  !vnc redistribute mode resolve-nve
  !vnc redistribute ipv4 bgp-direct
 
-router bgp 5227 vrf cust1
+router bgp 5227 vrf r1-cust1
    bgp router-id 192.168.1.1
    neighbor 192.168.1.2 remote-as 5227
    neighbor 192.168.1.2 update-source 192.168.1.1
index fd14af45e1fba731c7d203b2cba07ceee19d46ab..81d1af82504c08e04d52c91c6343d95f44f6cac9 100644 (file)
@@ -20,7 +20,7 @@ router bgp 5226
    exit-address-family
 !
 #wait for new syntax
-#   vrf-policy cust1
+#   vrf-policy r3-cust1
 #      label 103
 #      rd 10:3
 #      rt both 52:100
@@ -28,11 +28,11 @@ router bgp 5226
 #   exit-vrf-policy
 !
 ! vnc export bgp mode group-nve
-! vnc export bgp group-nve group cust1
+! vnc export bgp group-nve group r3-cust1
 ! vnc redistribute mode resolve-nve
 ! vnc redistribute ipv4 bgp-direct
 !
-router bgp 5227 vrf cust1
+router bgp 5227 vrf r3-cust1
    bgp router-id 192.168.1.1
    neighbor 192.168.1.2 remote-as 5227
    neighbor 192.168.1.2 update-source 192.168.1.1 
index c125ba1b445ab664a6d143fce814ff9eb1a44ec4..d2b593009f55bca6f50152e4c69f494b476812f9 100644 (file)
@@ -19,27 +19,27 @@ router bgp 5226
    exit-address-family
 !
 #wait for new syntax
-#   vrf-policy cust1
+#   vrf-policy r4-cust1
 #      label 104
 #      rd 10:4
 #      rt both 52:100
 #!      nexthop 192.168.1.1
 #   exit-vrf-policy
 #!
-#   vrf-policy cust2
+#   vrf-policy r4-cust2
 #      label 104
 #      rd 10:4
-#      #note RT same as cust1 for inter-vrf route leaking
+#      #note RT same as r4-cust1 for inter-vrf route leaking
 #      rt both 52:100
 #!      nexthop 192.168.2.1
 #   exit-vrf-policy
 !
 ! vnc export bgp mode group-nve
-! vnc export bgp group-nve group cust1
+! vnc export bgp group-nve group r4-cust2
 ! vnc redistribute mode resolve-nve
 ! vnc redistribute ipv4 bgp-direct
 !
-router bgp 5227 vrf cust1
+router bgp 5227 vrf r4-cust1
    bgp router-id 192.168.1.1
    neighbor 192.168.1.2 remote-as 5227
    neighbor 192.168.1.2 update-source 192.168.1.1 
@@ -50,7 +50,7 @@ router bgp 5227 vrf cust1
      neighbor 192.168.1.2 next-hop-self
    exit-address-family
 !
-router bgp 5228 vrf cust2
+router bgp 5228 vrf r4-cust2
    bgp router-id 192.168.2.1
    neighbor 192.168.2.2 remote-as 5228
    neighbor 192.168.2.2 update-source 192.168.2.1
index f3c70ecbede758877935854f83bebd7b1aa6e4a6..19b73d20578357cdf3a106ed655becc64942da66 100644 (file)
@@ -1,7 +1,7 @@
 from lutil import luCommand
-luCommand('r1','vtysh -c "add vrf cust1 prefix 99.0.0.1/32"','.','none','IP Address')
-luCommand('r3','vtysh -c "add vrf cust1 prefix 99.0.0.2/32"','.','none','IP Address')
-luCommand('r4','vtysh -c "add vrf cust1 prefix 99.0.0.3/32"','.','none','IP Address')
+luCommand('r1','vtysh -c "add vrf r1-cust1 prefix 99.0.0.1/32"','.','none','IP Address')
+luCommand('r3','vtysh -c "add vrf r3-cust1 prefix 99.0.0.2/32"','.','none','IP Address')
+luCommand('r4','vtysh -c "add vrf r4-cust1 prefix 99.0.0.3/32"','.','none','IP Address')
 luCommand('r1','vtysh -c "show vnc registrations local"','99.0.0.1','pass','Local Registration')
 luCommand('r3','vtysh -c "show vnc registrations local"','99.0.0.2','pass','Local Registration')
 luCommand('r4','vtysh -c "show vnc registrations local"','99.0.0.3','pass','Local Registration')
index 57219598843de6e826f7ba164b0eba41a3c6d49d..2ccc94599276b023d774e81a3ac93966c5a55891 100644 (file)
@@ -24,26 +24,26 @@ if ret != False and found != None:
     luCommand('r2','ip -M route show','.','pass','See %s as label to r1' % label4r1)
     luCommand('ce4','ip route add default via 192.168.2.1')
     luCommand('ce1','ip route add default via 192.168.1.1')
-    luCommand('r1','ip route add 99.0.0.1 vrf cust1 dev r1-eth4 via 192.168.1.2')
-    luCommand('r4','ip route add 99.0.0.4 vrf cust2 dev r4-eth4 via 192.168.2.2')
-    luCommand('r1','ip -M route add 101 dev cust1')
-    luCommand('r4','ip -M route add 104 dev cust2')
-    luCommand('r1','ip route add 99.0.0.4/32 vrf cust1 nexthop encap mpls %s/104 via 10.0.1.2 dev r1-eth0'%label4r4)
-    luCommand('r4','ip route add 99.0.0.1/32 vrf cust2 nexthop encap mpls %s/101 via 10.0.2.2 dev r4-eth0'%label4r1)
-    luCommand('r1','ip route show vrf cust1','99.0.0.4','pass', 'VRF->MPLS PHP route installed')
-    luCommand('r4','ip route show vrf cust2','99.0.0.1','pass', 'VRF->MPLS PHP route installed')
+    luCommand('r1','ip route add 99.0.0.1 vrf r1-cust1 dev r1-eth4 via 192.168.1.2')
+    luCommand('r4','ip route add 99.0.0.4 vrf r4-cust2 dev r4-eth4 via 192.168.2.2')
+    luCommand('r1','ip -M route add 101 dev r1-cust1')
+    luCommand('r4','ip -M route add 104 dev r4-cust2')
+    luCommand('r1','ip route add 99.0.0.4/32 vrf r1-cust1 nexthop encap mpls %s/104 via 10.0.1.2 dev r1-eth0'%label4r4)
+    luCommand('r4','ip route add 99.0.0.1/32 vrf r4-cust2 nexthop encap mpls %s/101 via 10.0.2.2 dev r4-eth0'%label4r1)
+    luCommand('r1','ip route show vrf r1-cust1','99.0.0.4','pass', 'VRF->MPLS PHP route installed')
+    luCommand('r4','ip route show vrf r4-cust2','99.0.0.1','pass', 'VRF->MPLS PHP route installed')
     luCommand('r1','ip -M route show','101','MPLS->VRF route installed')
     luCommand('r4','ip -M route show','104','MPLS->VRF route installed')
     luCommand('ce1','ping 99.0.0.4 -I 99.0.0.1 -c 1',' 0. packet loss','wait','CE->CE (loopback) ping - l3vpn+zebra case')
     luCommand('ce4','ping 99.0.0.1 -I 99.0.0.4 -c 1',' 0. packet loss','wait','CE->CE (loopback) ping - l3vpn+zebra case')
-    luCommand('r1','ip route del 99.0.0.4/32 vrf cust1')
-    luCommand('r4','ip route del 99.0.0.1/32 vrf cust2')
-    luCommand('r1','ip route add 99.0.0.4/32 vrf cust1 nexthop encap mpls %s/1004/104 via 10.0.1.2 dev r1-eth0'%label4r4)
+    luCommand('r1','ip route del 99.0.0.4/32 vrf r1-cust1')
+    luCommand('r4','ip route del 99.0.0.1/32 vrf r4-cust2')
+    luCommand('r1','ip route add 99.0.0.4/32 vrf r1-cust1 nexthop encap mpls %s/1004/104 via 10.0.1.2 dev r1-eth0'%label4r4)
     luCommand('r4','ip -M route add 1004 dev lo')
-    luCommand('r4','ip route add 99.0.0.1/32 vrf cust2 nexthop encap mpls %s/1001/101 via 10.0.2.2 dev r4-eth0'%label4r1)
+    luCommand('r4','ip route add 99.0.0.1/32 vrf r4-cust2 nexthop encap mpls %s/1001/101 via 10.0.2.2 dev r4-eth0'%label4r1)
     luCommand('r1','ip -M route add 1001 dev lo')
-    luCommand('r1','ip route show vrf cust1','99.0.0.4.*1004/104','pass', 'VRF->MPLS non-PHP route installed')
-    luCommand('r4','ip route show vrf cust2','99.0.0.1.*1001/101','pass', 'VRF->MPLS non-PHP route installed')
+    luCommand('r1','ip route show vrf r1-cust1','99.0.0.4.*1004/104','pass', 'VRF->MPLS non-PHP route installed')
+    luCommand('r4','ip route show vrf r4-cust2','99.0.0.1.*1001/101','pass', 'VRF->MPLS non-PHP route installed')
     luCommand('r1','ip -M route show','1001','MPLS "non-PHP" route installed')
     luCommand('r4','ip -M route show','1004','MPLS "non-PHP" route installed')
     luCommand('ce1','ping 99.0.0.4 -I 99.0.0.1 -c 1',' 0. packet loss','wait','CE->CE (loopback) ping')
index dfb86b5bfda9db4ee747b0b2771b66e5a2971bd1..5ab993ece63062ce73413eb4277d45190ec6cd3f 100644 (file)
@@ -3,10 +3,10 @@ luCommand('ce1','vtysh -c "show bgp ipv4 uni"','5.1.0.0/24 .* 5.1.1.0/24 *99.0.0
 luCommand('ce2','vtysh -c "show bgp ipv4 uni"','5.1.0.0/24 .* 5.1.1.0/24 *99.0.0.2 .*2 routes and 2','pass','Local routes')
 luCommand('ce3','vtysh -c "show bgp ipv4 uni"','5.1.2.0/24 .* 5.1.3.0/24 *99.0.0.3 .*2 routes and 2','pass','Local routes')
 luCommand('ce4','vtysh -c "show bgp ipv4 uni"','5.4.2.0/24 .* 5.4.3.0/24 *99.0.0.4 .*2 routes and 2','pass','Local routes')
-luCommand('r1','vtysh -c "show bgp vrf cust1 ipv4 uni"','5.1.0.0/24 .*5.1.1.0/24 *99.0.0.1 .*2 routes and 2','wait','Cust1 unicast routes', 10)
-luCommand('r3','vtysh -c "show bgp vrf cust1 ipv4 uni"','5.1.0.0/24 .*5.1.1.0/24 *99.0.0.2 .*2 routes and 2','wait','Cust1 unicast routes', 10)
-luCommand('r4','vtysh -c "show bgp vrf cust1 ipv4 uni"','5.1.2.0/24 .*5.1.3.0/24 *99.0.0.3 .*2 routes and 2','wait','Cust1 unicast routes', 10)
-luCommand('r4','vtysh -c "show bgp vrf cust2 ipv4 uni"','5.4.2.0/24 .*5.4.3.0/24 *99.0.0.4 .*2 routes and 2','wait','Cust2 unicast routes', 10)
+luCommand('r1','vtysh -c "show bgp vrf r1-cust1 ipv4 uni"','5.1.0.0/24 .*5.1.1.0/24 *99.0.0.1 .*2 routes and 2','wait','Cust1 unicast routes', 10)
+luCommand('r3','vtysh -c "show bgp vrf r3-cust1 ipv4 uni"','5.1.0.0/24 .*5.1.1.0/24 *99.0.0.2 .*2 routes and 2','wait','Cust1 unicast routes', 10)
+luCommand('r4','vtysh -c "show bgp vrf r4-cust1 ipv4 uni"','5.1.2.0/24 .*5.1.3.0/24 *99.0.0.3 .*2 routes and 2','wait','Cust1 unicast routes', 10)
+luCommand('r4','vtysh -c "show bgp vrf r4-cust2 ipv4 uni"','5.4.2.0/24 .*5.4.3.0/24 *99.0.0.4 .*2 routes and 2','wait','Cust2 unicast routes', 10)
 luCommand('r1','vtysh -c "show bgp ipv4 uni"','No BGP prefixes displayed','pass','Core Unicast SAFI clean')
 luCommand('r2','vtysh -c "show bgp ipv4 uni"','No BGP prefixes displayed','pass','Core Unicast SAFI clean')
 luCommand('r3','vtysh -c "show bgp ipv4 uni"','No BGP prefixes displayed','pass','Core Unicast SAFI clean')
index a57a4f3e882a6b0feb0df00c2fc2df40fa896b83..a721cf21bd40def7776943ec4ebc928305f61f4d 100644 (file)
@@ -1,7 +1,7 @@
 from lutil import luCommand
-luCommand('r1','vtysh -c "clear vrf cust1 prefix 99.0.0.1/32"','.','none','Cleared VRF route')
-luCommand('r3','vtysh -c "clear vrf cust1 prefix 99.0.0.2/32"','.','none','Cleared VRF route')
-luCommand('r4','vtysh -c "clear vrf cust1 prefix 99.0.0.3/32"','.','none','Cleared VRF route')
+luCommand('r1','vtysh -c "clear vrf r1-cust1 prefix 99.0.0.1/32"','.','none','Cleared VRF route')
+luCommand('r3','vtysh -c "clear vrf r3-cust1 prefix 99.0.0.2/32"','.','none','Cleared VRF route')
+luCommand('r4','vtysh -c "clear vrf r3-cust1 prefix 99.0.0.3/32"','.','none','Cleared VRF route')
 luCommand('r1','vtysh -c "show vnc registrations local"','99.0.0.1','fail','Local Registration cleared')
 luCommand('r3','vtysh -c "show vnc registrations local"','99.0.0.2','fail','Local Registration cleared')
 luCommand('r4','vtysh -c "show vnc registrations local"','99.0.0.3','fail','Local Registration cleared')