Skip to content

Commit

Permalink
topotest:add topotest for srv6 te policy
Browse files Browse the repository at this point in the history
Signed-off-by: guozhongfeng.gzf <[email protected]>
  • Loading branch information
guoguojia2021 committed Dec 7, 2024
1 parent 5195792 commit 1bfeed7
Show file tree
Hide file tree
Showing 29 changed files with 562 additions and 372 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ log file bgpd.log
router bgp 3
bgp router-id 1.1.1.1
no bgp ebgp-requires-policy
!no bgp default ipv4-unicast
no bgp default ipv4-unicast
neighbor 2001:1::1 remote-as 1
neighbor 2001:1::1 timers 3 10
neighbor 2001:1::1 timers connect 1
neighbor 2002:1::1 remote-as 2
neighbor 2002:1::1 timers 3 10
neighbor 2002:1::1 timers connect 1
neighbor 2002:1::2 remote-as 2
neighbor 2002:1::2 timers 3 10
neighbor 2002:1::2 timers connect 1
!
address-family ipv6 unicast
neighbor 2001:1::1 activate
neighbor 2002:1::1 activate
neighbor 2002:1::2 activate
exit-address-family
!
!
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ log file bgpd.log
router bgp 4
bgp router-id 1.1.1.1
no bgp ebgp-requires-policy
!no bgp default ipv4-unicast
no bgp default ipv4-unicast
neighbor 2001:2::1 remote-as 1
neighbor 2001:2::1 timers 3 10
neighbor 2001:2::1 timers connect 1
Expand All @@ -20,7 +20,7 @@ router bgp 4
!
address-family ipv6 unicast
neighbor 2001:2::1 activate
neighbor 2002:1::1 activate
neighbor 2002:2::2 activate
exit-address-family
!
!
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ route-map color_v6 permit 10
router bgp 1
bgp router-id 1.1.1.1
no bgp ebgp-requires-policy
!no bgp default ipv4-unicast
no bgp default ipv4-unicast
neighbor 2001:1::2 remote-as 3
neighbor 2001:1::2 timers 3 10
neighbor 2001:1::2 timers connect 1
Expand All @@ -38,6 +38,7 @@ router bgp 1
neighbor 2000::1 timers 3 10
neighbor 2000::1 timers connect 1
neighbor 2000::1 ebgp-multihop
neighbor 2000::1 update-source 1000::1
neighbor 2000::1 capability extended-nexthop
!
address-family ipv4 vpn
Expand Down
4 changes: 4 additions & 0 deletions tests/topotests/bgp_srv6l3vpn__te_policy/pe1/pathd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
log file pathd.log
!
hostname pe1
!
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,23 @@ route-map color permit 10
router bgp 2
bgp router-id 1.1.1.1
no bgp ebgp-requires-policy
!no bgp default ipv4-unicast
neighbor 2002:1::2 remote-as 3
neighbor 2002:1::2 timers 3 10
neighbor 2002:1::2 timers connect 1
no bgp default ipv4-unicast
neighbor 2002:1::1 remote-as 3
neighbor 2002:1::1 timers 3 10
neighbor 2002:1::1 timers connect 1
neighbor 2002:2::1 remote-as 4
neighbor 2002:2::1 timers 3 10
neighbor 2002:2::1 timers connect 1
neighbor 1000::1 remote-as 1
neighbor 1000::1 timers 3 10
neighbor 1000::1 timers connect 1
neighbor 1000::1 ebgp-multihop
neighbor 1000::1 update-source 2000::1
neighbor 1000::1 capability extended-nexthop
!
address-family ipv4 vpn
neighbor 2000::1 activate
neighbor 2000::1 route-map color out
neighbor 1000::1 activate
neighbor 1000::1 route-map color out
exit-address-family
!
address-family ipv6 vpn
Expand All @@ -51,8 +52,8 @@ router bgp 2
!
address-family ipv6 unicast
network 2000::1/64
neighbor 1000::1 activate
neighbor 1000::1 activate
neighbor 2002:1::1 activate
neighbor 2002:2::1 activate
exit-address-family

