]>
git.puffer.fish Git - mirror/frr.git/commit
bgpd: Filter BGP routes by prefix version
The idea is to find out prefixes including specific BGP table version and
above.
Let's say I have a converged network and suddently I noticed a couple of
prefixes seems hijacked.
I want to look what new prefixes arrived with a specific BGP table version.
```
exit1-debian-9# show ip bgp version 8
BGP table version is 9, local router ID is 192.168.100.1, vrf id 0
Default local pref 100, local AS 65534
Status codes: s suppressed, d damped, h history, * valid, > best, = multipath,
i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
* 192.168.2.0/24 192.168.0.2 0 0 65030 ?
*> 192.168.0.2 0 0 65030 ?
* 192.168.3.0/24 192.168.0.2 0 0 65030 ?
*> 192.168.0.2 0 0 65030 ?
Displayed 2 routes and 18 total paths
exit1-debian-9#
```
```
exit1-debian-9# show ip bgp version 8 json
{
"vrfId": 0,
"vrfName": "default",
"tableVersion": 9,
"routerId": "192.168.100.1",
"defaultLocPrf": 100,
"localAS": 65534,
"routes": { "192.168.2.0/24": [
{
"valid":true,
"pathFrom":"external",
"prefix":"192.168.2.0",
"prefixLen":24,
"network":"192.168.2.0\/24",
"version":8,
"metric":0,
"weight":0,
"peerId":"2a02:bbd::2",
"path":"65030",
"origin":"incomplete",
"nexthops":[
{
"ip":"192.168.0.2",
"hostname":"home-spine1.donatas.net",
"afi":"ipv4",
"used":true
}
]
},
{
"valid":true,
"bestpath":true,
"selectionReason":"Neighbor IP",
"pathFrom":"external",
"prefix":"192.168.2.0",
"prefixLen":24,
"network":"192.168.2.0\/24",
"version":8,
"metric":0,
"weight":0,
"peerId":"192.168.0.2",
"path":"65030",
"origin":"incomplete",
"nexthops":[
{
"ip":"192.168.0.2",
"hostname":"home-spine1.donatas.net",
"afi":"ipv4",
"used":true
}
]
}
],"192.168.3.0/24": [
{
"valid":true,
"pathFrom":"external",
"prefix":"192.168.3.0",
"prefixLen":24,
"network":"192.168.3.0\/24",
"version":9,
"metric":0,
"weight":0,
"peerId":"2a02:bbd::2",
"path":"65030",
"origin":"incomplete",
"nexthops":[
{
"ip":"192.168.0.2",
"hostname":"home-spine1.donatas.net",
"afi":"ipv4",
"used":true
}
]
},
{
"valid":true,
"bestpath":true,
"selectionReason":"Neighbor IP",
"pathFrom":"external",
"prefix":"192.168.3.0",
"prefixLen":24,
"network":"192.168.3.0\/24",
"version":9,
"metric":0,
"weight":0,
"peerId":"192.168.0.2",
"path":"65030",
"origin":"incomplete",
"nexthops":[
{
"ip":"192.168.0.2",
"hostname":"home-spine1.donatas.net",
"afi":"ipv4",
"used":true
}
]
}
] } }
```
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>