Skip to content

bgpd: show ip bgp neighbor advertised-routes output all paths #20617

@lolyu

Description

@lolyu

Description

the command show ip bgp neighbor advertised-routes shows all paths to neighbor, which should only contain the best path.

# show ip bgp neighbor 10.10.192.24 advertised-routes
BGP table version is 15906, local router ID is 10.215.82.3, vrf id 0
Default local pref 100, local AS 64627
Status codes:  s suppressed, d damped, h history, u unsorted, * 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
RPKI validation codes: V valid, I invalid, N Not found
 
     Network          Next Hop            Metric LocPrf Weight Path
*>  10.215.82.3/32   0.0.0.0                  0         32768 i
*   10.215.82.3/32   10.10.192.24                           0 64867 64627 i
*   10.215.82.3/32   10.10.193.24                           0 64867 64627 i
*   10.215.82.3/32   10.10.194.24                           0 64867 64627 i
*   10.215.82.3/32   10.10.195.24                           0 64867 64627 i
*   10.215.82.3/32   10.10.196.24                           0 64867 64627 i
*   10.215.82.3/32   10.10.197.24                           0 64867 64627 i
*   10.215.82.3/32   10.10.198.24                           0 64867 64627 i
*   10.215.82.3/32   10.10.199.24                           0 64867 64627 i
 
Total number of prefixes 1
# show ip bgp neighbor 10.10.192.24 advertised-routes json
{
"bgpTableVersion":15906,"bgpLocalRouterId":"10.215.82.3","defaultLocPrf":100,"localAS":64627,"advertisedRoutes": {"10.215.82.3/32":{"addrPrefix":"10.215.82.3","prefixLen":32,"network":"10.215.82.3/32","nextHop":"0.0.0.0","metric":0,"weight":32768,"path":"","origin":"IGP","valid":true,"best":true}}
,"totalPrefixCounter":1,"filteredPrefixCounter":0}

Version

# show run
Building configuration...
 