segment-routing srv6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ hostname pe1
!
segment-routing
traffic-eng
segment-list a
segment-list default
index 10 ipv6-address 2001:db8:4:4::
index 20 ipv6-address 2001:db8:1:1::
segment-list test
index 10 ipv6-address 2001:db8:3:3::
index 20 ipv6-address 2001:db8:1:1::
!
!
63 changes: 63 additions & 0 deletions tests/topotests/bgp_srv6l3vpn__te_policy/pe2/vpnv4_rib_route.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"vrfId": 0,
"vrfName": "default",
"routerId": "1.1.1.1",
"defaultLocPrf": 100,
"localAS": 2,
"routes": {
"routeDistinguishers": {
"1:10": {
"192.168.1.0/24": [
{
"valid": true,
"bestpath": true,
"selectionReason": "First path received",
"pathFrom": "external",
"prefix": "192.168.1.0",
"prefixLen": 24,
"network": "192.168.1.0/24",
"metric": 0,
"weight": 0,
"peerId": "1000::1",
"path": "1",
"origin": "incomplete",
"nexthops": [
{
"ip": "1000::1",
"hostname": "pe1",
"afi": "ipv6",
"used": true
}
]
}
]
},
"1:20": {
"192.168.2.0/24": [
{
"valid": true,
"bestpath": true,
"selectionReason": "First path received",
"pathFrom": "external",
"prefix": "192.168.2.0",
"prefixLen": 24,
"network": "192.168.2.0/24",
"metric": 0,
"weight": 0,
"peerId": "1000::1",
"path": "1",
"origin": "incomplete",
"nexthops": [
{
"ip": "1000::1",
"hostname": "pe1",
"afi": "ipv6",
"used": true
}
]
}
]
}
}
}
}
63 changes: 63 additions & 0 deletions tests/topotests/bgp_srv6l3vpn__te_policy/pe2/vpnv6_rib_route.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"vrfId": 0,
"vrfName": "default",
"routerId": "1.1.1.1",
"defaultLocPrf": 100,
"localAS": 2,
"routes": {
"routeDistinguishers": {
"1:10": {
"1001:1::/64": [
{
"valid": true,
"bestpath": true,
"selectionReason": "First path received",
"pathFrom": "external",
"prefix": "1001:1::",
"prefixLen": 64,
"network": "1001:1::/64",
"metric": 0,
"weight": 0,
"peerId": "1000::1",
"path": "1",
"origin": "incomplete",
"nexthops": [
{
"ip": "1000::1",
"hostname": "pe1",
"afi": "ipv6",
"used": true
}
]
}
]
},
"1:20": {
"1001:2::/64": [
{
"valid": true,
"bestpath": true,
"selectionReason": "First path received",
"pathFrom": "external",
"prefix": "1001:2::",
"prefixLen": 64,
"network": "1001:2::/64",
"metric": 0,
"weight": 0,
"peerId": "1000::1",
"path": "1",
"origin": "incomplete",
"nexthops": [
{
"ip": "1000::1",
"hostname": "pe1",
"afi": "ipv6",
"used": true
}
]
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
"192.168.11.0/24":[
{
"prefix":"192.168.11.0/24",
"prefixLen":24,
"protocol":"bgp",
"vrfId":5,
"vrfName":"Vrf1",
"selected":true,
"destSelected":true,
"distance":20,
"metric":0,
"installed":true,
"table":1,
"internalStatus":16,
"internalFlags":9,
"internalNextHopNum":3,
"internalNextHopActiveNum":3,
"nexthopGroupId":81,
"installedNexthopGroupId":82,
"uptime":"00:00:27",
"nexthops":[
{
"flags":3205,
"ip":"1::1",
"afi":"ipv6",
"vrf":"default",
"active":true,
"recursive":true,
"labels":[
16
],
"weight":1,
"srteColor":100,
"seg6local":{
"action":"unspec"
},
"seg6localContext":{
"unknown":true
},
"seg6":{
"segs":"100:1::100"
}
},
{
"flags":2051,
"fib":true,
"ip":"fe80::a8c1:abff:fe3b:8afa",
"afi":"ipv6",
"interfaceIndex":1377,
"interfaceName":"eth4",
"resolver":true,
"vrf":"default",
"active":true,
"labels":[
16
],
"weight":1,
"seg6local":{
"action":"unspec"
},
"seg6localContext":{
"unknown":true
},
"seg6":{
"segs":"100:1::100"
}
},
{
"flags":2051,
"fib":true,
"ip":"fe80::a8c1:abff:fe4c:b77e",
"afi":"ipv6",
"interfaceIndex":1369,
"interfaceName":"eth3",
"resolver":true,
"vrf":"default",
"active":true,
"labels":[
16
],
"weight":1,
"seg6local":{
"action":"unspec"
},
"seg6localContext":{
"unknown":true
},
"seg6":{
"segs":"100:1::100"
}
}
]
}
]
}
Loading

0 comments on commit 1bfeed7

Please sign in to comment.