From: G. Paul Ziemba Date: Mon, 19 Feb 2018 16:52:24 +0000 (-0800) Subject: bgp vpn-vrf leaking: partial changes toward using new functionality X-Git-Tag: frr-7.1-dev~151^2~107 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=9c8eda68e9c5d22bc7178cd4e9d1f6027482e97e;p=matthieu%2Ffrr.git bgp vpn-vrf leaking: partial changes toward using new functionality Signed-off-by: G. Paul Ziemba --- diff --git a/tests/topotests/bgp_l3vpn_to_bgp_vrf/r1/bgpd.conf b/tests/topotests/bgp_l3vpn_to_bgp_vrf/r1/bgpd.conf index 4c3981e850..e45420d105 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_vrf/r1/bgpd.conf +++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/r1/bgpd.conf @@ -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 diff --git a/tests/topotests/bgp_l3vpn_to_bgp_vrf/r2/bgpd.conf b/tests/topotests/bgp_l3vpn_to_bgp_vrf/r2/bgpd.conf index 241c2ac0ae..9400f6ba68 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_vrf/r2/bgpd.conf +++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/r2/bgpd.conf @@ -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 diff --git a/tests/topotests/bgp_l3vpn_to_bgp_vrf/r3/bgpd.conf b/tests/topotests/bgp_l3vpn_to_bgp_vrf/r3/bgpd.conf index 81d1af8250..f3f258c32e 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_vrf/r3/bgpd.conf +++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/r3/bgpd.conf @@ -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 diff --git a/tests/topotests/bgp_l3vpn_to_bgp_vrf/r4/bgpd.conf b/tests/topotests/bgp_l3vpn_to_bgp_vrf/r4/bgpd.conf index d2b593009f..88cb51cfa7 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_vrf/r4/bgpd.conf +++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/r4/bgpd.conf @@ -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 diff --git a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_linux_mpls.py b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_linux_mpls.py index af0bafac9d..66f116b83f 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_linux_mpls.py +++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_linux_mpls.py @@ -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') diff --git a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_routes.py b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_routes.py index 5ab993ece6..176f81f373 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_routes.py +++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_routes.py @@ -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') + diff --git a/tests/topotests/bgp_l3vpn_to_bgp_vrf/test_bgp_l3vpn_to_bgp_vrf.py b/tests/topotests/bgp_l3vpn_to_bgp_vrf/test_bgp_l3vpn_to_bgp_vrf.py index 5047ac725e..2e3b3f056a 100755 --- a/tests/topotests/bgp_l3vpn_to_bgp_vrf/test_bgp_l3vpn_to_bgp_vrf.py +++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/test_bgp_l3vpn_to_bgp_vrf.py @@ -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():