Current configuration:
!
frr version 10.3
frr defaults traditional
hostname 07LT0
log syslog informational
log facility local4
zebra nexthop-group keep 1
no zebra nexthop kernel enable
fpm address 127.0.0.1
no fpm use-next-hop-groups
no service integrated-vtysh-config
!
ip prefix-list PL_LoopbackV4 seq 5 permit 10.215.82.3/32
ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 5 permit 10.151.187.0/25
!
ipv6 prefix-list PL_LoopbackV6 seq 5 permit 2603:10b0:d20:8a1::/64
ipv6 prefix-list LOCAL_VLAN_IPV6_PREFIX seq 10 permit 2603:10b0:d20:b406::/64
!
route-map FROM_BGPMON deny 100
exit
!
route-map TO_BGPMON permit 100
exit
!
route-map FROM_BGPMON_V6 permit 100
on-match next
set ipv6 next-hop prefer-global
exit
!
route-map FROM_BGPMON_V6 permit 200
match community bgpmon_v6_community
exit
!
route-map FROM_BGPMON_V6 deny 300
exit
!
route-map TO_BGPMON_V6 permit 20
match ipv6 address prefix-list PL_LoopbackV6
set community 8075:8847
exit
!
route-map TO_BGPMON_V6 permit 30
match tag 201
set community 8075:8847
exit
!
route-map TO_BGPMON_V6 deny 40
exit
!
route-map TO_BGPMON_V6 permit 100
exit
!
route-map FROM_BGP_SPEAKER permit 100
exit
!
route-map TO_BGP_SPEAKER deny 100
exit
!
route-map FROM_TIER1_V6 permit 100
on-match next
set ipv6 next-hop prefer-global
exit
!
route-map FROM_TIER1_V6 permit 200
exit
!
route-map TO_TIER1_V6 permit 20
match ipv6 address prefix-list PL_LoopbackV6
set community 8075:8847
exit
!
route-map TO_TIER1_V6 permit 30
match tag 201
set community 8075:8847
exit
!
route-map TO_TIER1_V6 deny 40
exit
!
route-map TO_TIER1_V6 permit 100
exit
!
route-map FROM_TIER1_V4 permit 100
exit
!
route-map TO_TIER1_V4 permit 20
match ip address prefix-list PL_LoopbackV4
set community 8075:8847
exit
!
route-map TO_TIER1_V4 permit 30
match tag 201
set community 8075:8847
exit
!
route-map TO_TIER1_V4 deny 40
exit
!
route-map TO_TIER1_V4 permit 100
exit
!
route-map RM_SET_SRC permit 10
set src 10.215.82.3
exit
!
route-map RM_SET_SRC6 permit 10
set src 2603:10b0:d20:8a1::
exit
!
password zebra
enable password zebra
!
ipv6 route 2603:10b0:d20:8a1::/64 Loopback0
!
interface Vlan8
no link-detect
exit
!
router bgp 64627
bgp router-id 10.215.82.3
bgp suppress-fib-pending
bgp log-neighbor-changes
no bgp ebgp-requires-policy
no bgp default ipv4-unicast
coalesce-time 10000
bgp graceful-restart restart-time 240
bgp graceful-restart select-defer-time 45
bgp graceful-restart
bgp graceful-restart preserve-fw-state
bgp bestpath as-path multipath-relax
neighbor BGPMON peer-group
neighbor BGPMON update-source 10.215.82.3
neighbor BGPMON_V6 peer-group
neighbor BGPMON_V6 passive
neighbor BGPSLBPassive peer-group
neighbor BGPSLBPassive remote-as 64523
neighbor BGPSLBPassive passive
neighbor BGPSLBPassive ebgp-multihop
neighbor BGPSLBPassive update-source 10.215.82.3
neighbor BGPSLBPassive2 peer-group
neighbor BGPSLBPassive2 remote-as 65511
neighbor BGPSLBPassive2 passive
neighbor BGPSLBPassive2 ebgp-multihop
neighbor BGPSLBPassive2 update-source 10.20.8.199
neighbor BGPSLBPassiveV6 peer-group
neighbor BGPSLBPassiveV6 remote-as 65511
neighbor BGPSLBPassiveV6 passive
neighbor BGPSLBPassiveV6 ebgp-multihop
neighbor BGPSLBPassiveV6 update-source 2001:506:28:500::1
neighbor TIER1_V4 peer-group
neighbor TIER1_V6 peer-group
neighbor 2603:10b0:d23:28::4 remote-as 64627
neighbor 2603:10b0:d23:28::4 peer-group BGPMON_V6
neighbor 2603:10b0:d23:28::4 description BGPMonitor
neighbor 2603:10b0:d23:29::4 remote-as 64627
neighbor 2603:10b0:d23:29::4 peer-group BGPMON_V6
neighbor 2603:10b0:d23:29::4 description BGPMonitor
neighbor 2603:10b0:d23:2a::4 remote-as 64627
neighbor 2603:10b0:d23:2a::4 peer-group BGPMON_V6
neighbor 2603:10b0:d23:2a::4 description BGPMonitor
neighbor 10.10.192.24 remote-as 64867
neighbor 10.10.192.24 peer-group TIER1_V4
neighbor 10.10.192.24 description 11T1
neighbor 10.10.193.24 remote-as 64867
neighbor 10.10.193.24 peer-group TIER1_V4
neighbor 10.10.193.24 description 12T1
neighbor 10.10.194.24 remote-as 64867
neighbor 10.10.194.24 peer-group TIER1_V4
neighbor 10.10.194.24 description 13T1
neighbor 10.10.195.24 remote-as 64867
neighbor 10.10.195.24 peer-group TIER1_V4
neighbor 10.10.195.24 description 14T1
neighbor 10.10.196.24 remote-as 64867
neighbor 10.10.196.24 peer-group TIER1_V4
neighbor 10.10.196.24 description 15T1
neighbor 10.10.197.24 remote-as 64867
neighbor 10.10.197.24 peer-group TIER1_V4
neighbor 10.10.197.24 description 16T1
neighbor 10.10.198.24 remote-as 64867
neighbor 10.10.198.24 peer-group TIER1_V4
neighbor 10.10.198.24 description 17T1
neighbor 10.10.199.24 remote-as 64867
neighbor 10.10.199.24 peer-group TIER1_V4
neighbor 10.10.199.24 description 18T1
neighbor 2603:10b0:d20:849::35 remote-as 64867
neighbor 2603:10b0:d20:849::35 peer-group TIER1_V6
neighbor 2603:10b0:d20:849::35 description 11T1
neighbor 2603:10b0:d20:84a::35 remote-as 64867
neighbor 2603:10b0:d20:84a::35 peer-group TIER1_V6
neighbor 2603:10b0:d20:84a::35 description 12T1
neighbor 2603:10b0:d20:84b::35 remote-as 64867
neighbor 2603:10b0:d20:84b::35 peer-group TIER1_V6
neighbor 2603:10b0:d20:84b::35 description 13T1
neighbor 2603:10b0:d20:84c::35 remote-as 64867
neighbor 2603:10b0:d20:84c::35 peer-group TIER1_V6
neighbor 2603:10b0:d20:84c::35 description 14T1
neighbor 2603:10b0:d20:84d::35 remote-as 64867
neighbor 2603:10b0:d20:84d::35 peer-group TIER1_V6
neighbor 2603:10b0:d20:84d::35 description 15T1
neighbor 2603:10b0:d20:84e::35 remote-as 64867
neighbor 2603:10b0:d20:84e::35 peer-group TIER1_V6
neighbor 2603:10b0:d20:84e::35 description 16T1
neighbor 2603:10b0:d20:84f::35 remote-as 64867
neighbor 2603:10b0:d20:84f::35 peer-group TIER1_V6
neighbor 2603:10b0:d20:84f::35 description 17T1
neighbor 2603:10b0:d20:850::35 remote-as 64867
neighbor 2603:10b0:d20:850::35 peer-group TIER1_V6
neighbor 2603:10b0:d20:850::35 description 18T1
bgp listen range 10.236.61.192/26 peer-group BGPSLBPassive
bgp listen range 10.151.187.0/25 peer-group BGPSLBPassive2
bgp listen range 2603:10b0:d20:b406::/64 peer-group BGPSLBPassiveV6
!
address-family ipv4 unicast
  network 10.151.187.0/25
  network 10.215.82.3/32
  neighbor BGPMON activate
  neighbor BGPMON maximum-prefix 1
  neighbor BGPMON route-map FROM_BGPMON in
  neighbor BGPMON route-map TO_BGPMON out
  neighbor BGPMON_V6 activate
  neighbor BGPMON_V6 addpath-tx-all-paths
  neighbor BGPMON_V6 soft-reconfiguration inbound
  neighbor BGPMON_V6 maximum-prefix 200
  neighbor BGPMON_V6 route-map FROM_BGPMON_V6 in
  neighbor BGPMON_V6 route-map TO_BGPMON_V6 out
  neighbor BGPSLBPassive activate
  neighbor BGPSLBPassive soft-reconfiguration inbound
  neighbor BGPSLBPassive route-map FROM_BGP_SPEAKER in
  neighbor BGPSLBPassive route-map TO_BGP_SPEAKER out
  neighbor BGPSLBPassive2 activate
  neighbor BGPSLBPassive2 soft-reconfiguration inbound
  neighbor BGPSLBPassive2 route-map FROM_BGP_SPEAKER in
  neighbor BGPSLBPassive2 route-map TO_BGP_SPEAKER out
  neighbor BGPSLBPassiveV6 activate
  neighbor BGPSLBPassiveV6 soft-reconfiguration inbound
  neighbor BGPSLBPassiveV6 route-map FROM_BGP_SPEAKER in
  neighbor BGPSLBPassiveV6 route-map TO_BGP_SPEAKER out
  neighbor TIER1_V4 activate
  neighbor TIER1_V4 soft-reconfiguration inbound
  neighbor TIER1_V4 maximum-prefix 12000 90 warning-only
  neighbor TIER1_V4 route-map FROM_TIER1_V4 in
  neighbor TIER1_V4 route-map TO_TIER1_V4 out
  neighbor 10.10.192.24 allowas-in 1
  neighbor 10.10.193.24 allowas-in 1
  neighbor 10.10.194.24 allowas-in 1
  neighbor 10.10.195.24 allowas-in 1
  neighbor 10.10.196.24 allowas-in 1
  neighbor 10.10.197.24 allowas-in 1
  neighbor 10.10.198.24 allowas-in 1
  neighbor 10.10.199.24 allowas-in 1
