Skip to content

Commit

Permalink
topotests: bgp_bmp, add test for import-vrf-view service
Browse files Browse the repository at this point in the history
Add a test with a new peer defined in a VRF, and where
the BGP updates are imported in the BMP instance of the
default BGP instance.

Signed-off-by: Philippe Guibert <[email protected]>
  • Loading branch information
pguibert6WIND committed Jan 7, 2025
1 parent 5fda10f commit f52e963
Show file tree
Hide file tree
Showing 15 changed files with 682 additions and 0 deletions.
34 changes: 34 additions & 0 deletions tests/topotests/bgp_bmp/bmp1import/bmp-update-loc-rib-step1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"loc-rib": {
"update": {
"172.31.0.77/32": {
"as_path": "",
"bgp_nexthop": "192.168.1.3",
"bmp_log_type": "update",
"ip_prefix": "172.31.0.77/32",
"is_filtered": false,
"origin": "IGP",
"peer_asn": 65501,
"peer_bgp_id": "192.168.0.1",
"peer_distinguisher": "444:1",
"peer_type": "loc-rib instance",
"policy": "loc-rib"
},
"2001::1125/128": {
"afi": 2,
"as_path": "",
"bmp_log_type": "update",
"ip_prefix": "2001::1125/128",
"is_filtered": false,
"nxhp_ip": "192:167::3",
"origin": "IGP",
"peer_asn": 65501,
"peer_bgp_id": "192.168.0.1",
"peer_distinguisher": "555:1",
"peer_type": "loc-rib instance",
"policy": "loc-rib",
"safi": 1
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"post-policy": {
"update": {
"172.31.0.77/32": {
"as_path": "",
"bgp_nexthop": "192.168.1.3",
"bmp_log_type": "update",
"ip_prefix": "172.31.0.77/32",
"ipv6": false,
"origin": "IGP",
"peer_asn": 65501,
"peer_bgp_id": "192.168.1.3",
"peer_distinguisher": "444:1",
"peer_ip": "192.168.1.3",
"peer_type": "route distinguisher instance",
"policy": "post-policy"
},
"2001::1125/128": {
"afi": 2,
"as_path": "",
"bmp_log_type": "update",
"ip_prefix": "2001::1125/128",
"ipv6": true,
"nxhp_ip": "192:167::3",
"origin": "IGP",
"peer_asn": 65501,
"peer_bgp_id": "192.168.1.3",
"peer_distinguisher": "555:1",
"peer_ip": "192:167::3",
"peer_type": "route distinguisher instance",
"policy": "post-policy",
"safi": 1
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"pre-policy": {
"update": {
"172.31.0.77/32": {
"as_path": "",
"bgp_nexthop": "192.168.1.3",
"bmp_log_type": "update",
"ip_prefix": "172.31.0.77/32",
"ipv6": false,
"origin": "IGP",
"peer_asn": 65501,
"peer_bgp_id": "192.168.1.3",
"peer_distinguisher": "444:1",
"peer_ip": "192.168.1.3",
"peer_type": "route distinguisher instance",
"policy": "pre-policy"
},
"2001::1125/128": {
"afi": 2,
"as_path": "",
"bmp_log_type": "update",
"ip_prefix": "2001::1125/128",
"ipv6": true,
"nxhp_ip": "192:167::3",
"origin": "IGP",
"peer_asn": 65501,
"peer_bgp_id": "192.168.1.3",
"peer_distinguisher": "555:1",
"peer_ip": "192:167::3",
"peer_type": "route distinguisher instance",
"policy": "pre-policy",
"safi": 1
}
}
}
}
28 changes: 28 additions & 0 deletions tests/topotests/bgp_bmp/bmp1import/bmp-withdraw-loc-rib-step1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"loc-rib": {
"withdraw": {
"172.31.0.77/32": {
"bmp_log_type": "withdraw",
"ip_prefix": "172.31.0.77/32",
"is_filtered": false,
"peer_asn": 65501,
"peer_bgp_id": "192.168.0.1",
"peer_distinguisher": "444:1",
"peer_type": "loc-rib instance",
"policy": "loc-rib"
},
"2001::1125/128": {
"afi": 2,
"bmp_log_type": "withdraw",
"ip_prefix": "2001::1125/128",
"is_filtered": false,
"peer_asn": 65501,
"peer_bgp_id": "192.168.0.1",
"peer_distinguisher": "555:1",
"peer_type": "loc-rib instance",
"policy": "loc-rib",
"safi": 1
}
}
}
}
34 changes: 34 additions & 0 deletions tests/topotests/bgp_bmp/bmp1import/bmp-withdraw-loc-rib-step2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"loc-rib": {
"withdraw": {
"172.31.0.15/32": {
"afi": 1,
"bmp_log_type": "withdraw",
"ip_prefix": "172.31.0.15/32",
"is_filtered": false,
"label": 0,
"peer_asn": 65501,
"peer_bgp_id": "192.168.0.1",
"peer_distinguisher": "0:0",
"peer_type": "loc-rib instance",
"policy": "loc-rib",
"rd": "444:2",
"safi": 128
},
"2001::1111/128": {
"afi": 2,
"bmp_log_type": "withdraw",
"ip_prefix": "2001::1111/128",
"is_filtered": false,
"label": 0,
"peer_asn": 65501,
"peer_bgp_id": "192.168.0.1",
"peer_distinguisher": "0:0",
"peer_type": "loc-rib instance",
"policy": "loc-rib",
"rd": "555:2",
"safi": 128
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"post-policy": {
"withdraw": {
"172.31.0.77/32": {
"bmp_log_type": "withdraw",
"ip_prefix": "172.31.0.77/32",
"ipv6": false,
"peer_asn": 65501,
"peer_bgp_id": "192.168.1.3",
"peer_distinguisher": "444:1",
"peer_ip": "192.168.1.3",
"peer_type": "route distinguisher instance",
"policy": "post-policy"
},
"2001::1125/128": {
"afi": 2,
"bmp_log_type": "withdraw",
"ip_prefix": "2001::1125/128",
"ipv6": true,
"peer_asn": 65501,
"peer_bgp_id": "192.168.1.3",
"peer_distinguisher": "555:1",
"peer_ip": "192:167::3",
"peer_type": "route distinguisher instance",
"policy": "post-policy",
"safi": 1
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"post-policy": {
"withdraw": {
"2001::1111/128": {
"afi": 2,
"bmp_log_type": "withdraw",
"ip_prefix": "2001::1111/128",
"ipv6": true,
"label": 0,
"peer_asn": 65502,
"peer_bgp_id": "192.168.0.2",
"peer_distinguisher": "0:0",
"peer_ip": "192:168::2",
"peer_type": "global instance",
"policy": "post-policy",
"rd": "555:2",
"safi": 128
},
"172.31.0.15/32": {
"afi": 1,
"bmp_log_type": "withdraw",
"ip_prefix": "172.31.0.15/32",
"ipv6": false,
"label": 0,
"peer_asn": 65502,
"peer_bgp_id": "192.168.0.2",
"peer_distinguisher": "0:0",
"peer_ip": "192.168.0.2",
"peer_type": "global instance",
"policy": "post-policy",
"rd": "444:2",
"safi": 128
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"pre-policy": {
"withdraw": {
"172.31.0.77/32": {
"bmp_log_type": "withdraw",
"ip_prefix": "172.31.0.77/32",
"ipv6": false,
"peer_asn": 65501,
"peer_bgp_id": "192.168.1.3",
"peer_distinguisher": "444:1",
"peer_ip": "192.168.1.3",
"peer_type": "route distinguisher instance",
"policy": "pre-policy"
},
"2001::1125/128": {
"afi": 2,
"bmp_log_type": "withdraw",
"ip_prefix": "2001::1125/128",
"ipv6": true,
"peer_asn": 65501,
"peer_bgp_id": "192.168.1.3",
"peer_distinguisher": "555:1",
"peer_ip": "192:167::3",
"peer_type": "route distinguisher instance",
"policy": "pre-policy",
"safi": 1
}
}
}
}
73 changes: 73 additions & 0 deletions tests/topotests/bgp_bmp/r1import/frr.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
interface r1import-eth0
ip address 192.0.2.1/24
!
interface r1import-eth1
ip address 192.168.0.1/24
ipv6 address 192:168::1/64
!
interface r1import-eth2
ip address 192.168.1.1/24
ipv6 address 192:167::1/64
!
router bgp 65501
bgp router-id 192.168.0.1
bgp log-neighbor-changes
no bgp ebgp-requires-policy
neighbor 192.168.0.2 remote-as 65502
neighbor 192:168::2 remote-as 65502
!
bmp targets bmp1
bmp connect 192.0.2.10 port 1789 min-retry 100 max-retry 10000
bmp monitor ipv4 unicast pre-policy
bmp monitor ipv6 unicast pre-policy
bmp monitor ipv4 unicast post-policy
bmp monitor ipv6 unicast post-policy
bmp monitor ipv4 unicast loc-rib
bmp monitor ipv6 unicast loc-rib
bmp import-vrf-view vrf1
exit
!
address-family ipv4 vpn
neighbor 192.168.0.2 activate
neighbor 192.168.0.2 soft-reconfiguration inbound
exit-address-family
address-family ipv6 vpn
neighbor 192:168::2 activate
neighbor 192:168::2 soft-reconfiguration inbound
exit-address-family
address-family ipv4 unicast
neighbor 192.168.0.2 activate
neighbor 192.168.0.2 soft-reconfiguration inbound
no neighbor 192:168::2 activate
exit-address-family
!
address-family ipv6 unicast
neighbor 192:168::2 activate
neighbor 192:168::2 soft-reconfiguration inbound
exit-address-family
!
router bgp 65501 vrf vrf1
bgp router-id 192.168.0.1
bgp log-neighbor-changes
neighbor 192.168.1.3 remote-as 65501
neighbor 192:167::3 remote-as 65501
address-family ipv4 unicast
neighbor 192.168.1.3 activate
neighbor 192.168.1.3 soft-reconfiguration inbound
no neighbor 192:167::3 activate
label vpn export 101
rd vpn export 444:1
rt vpn both 52:100
export vpn
import vpn
exit-address-family
address-family ipv6 unicast
neighbor 192:167::3 activate
neighbor 192:167::3 soft-reconfiguration inbound
label vpn export 103
rd vpn export 555:1
rt vpn both 54:200
export vpn
import vpn
exit-address-family
exit
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"routes": {
"172.31.0.77/32": [
{
"bestpath": true,
"pathFrom": "internal",
"path": "",
"origin": "IGP",
"nexthops": [
{
"ip": "192.168.1.3",
"hostname": "r3",
"afi": "ipv4",
"used": true
}
]
}
]
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"routes": {
"172.31.0.77/32": null
}
}

Loading

0 comments on commit f52e963

Please sign in to comment.