Skip to content

Commit

Permalink
topotests: mpls vpn routes redistribution
Browse files Browse the repository at this point in the history
Test mpls vpn routes redistribution

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
  • Loading branch information
pguibert6WIND authored and louis-6wind committed May 16, 2024
1 parent db1e2a0 commit c6cfa9b
Show file tree
Hide file tree
Showing 15 changed files with 400 additions and 0 deletions.
Empty file.
7 changes: 7 additions & 0 deletions tests/topotests/bgp_vpnv4_asbr_sr/h1/zebra.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
log stdout
ip route 172.31.1.0/24 172.31.0.1
ip route 172.31.2.0/24 172.31.0.1
interface h1-eth0
ip address 172.31.0.10/24
!

5 changes: 5 additions & 0 deletions tests/topotests/bgp_vpnv4_asbr_sr/h2/zebra.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
log stdout
ip route 172.31.0.0/24 172.31.1.1
interface h2-eth0
ip address 172.31.1.10/24
!
6 changes: 6 additions & 0 deletions tests/topotests/bgp_vpnv4_asbr_sr/h3/zebra.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
log stdout
ip route 172.31.0.0/24 172.31.2.1
interface h3-eth0
ip address 172.31.2.10/24
!

49 changes: 49 additions & 0 deletions tests/topotests/bgp_vpnv4_asbr_sr/r1/bgp_ipv4_routes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"vrfName": "vrf1",
"localAS": 65500,
"routes":
{
"172.31.0.10/32": [
{
"prefix": "172.31.0.10",
"prefixLen": 32,
"network": "172.31.0.10\/32",
"nhVrfName": "default",
"nexthops": [
{
"ip": "192.168.0.3",
"afi": "ipv4",
"used": true
}
]
},
{
"prefix": "172.31.0.10",
"prefixLen": 32,
"network": "172.31.0.10\/32",
"nhVrfName": "default",
"nexthops": [
{
"ip": "192.168.0.2",
"afi": "ipv4",
"used": true
}
]
}
],
"172.31.0.1/32": [
{
"prefix": "172.31.0.1",
"prefixLen": 32,
"network": "172.31.0.1\/32",
"nexthops": [
{
"ip": "0.0.0.0",
"afi": "ipv4",
"used": true
}
]
}
]
}
}
23 changes: 23 additions & 0 deletions tests/topotests/bgp_vpnv4_asbr_sr/r1/bgpd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
router bgp 65500
bgp router-id 192.0.2.1
no bgp ebgp-requires-policy
neighbor 192.0.2.2 remote-as 65500
neighbor 192.0.2.2 update-source lo
address-family ipv4 unicast
no neighbor 192.0.2.2 activate
exit-address-family
address-family ipv4 vpn
neighbor 192.0.2.2 activate
exit-address-family
!
router bgp 65500 vrf vrf1
bgp router-id 192.0.2.1
address-family ipv4 unicast
redistribute connected
label vpn export 101
rd vpn export 444:1
rt vpn both 52:100
export vpn
import vpn
exit-address-family
!
18 changes: 18 additions & 0 deletions tests/topotests/bgp_vpnv4_asbr_sr/r1/isisd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
interface lo
ip router isis 1
isis passive
!
interface r1-eth0
ip router isis 1
isis hello-multiplier 3
!
router isis 1
lsp-gen-interval 2
net 49.0000.0000.0000.0001.00
is-type level-1
redistribute ipv4 connected level-1
segment-routing on
segment-routing global-block 16000 23999
segment-routing node-msd 8
segment-routing prefix 192.0.2.1/32 index 10 explicit-null
!
10 changes: 10 additions & 0 deletions tests/topotests/bgp_vpnv4_asbr_sr/r1/zebra.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
log stdout
interface lo
ip address 192.0.2.1/32
!
interface r1-eth1 vrf vrf1
ip address 172.31.0.1/24
!
interface r1-eth0
ip address 192.168.0.1/24
!
21 changes: 21 additions & 0 deletions tests/topotests/bgp_vpnv4_asbr_sr/r2/bgpd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
debug bgp nht
debug bgp zebra
debug bgp labelpool
router bgp 65500
bgp router-id 192.0.2.2
no bgp ebgp-requires-policy
neighbor 192.0.2.1 remote-as 65500
neighbor 192.0.2.1 update-source lo
neighbor 192.168.1.3 remote-as 65501
address-family ipv4 unicast
no neighbor 192.168.1.3 activate
exit-address-family
address-family ipv4 vpn
neighbor 192.0.2.1 activate
neighbor 192.168.1.3 activate
neighbor 192.0.2.1 next-hop-self
exit-address-family
!
interface r2-eth1
mpls bgp forwarding
!
28 changes: 28 additions & 0 deletions tests/topotests/bgp_vpnv4_asbr_sr/r2/ipv4_vpn_summary.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"routerId":"192.0.2.2",
"as":65500,
"vrfId":0,
"vrfName":"default",
"peerCount":2,
"peers":{
"192.0.2.1":{
"remoteAs":65500,
"localAs":65500,
"version":4,
"pfxRcd":1,
"pfxSnt":3,
"state":"Established",
"peerState":"OK"
},
"192.168.1.3":{
"remoteAs":65501,
"localAs":65500,
"version":4,
"pfxRcd":3,
"pfxSnt":4,
"state":"Established",
"peerState":"OK"
}
},
"totalPeers":2
}
18 changes: 18 additions & 0 deletions tests/topotests/bgp_vpnv4_asbr_sr/r2/isisd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
interface lo
ip router isis 1
isis passive
!
interface r2-eth0
ip router isis 1
isis hello-multiplier 3
!
router isis 1
lsp-gen-interval 2
net 49.0000.0000.0000.0002.00
is-type level-1
redistribute ipv4 connected level-1
segment-routing on
segment-routing global-block 16000 23999
segment-routing node-msd 8
segment-routing prefix 192.0.2.2/32 index 20 explicit-null
!
12 changes: 12 additions & 0 deletions tests/topotests/bgp_vpnv4_asbr_sr/r2/zebra.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
log stdout
interface lo
ip address 192.0.2.2/32
!
interface r2-eth0
ip address 192.168.0.2/24
mpls enable
!
interface r2-eth1
ip address 192.168.1.2/24
mpls enable
!
26 changes: 26 additions & 0 deletions tests/topotests/bgp_vpnv4_asbr_sr/r3/bgpd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
router bgp 65501
bgp router-id 192.0.2.3
no bgp ebgp-requires-policy
neighbor 192.168.1.2 remote-as 65500
address-family ipv4 unicast
no neighbor 192.168.1.2 activate
exit-address-family
address-family ipv4 vpn
neighbor 192.168.1.2 activate
exit-address-family
!
router bgp 65501 vrf vrf1
bgp router-id 192.0.2.3
address-family ipv4 unicast
redistribute connected
label vpn export 102
rd vpn export 444:3
rt vpn both 52:100
export vpn
import vpn
network 172.31.3.0/24
exit-address-family
!
interface r3-eth0
mpls bgp forwarding
!
14 changes: 14 additions & 0 deletions tests/topotests/bgp_vpnv4_asbr_sr/r3/zebra.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
log stdout
ip route 192.168.1.3/32 r3-eth0
vrf vrf1
ip route 172.31.3.0/24 172.31.2.10
exit-vrf
interface r3-eth1 vrf vrf1
ip address 172.31.1.1/24
!
interface r3-eth2 vrf vrf1
ip address 172.31.2.1/24
!
interface r3-eth0
ip address 192.168.1.3/24
!
Loading

0 comments on commit c6cfa9b

Please sign in to comment.