exit-address-family
!
address-family ipv6 unicast
  network 2603:10b0:d20:8a1::/64
  network 2603:10b0:d20:b406::/64
  neighbor BGPMON_V6 activate
  neighbor BGPMON_V6 addpath-tx-all-paths
  neighbor BGPMON_V6 soft-reconfiguration inbound
  neighbor BGPMON_V6 maximum-prefix 200
  neighbor BGPMON_V6 route-map FROM_BGPMON_V6 in
  neighbor BGPMON_V6 route-map TO_BGPMON_V6 out
  neighbor BGPSLBPassive activate
  neighbor BGPSLBPassive2 activate
  neighbor BGPSLBPassiveV6 activate
  neighbor TIER1_V6 activate
  neighbor TIER1_V6 soft-reconfiguration inbound
  neighbor TIER1_V6 maximum-prefix 8000 90 warning-only
  neighbor TIER1_V6 route-map FROM_TIER1_V6 in
  neighbor TIER1_V6 route-map TO_TIER1_V6 out
  neighbor 2603:10b0:d20:849::35 allowas-in 1
  neighbor 2603:10b0:d20:84a::35 allowas-in 1
  neighbor 2603:10b0:d20:84b::35 allowas-in 1
  neighbor 2603:10b0:d20:84c::35 allowas-in 1
  neighbor 2603:10b0:d20:84d::35 allowas-in 1
  neighbor 2603:10b0:d20:84e::35 allowas-in 1
  neighbor 2603:10b0:d20:84f::35 allowas-in 1
  neighbor 2603:10b0:d20:850::35 allowas-in 1
exit-address-family
exit
!
bgp community-list standard bgpmon_v6_community seq 5 permit 8075:8821 no-export
!
ip protocol bgp route-map RM_SET_SRC
!
ipv6 protocol bgp route-map RM_SET_SRC6
!
ip nht resolve-via-default
!
ipv6 nht resolve-via-default
!
end

How to reproduce

run show ip bgp neighbor advertised-routes

Expected behavior

show ip bgp neighbor advertised-routes should only contain the best paths, which is same as the json output.

Actual behavior

show ip bgp neighbor advertised-routes contains all the paths.

Additional context

No response

Checklist

  • I have searched the open issues for this bug.
  • I have not included sensitive information in this report.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions