mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-13 21:10:28 +00:00
bgp vpn-vrf leaking: partial changes toward using new functionality
Signed-off-by: G. Paul Ziemba <paulz@labn.net>
This commit is contained in:
parent
1c2bcf650f
commit
9c8eda68e9
@ -1,46 +1,54 @@
|
|||||||
frr defaults traditional
|
frr defaults traditional
|
||||||
!
|
|
||||||
hostname r1
|
hostname r1
|
||||||
password zebra
|
password zebra
|
||||||
log stdout notifications
|
log stdout notifications
|
||||||
log monitor notifications
|
log monitor notifications
|
||||||
log commands
|
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
|
router bgp 5226
|
||||||
bgp router-id 1.1.1.1
|
bgp router-id 1.1.1.1
|
||||||
bgp cluster-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 remote-as 5226
|
||||||
neighbor 2.2.2.2 update-source 1.1.1.1
|
neighbor 2.2.2.2 update-source 1.1.1.1
|
||||||
!
|
|
||||||
address-family ipv4 unicast
|
address-family ipv4 unicast
|
||||||
no neighbor 2.2.2.2 activate
|
no neighbor 2.2.2.2 activate
|
||||||
exit-address-family
|
exit-address-family
|
||||||
!
|
|
||||||
address-family ipv4 vpn
|
address-family ipv4 vpn
|
||||||
neighbor 2.2.2.2 activate
|
neighbor 2.2.2.2 activate
|
||||||
exit-address-family
|
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
|
router bgp 5227 vrf r1-cust1
|
||||||
|
|
||||||
bgp router-id 192.168.1.1
|
bgp router-id 192.168.1.1
|
||||||
|
|
||||||
neighbor 192.168.1.2 remote-as 5227
|
neighbor 192.168.1.2 remote-as 5227
|
||||||
neighbor 192.168.1.2 update-source 192.168.1.1
|
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
|
address-family ipv4 unicast
|
||||||
# redistribute vnc-direct
|
|
||||||
neighbor 192.168.1.2 activate
|
neighbor 192.168.1.2 activate
|
||||||
neighbor 192.168.1.2 next-hop-self
|
neighbor 192.168.1.2 next-hop-self
|
||||||
|
|
||||||
|
redistribute vpn
|
||||||
|
export vpn
|
||||||
exit-address-family
|
exit-address-family
|
||||||
|
|
||||||
|
|
||||||
!
|
!
|
||||||
end
|
end
|
||||||
|
@ -5,6 +5,8 @@ password zebra
|
|||||||
log stdout notifications
|
log stdout notifications
|
||||||
log monitor notifications
|
log monitor notifications
|
||||||
log commands
|
log commands
|
||||||
|
log file /tmp/topotests/bgp_l3vpn_to_bgp_vrf.test_bgp_l3vpn_to_bgp_vrf/r2-bgpd.log debugging
|
||||||
|
|
||||||
router bgp 5226
|
router bgp 5226
|
||||||
bgp router-id 2.2.2.2
|
bgp router-id 2.2.2.2
|
||||||
bgp cluster-id 2.2.2.2
|
bgp cluster-id 2.2.2.2
|
||||||
|
@ -1,46 +1,46 @@
|
|||||||
frr defaults traditional
|
frr defaults traditional
|
||||||
!
|
|
||||||
hostname r3
|
hostname r3
|
||||||
password zebra
|
password zebra
|
||||||
log stdout notifications
|
log stdout notifications
|
||||||
log monitor notifications
|
log monitor notifications
|
||||||
log commands
|
log commands
|
||||||
|
debug bgp vpn label
|
||||||
|
|
||||||
router bgp 5226
|
router bgp 5226
|
||||||
bgp router-id 3.3.3.3
|
bgp router-id 3.3.3.3
|
||||||
bgp cluster-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 remote-as 5226
|
||||||
neighbor 2.2.2.2 update-source 3.3.3.3
|
neighbor 2.2.2.2 update-source 3.3.3.3
|
||||||
!
|
|
||||||
address-family ipv4 unicast
|
address-family ipv4 unicast
|
||||||
no neighbor 2.2.2.2 activate
|
no neighbor 2.2.2.2 activate
|
||||||
exit-address-family
|
exit-address-family
|
||||||
!
|
|
||||||
address-family ipv4 vpn
|
address-family ipv4 vpn
|
||||||
neighbor 2.2.2.2 activate
|
neighbor 2.2.2.2 activate
|
||||||
exit-address-family
|
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
|
router bgp 5227 vrf r3-cust1
|
||||||
|
|
||||||
bgp router-id 192.168.1.1
|
bgp router-id 192.168.1.1
|
||||||
|
|
||||||
neighbor 192.168.1.2 remote-as 5227
|
neighbor 192.168.1.2 remote-as 5227
|
||||||
neighbor 192.168.1.2 update-source 192.168.1.1
|
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
|
address-family ipv4 unicast
|
||||||
# redistribute vnc-direct
|
|
||||||
neighbor 192.168.1.2 activate
|
neighbor 192.168.1.2 activate
|
||||||
neighbor 192.168.1.2 next-hop-self
|
neighbor 192.168.1.2 next-hop-self
|
||||||
|
|
||||||
|
redistribute vpn
|
||||||
|
export vpn
|
||||||
exit-address-family
|
exit-address-family
|
||||||
!
|
|
||||||
end
|
|
||||||
|
end
|
||||||
|
@ -5,6 +5,9 @@ password zebra
|
|||||||
log stdout notifications
|
log stdout notifications
|
||||||
log monitor notifications
|
log monitor notifications
|
||||||
log commands
|
log commands
|
||||||
|
|
||||||
|
debug bgp vpn label
|
||||||
|
|
||||||
router bgp 5226
|
router bgp 5226
|
||||||
bgp router-id 4.4.4.4
|
bgp router-id 4.4.4.4
|
||||||
bgp cluster-id 4.4.4.4
|
bgp cluster-id 4.4.4.4
|
||||||
@ -14,9 +17,13 @@ router bgp 5226
|
|||||||
address-family ipv4 unicast
|
address-family ipv4 unicast
|
||||||
no neighbor 2.2.2.2 activate
|
no neighbor 2.2.2.2 activate
|
||||||
exit-address-family
|
exit-address-family
|
||||||
|
|
||||||
address-family ipv4 vpn
|
address-family ipv4 vpn
|
||||||
neighbor 2.2.2.2 activate
|
neighbor 2.2.2.2 activate
|
||||||
exit-address-family
|
exit-address-family
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
!
|
!
|
||||||
#wait for new syntax
|
#wait for new syntax
|
||||||
# vrf-policy r4-cust1
|
# vrf-policy r4-cust1
|
||||||
@ -33,32 +40,51 @@ router bgp 5226
|
|||||||
# rt both 52:100
|
# rt both 52:100
|
||||||
#! nexthop 192.168.2.1
|
#! nexthop 192.168.2.1
|
||||||
# exit-vrf-policy
|
# 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
|
router bgp 5227 vrf r4-cust1
|
||||||
|
|
||||||
bgp router-id 192.168.1.1
|
bgp router-id 192.168.1.1
|
||||||
|
|
||||||
neighbor 192.168.1.2 remote-as 5227
|
neighbor 192.168.1.2 remote-as 5227
|
||||||
neighbor 192.168.1.2 update-source 192.168.1.1
|
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
|
address-family ipv4 unicast
|
||||||
# redistribute vnc-direct
|
|
||||||
neighbor 192.168.1.2 activate
|
neighbor 192.168.1.2 activate
|
||||||
neighbor 192.168.1.2 next-hop-self
|
neighbor 192.168.1.2 next-hop-self
|
||||||
|
|
||||||
|
redistribute vpn
|
||||||
|
export vpn
|
||||||
exit-address-family
|
exit-address-family
|
||||||
!
|
!
|
||||||
router bgp 5228 vrf r4-cust2
|
router bgp 5228 vrf r4-cust2
|
||||||
|
|
||||||
bgp router-id 192.168.2.1
|
bgp router-id 192.168.2.1
|
||||||
|
|
||||||
neighbor 192.168.2.2 remote-as 5228
|
neighbor 192.168.2.2 remote-as 5228
|
||||||
neighbor 192.168.2.2 update-source 192.168.2.1
|
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
|
address-family ipv4 unicast
|
||||||
# redistribute vnc-direct
|
|
||||||
neighbor 192.168.2.2 activate
|
neighbor 192.168.2.2 activate
|
||||||
neighbor 192.168.2.2 next-hop-self
|
neighbor 192.168.2.2 next-hop-self
|
||||||
|
|
||||||
|
redistribute vpn
|
||||||
|
export vpn
|
||||||
exit-address-family
|
exit-address-family
|
||||||
!
|
!
|
||||||
end
|
end
|
||||||
|
@ -14,10 +14,14 @@ if ret != False and found != None:
|
|||||||
luCommand('ce1','ip route add default via 192.168.1.1')
|
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('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('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('r1','ip -M route add 101 dev r1-cust1')
|
||||||
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('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('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('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('r1','ip -M route show','101','MPLS->VRF route installed')
|
||||||
|
@ -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('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('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('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')
|
# Core VPN routes
|
||||||
luCommand('r3','vtysh -c "show bgp ipv4 vpn"','No BGP prefixes displayed','pass','Core VPN SAFI clean')
|
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('r4','vtysh -c "show bgp ipv4 vpn"','No BGP prefixes displayed','pass','Core VPN SAFI clean')
|
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')
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ def test_check_linux_mpls():
|
|||||||
#CliOnFail = 'tgen.mininet_cli'
|
#CliOnFail = 'tgen.mininet_cli'
|
||||||
CheckFunc = 'ltemplateVersionCheck(\'3.1\', iproute2=\'4.9\')'
|
CheckFunc = 'ltemplateVersionCheck(\'3.1\', iproute2=\'4.9\')'
|
||||||
#uncomment next line to start cli *before* script is run
|
#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)
|
ltemplateTest('scripts/check_linux_mpls.py', False, CliOnFail, CheckFunc)
|
||||||
|
|
||||||
def SKIP_test_cleanup_all():
|
def SKIP_test_cleanup_all():
|
||||||
|
Loading…
Reference in New Issue
Block a user