Madhuri Kuruganti
96f3485cdb
bgpd: show < ip > bgp < ipv4 | ipv6 > all
...
This commit
=> provides "all" option, to display the table entries for all(or specific) AFI/SAFIs.
=> Also introduced "show_flags" to avoid passing multiple arguments(use_json, wide, all)
to functions
1. show <ip> bgp <ipv4/ipv6> <all> <wide|json>
2. show <ip> bgp <ipv4/ipv6> <all> summary <json>
3. show <ip> bgp <ipv4/ipv6> <all> cidr-only <wide|json>
4. show <ip> bgp <ipv4/ipv6> <all> community <wide|json>
5. show <ip> bgp <ipv4/ipv6> <all> dampening <dampened-paths|flap-statistics|parameters> <wide|json>
6. show <ip> bgp <ipv4/ipv6> <all> neighbors A.B.C.D advertised-routes|filtered-routes|received-routes <wide|json>
show bgp all summary == show ip bgp all summary => output is same => display entries for all AFIs and for each SAFI.
show bgp ipv4 all summary == show ip bgp ipv4 all summary => output is same => display entries for each SAFI in AFI_IP
show bgp ipv6 all summary == show ip bgp ipv6 all summart => output is same => display entries for each SAFI in AFI_IP6
similarly for all other commands.
sample output
1. show <ip> bgp <ipv4/ipv6> <all> <wide|json>
router# show ip bgp all wide
For address family: IPv4 Unicast
BGP table version is 6, local router ID is 1.1.1.1, vrf id 0
Default local pref 100, local AS 1
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
*> 1.1.1.1/32 0.0.0.0 0 32768 ?
*>i2.2.2.2/32 192.168.56.152 0 100 0 ?
* i10.0.2.0/24 192.168.56.152 0 100 0 ?
*> 0.0.0.0 0 32768 ?
* i192.168.56.0/24 192.168.56.152 0 100 0 ?
*> 0.0.0.0 0 32768 ?
*>i192.168.123.245/32 192.168.56.152 0 100 0 ?
*>i192.168.223.245/32 192.168.56.152 0 100 0 ?
Displayed 6 routes and 8 total paths
For address family: IPv6 Unicast
BGP table version is 3, local router ID is 1.1.1.1, vrf id 0
Default local pref 100, local AS 1
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
*> 2001:db8::1/128 :: 0 32768 ?
*>i2001:db8::2/128 fe80::a00:27ff:fefc:2aa 0 100 0 ?
*> 2001:db8:85a3::8a2e:370:7334/128 :: 0 32768 ?
Displayed 3 routes and 3 total paths
router#
router# show ip bgp ipv4 all wide
For address family: IPv4 Unicast
BGP table version is 6, local router ID is 1.1.1.1, vrf id 0
Default local pref 100, local AS 1
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
*> 1.1.1.1/32 0.0.0.0 0 32768 ?
*>i2.2.2.2/32 192.168.56.152 0 100 0 ?
* i10.0.2.0/24 192.168.56.152 0 100 0 ?
*> 0.0.0.0 0 32768 ?
* i192.168.56.0/24 192.168.56.152 0 100 0 ?
*> 0.0.0.0 0 32768 ?
*>i192.168.123.245/32 192.168.56.152 0 100 0 ?
*>i192.168.223.245/32 192.168.56.152 0 100 0 ?
Displayed 6 routes and 8 total paths
router#
router#
router# show ip bgp ipv6 all wide
For address family: IPv6 Unicast
BGP table version is 3, local router ID is 1.1.1.1, vrf id 0
Default local pref 100, local AS 1
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
*> 2001:db8::1/128 :: 0 32768 ?
*>i2001:db8::2/128 fe80::a00:27ff:fefc:2aa 0 100 0 ?
*> 2001:db8:85a3::8a2e:370:7334/128 :: 0 32768 ?
Displayed 3 routes and 3 total paths
router#
router# show bgp all wide
For address family: IPv4 Unicast
BGP table version is 6, local router ID is 1.1.1.1, vrf id 0
Default local pref 100, local AS 1
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
*> 1.1.1.1/32 0.0.0.0 0 32768 ?
*>i2.2.2.2/32 192.168.56.152 0 100 0 ?
* i10.0.2.0/24 192.168.56.152 0 100 0 ?
*> 0.0.0.0 0 32768 ?
* i192.168.56.0/24 192.168.56.152 0 100 0 ?
*> 0.0.0.0 0 32768 ?
*>i192.168.123.245/32 192.168.56.152 0 100 0 ?
*>i192.168.223.245/32 192.168.56.152 0 100 0 ?
Displayed 6 routes and 8 total paths
For address family: IPv6 Unicast
BGP table version is 3, local router ID is 1.1.1.1, vrf id 0
Default local pref 100, local AS 1
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
*> 2001:db8::1/128 :: 0 32768 ?
*>i2001:db8::2/128 fe80::a00:27ff:fefc:2aa 0 100 0 ?
*> 2001:db8:85a3::8a2e:370:7334/128 :: 0 32768 ?
Displayed 3 routes and 3 total paths
router#
router#
router# show bgp ipv4 all wide
For address family: IPv4 Unicast
BGP table version is 6, local router ID is 1.1.1.1, vrf id 0
Default local pref 100, local AS 1
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
*> 1.1.1.1/32 0.0.0.0 0 32768 ?
*>i2.2.2.2/32 192.168.56.152 0 100 0 ?
* i10.0.2.0/24 192.168.56.152 0 100 0 ?
*> 0.0.0.0 0 32768 ?
* i192.168.56.0/24 192.168.56.152 0 100 0 ?
*> 0.0.0.0 0 32768 ?
*>i192.168.123.245/32 192.168.56.152 0 100 0 ?
*>i192.168.223.245/32 192.168.56.152 0 100 0 ?
Displayed 6 routes and 8 total paths
router#
router# show bgp ipv6 all wide
For address family: IPv6 Unicast
BGP table version is 3, local router ID is 1.1.1.1, vrf id 0
Default local pref 100, local AS 1
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
*> 2001:db8::1/128 :: 0 32768 ?
*>i2001:db8::2/128 fe80::a00:27ff:fefc:2aa 0 100 0 ?
*> 2001:db8:85a3::8a2e:370:7334/128 :: 0 32768 ?
Displayed 3 routes and 3 total paths
router#
Router1# show bgp all dampening parameters
For address family: IPv4 Unicast
Half-life time: 15 min
Reuse penalty: 750
Suppress penalty: 2000
Max suppress time: 60 min
Max suppress penalty: 12000
For address family: IPv4 Multicast
Half-life time: 20 min
Reuse penalty: 1000
Suppress penalty: 10000
Max suppress time: 40 min
Max suppress penalty: 4000
For address family: IPv4 VPN
dampening not enabled for IPv4 VPN
For address family: IPv4 Encap
dampening not enabled for IPv4 Encap
For address family: IPv4 Labeled Unicast
dampening not enabled for IPv4 Labeled Unicast
For address family: IPv4 Flowspec
dampening not enabled for IPv4 Flowspec
For address family: IPv6 Unicast
dampening not enabled for IPv6 Unicast
For address family: IPv6 Multicast
Half-life time: 10 min
Reuse penalty: 1500
Suppress penalty: 15000
Max suppress time: 20 min
Max suppress penalty: 6000
For address family: IPv6 VPN
dampening not enabled for IPv6 VPN
For address family: IPv6 Encap
dampening not enabled for IPv6 Encap
For address family: IPv6 Labeled Unicast
dampening not enabled for IPv6 Labeled Unicast
For address family: IPv6 Flowspec
dampening not enabled for IPv6 Flowspec
For address family: L2VPN EVPN
dampening not enabled for L2VPN EVPN
router#
bgpd: all option with json-c apis used
Replaced vty_out with json-c wrapper functions for all option
support to show <ip> bgp commands
Sample output:
Router2# show bgp all json
{
"ipv4Unicast":{
"vrfId": 0,
"vrfName": "default",
"tableVersion": 8,
"routerId": "128.16.16.1",
"defaultLocPrf": 100,
"localAS": 2,
"routes": { "128.16.16.0/24": [
{
"valid":true,
"bestpath":true,
"pathFrom":"external",
"prefix":"128.16.16.0",
"prefixLen":24,
"network":"128.16.16.0\/24",
"metric":0,
"weight":32768,
"peerId":"(unspec)",
"path":"",
"origin":"IGP",
"nexthops":[
{
"ip":"0.0.0.0",
"hostname":"router",
"afi":"ipv4",
"used":true
}
]
}
],"130.130.0.0/16": [
{
"valid":true,
"bestpath":true,
"pathFrom":"external",
"prefix":"130.130.0.0",
"prefixLen":16,
"network":"130.130.0.0\/16",
"metric":0,
"weight":32768,
"peerId":"(unspec)",
"path":"",
"origin":"IGP",
"nexthops":[
{
"ip":"0.0.0.0",
"hostname":"router",
"afi":"ipv4",
"used":true
}
]
}
],"192.168.50.0/24": [
{
"valid":true,
"bestpath":true,
"pathFrom":"external",
"prefix":"192.168.50.0",
"prefixLen":24,
"network":"192.168.50.0\/24",
"metric":0,
"weight":0,
"peerId":"10.10.20.3",
"path":"3",
"origin":"IGP",
"nexthops":[
{
"ip":"10.10.20.3",
"hostname":"router",
"afi":"ipv4",
"used":true
}
]
}
],"200.200.200.0/24": [
{
"valid":true,
"bestpath":true,
"pathFrom":"external",
"prefix":"200.200.200.0",
"prefixLen":24,
"network":"200.200.200.0\/24",
"metric":0,
"weight":0,
"peerId":"10.10.10.1",
"path":"1",
"origin":"IGP",
"nexthops":[
{
"ip":"10.10.10.1",
"hostname":"router",
"afi":"ipv4",
"used":true
}
]
}
] } }
,
"ipv4Multicast":{
"vrfId": 0,
"vrfName": "default",
"tableVersion": 0,
"routerId": "128.16.16.1",
"defaultLocPrf": 100,
"localAS": 2,
"routes": { } }
,
"ipv4Flowspec":{
"vrfId": 0,
"vrfName": "default",
"tableVersion": 0,
"routerId": "128.16.16.1",
"defaultLocPrf": 100,
"localAS": 2,
"routes": { } }
,
"ipv6Unicast":{
"vrfId": 0,
"vrfName": "default",
"tableVersion": 11,
"routerId": "128.16.16.1",
"defaultLocPrf": 100,
"localAS": 2,
"routes": { "2001:db8::2/128": [
{
"valid":true,
"bestpath":true,
"pathFrom":"external",
"prefix":"2001:db8::2",
"prefixLen":128,
"network":"2001:db8::2\/128",
"metric":0,
"weight":32768,
"peerId":"(unspec)",
"path":"",
"origin":"incomplete",
"nexthops":[
{
"ip":"::",
"hostname":"router",
"afi":"ipv6",
"scope":"global",
"used":true
}
]
}
],"2001:db8::3/128": [
{
"valid":true,
"bestpath":true,
"pathFrom":"external",
"prefix":"2001:db8::3",
"prefixLen":128,
"network":"2001:db8::3\/128",
"metric":0,
"weight":0,
"peerId":"10.10.20.3",
"path":"3",
"origin":"incomplete",
"nexthops":[
{
"ip":"2001:db8:0:20::3",
"hostname":"router",
"afi":"ipv6",
"scope":"global"
},
{
"ip":"fe80::a00:27ff:fe76:6738",
"hostname":"router",
"afi":"ipv6",
"scope":"link-local",
"used":true
}
]
}
],"2001:db8:0:20::/64": [
{
"valid":true,
"pathFrom":"external",
"prefix":"2001:db8:0:20::",
"prefixLen":64,
"network":"2001:db8:0:20::\/64",
"metric":0,
"weight":0,
"peerId":"10.10.20.3",
"path":"3",
"origin":"incomplete",
"nexthops":[
{
"ip":"2001:db8:0:20::3",
"hostname":"router",
"afi":"ipv6",
"scope":"global"
},
{
"ip":"fe80::a00:27ff:fe76:6738",
"hostname":"router",
"afi":"ipv6",
"scope":"link-local",
"used":true
}
]
},
{
"valid":true,
"bestpath":true,
"pathFrom":"external",
"prefix":"2001:db8:0:20::",
"prefixLen":64,
"network":"2001:db8:0:20::\/64",
"metric":0,
"weight":32768,
"peerId":"(unspec)",
"path":"",
"origin":"incomplete",
"nexthops":[
{
"ip":"::",
"hostname":"router",
"afi":"ipv6",
"scope":"global",
"used":true
}
]
}
] } }
,
"ipv6Multicast":{
"vrfId": 0,
"vrfName": "default",
"tableVersion": 0,
"routerId": "128.16.16.1",
"defaultLocPrf": 100,
"localAS": 2,
"routes": { } }
}
Router2#
Signed-off-by: Madhuri Kuruganti <k.madhuri@samsung.com>
2020-09-03 20:26:07 +05:30