]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgp vpn-vrf leaking: partial changes toward using new functionality
authorG. Paul Ziemba <paulz@labn.net>
Mon, 19 Feb 2018 16:52:24 +0000 (08:52 -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/r1/bgpd.conf
tests/topotests/bgp_l3vpn_to_bgp_vrf/r2/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/check_linux_mpls.py
tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_routes.py
tests/topotests/bgp_l3vpn_to_bgp_vrf/test_bgp_l3vpn_to_bgp_vrf.py

index 4c3981e85061f2fdfd1728c9a5552c690e13004c..e45420d105f76af372f5ea33512abe834dbf9cbb 100644 (file)
@@ -1,46 +1,54 @@
 frr defaults traditional
-!
+
 hostname r1
 password zebra
 log stdout notifications
 log monitor notifications
 log commands
+
+log file /tmp/topotests/bgp_l3vpn_to_bgp_vrf.test_bgp_l3vpn_to_bgp_vrf/r1-bgpd.log debugging
+
+debug bgp vpn leak-to-vrf
+debug bgp vpn leak-from-vrf
+debug bgp vpn label
+
 router bgp 5226
    bgp router-id 1.1.1.1
    bgp cluster-id 1.1.1.1
    neighbor 2.2.2.2 remote-as 5226
    neighbor 2.2.2.2 update-source 1.1.1.1
-!
+
    address-family ipv4 unicast
      no neighbor 2.2.2.2 activate
    exit-address-family
-!
+
    address-family ipv4 vpn
      neighbor 2.2.2.2 activate
    exit-address-family
-!
-#wait for new syntax
-#   vrf-policy r1-cust1
-#      label 101
-#      rd 10:1
-#      rt both 52:100
-#      !nexthop 192.168.1.1
-#   exit-vrf-policy
-!
- !vnc export bgp mode group-nve
- !vnc export bgp group-nve group r1-cust1
- !vnc redistribute mode resolve-nve
- !vnc redistribute ipv4 bgp-direct
+
 
 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
-  ! neighbor 192.168.1.2 route-reflector-client
+
+   vpn-policy ipv4
+        label 101
+        rd 10:1
+        rt both 52:100
+      !  nexthop 192.168.1.1
+    exit
+
    address-family ipv4 unicast
-#     redistribute vnc-direct
      neighbor 192.168.1.2 activate
      neighbor 192.168.1.2 next-hop-self
+
+     redistribute vpn
+     export vpn
    exit-address-family
+
+
 !
 end
index 241c2ac0aed422be126884d169f8cfa2c89b6d85..9400f6ba68cbbeca4c0929191a8959f6c99376d4 100644 (file)
@@ -5,6 +5,8 @@ password zebra
 log stdout notifications
 log monitor notifications
 log commands
+log file /tmp/topotests/bgp_l3vpn_to_bgp_vrf.test_bgp_l3vpn_to_bgp_vrf/r2-bgpd.log debugging
+
 router bgp 5226
    bgp router-id 2.2.2.2
    bgp cluster-id 2.2.2.2
index 81d1af82504c08e04d52c91c6343d95f44f6cac9..f3f258c32e2dd1c0f00bd152d4837dc00732c25f 100644 (file)
@@ -1,46 +1,46 @@
 frr defaults traditional
-!
+
 hostname r3
 password zebra
 log stdout notifications
 log monitor notifications
 log commands
+debug bgp vpn label
+
 router bgp 5226
    bgp router-id 3.3.3.3
    bgp cluster-id 3.3.3.3
    neighbor 2.2.2.2 remote-as 5226
    neighbor 2.2.2.2 update-source 3.3.3.3
-!
+
    address-family ipv4 unicast
      no neighbor 2.2.2.2 activate
    exit-address-family
-!
+
   address-family ipv4 vpn
      neighbor 2.2.2.2 activate
    exit-address-family
-!
-#wait for new syntax
-#   vrf-policy r3-cust1
-#      label 103
-#      rd 10:3
-#      rt both 52:100
-#!      nexthop 192.168.1.1
-#   exit-vrf-policy
-!
-! vnc export bgp mode group-nve
-! vnc export bgp group-nve group r3-cust1
-! vnc redistribute mode resolve-nve
-! vnc redistribute ipv4 bgp-direct
-!
+
 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 
-!   neighbor 192.168.1.2 route-reflector-client
+
+   vpn-policy ipv4
+     label 103
+     rd 10:3
+     rt both 52:100
+   exit
+
    address-family ipv4 unicast
-#     redistribute vnc-direct
      neighbor 192.168.1.2 activate
      neighbor 192.168.1.2 next-hop-self
+
+     redistribute vpn
+     export vpn
    exit-address-family
-!
-end
\ No newline at end of file
+
+
+end
index d2b593009f55bca6f50152e4c69f494b476812f9..88cb51cfa792d78a3d4d1b8f09f2de5ea21e174a 100644 (file)
@@ -5,6 +5,9 @@ password zebra
 log stdout notifications
 log monitor notifications
 log commands
+
+debug bgp vpn label
+
 router bgp 5226
    bgp router-id 4.4.4.4
    bgp cluster-id 4.4.4.4
@@ -14,9 +17,13 @@ router bgp 5226
    address-family ipv4 unicast
      no neighbor 2.2.2.2 activate
    exit-address-family
+
    address-family ipv4 vpn
      neighbor 2.2.2.2 activate
    exit-address-family
+
+
+
 !
 #wait for new syntax
 #   vrf-policy r4-cust1
@@ -33,32 +40,51 @@ router bgp 5226
 #      rt both 52:100
 #!      nexthop 192.168.2.1
 #   exit-vrf-policy
-!
-! vnc export bgp mode group-nve
-! vnc export bgp group-nve group r4-cust2
-! vnc redistribute mode resolve-nve
-! vnc redistribute ipv4 bgp-direct
-!
+
+
 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 
-!   neighbor 192.168.1.2 route-reflector-client
+
+   vpn-policy ipv4
+       label 1041
+       rd 10:4
+       rt both 52:100
+      !  nexthop 192.168.1.1
+   exit
+
    address-family ipv4 unicast
-#     redistribute vnc-direct
      neighbor 192.168.1.2 activate
      neighbor 192.168.1.2 next-hop-self
+
+     redistribute vpn
+     export vpn
    exit-address-family
 !
 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
-!   neighbor 192.168.2.2 route-reflector-client
+
+   vpn-policy ipv4
+       label 1042
+       rd 10:4
+        #note RT same as r4-cust1 for inter-vrf route leaking (???)
+       rt both 52:100
+      !  nexthop 192.168.1.1
+   exit
+
    address-family ipv4 unicast
-#     redistribute vnc-direct
      neighbor 192.168.2.2 activate
      neighbor 192.168.2.2 next-hop-self
+
+     redistribute vpn
+     export vpn
    exit-address-family
 !
 end
index af0bafac9dc6f475b7bbccb995187c36642b13d4..66f116b83fe74b2fa27b794213eb53bd06a96d39 100644 (file)
@@ -14,10 +14,14 @@ if ret != False and found != None:
     luCommand('ce1','ip route add default via 192.168.1.1')
     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-eth5 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 -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')
index 5ab993ece63062ce73413eb4277d45190ec6cd3f..176f81f373820cd71c4183781a1d37815f2d818c 100644 (file)
@@ -11,7 +11,14 @@ luCommand('r1','vtysh -c "show bgp ipv4 uni"','No BGP prefixes displayed','pass'
 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')
 luCommand('r4','vtysh -c "show bgp ipv4 uni"','No BGP prefixes displayed','pass','Core Unicast SAFI clean')
-luCommand('r1','vtysh -c "show bgp ipv4 vpn"','No BGP prefixes displayed','pass','Core VPN SAFI clean')
-luCommand('r2','vtysh -c "show bgp ipv4 vpn"','No BGP prefixes displayed','pass','Core VPN SAFI clean')
-luCommand('r3','vtysh -c "show bgp ipv4 vpn"','No BGP prefixes displayed','pass','Core VPN SAFI clean')
-luCommand('r4','vtysh -c "show bgp ipv4 vpn"','No BGP prefixes displayed','pass','Core VPN SAFI clean')
+
+# Core VPN routes
+luCommand('r1','vtysh -c "show bgp ipv4 vpn"','5.1.0.0/24 .*1.1.1.1 .*5.1.1.0/24 .*1.1.1.1 .*2 routes and 2','pass','vrf->vpn routes')
+luCommand('r3','vtysh -c "show bgp ipv4 vpn"','5.1.0.0/24 .*3.3.3.3 .*5.1.1.0/24 .*3.3.3.3 .*2 routes and 2','pass','vrf->vpn routes')
+luCommand('r4','vtysh -c "show bgp ipv4 vpn"','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 .*4 routes and 4','pass','vrf->vpn routes')
+
+# MPLS vrf labels
+luCommand('r1','vtysh -c "show mpls table"',' 101 *BGP *r1-cust1','pass','vrf labels')
+luCommand('r3','vtysh -c "show mpls table"',' 103 *BGP *r3-cust1','pass','vrf labels')
+luCommand('r4','vtysh -c "show mpls table"',' 1041 *BGP *r4-cust1 .*1042 *BGP *r4-cust2','pass','vrf labels')
+
index 5047ac725e9f0ec2e096be720cbaa115447dd15a..2e3b3f056a1ee8cda96bcf94f11a452cdf4dcecf 100755 (executable)
@@ -72,7 +72,7 @@ def test_check_linux_mpls():
     #CliOnFail = 'tgen.mininet_cli'
     CheckFunc = 'ltemplateVersionCheck(\'3.1\', iproute2=\'4.9\')'
     #uncomment next line to start cli *before* script is run
-    #CheckFunc = 'ltemplateVersionCheck(\'3.1\', cli=True, iproute2=\'4.9\')'
+    CheckFunc = 'ltemplateVersionCheck(\'3.1\', cli=True, iproute2=\'4.9\')'
     ltemplateTest('scripts/check_linux_mpls.py', False, CliOnFail, CheckFunc)
 
 def SKIP_test_cleanup_all():