]> git.proxmox.com Git - mirror_frr.git/commit - bgpd/bgp_vty.c
bgpd: Show the real next-hop address in addition to hostname in `show bgp`
authorDonatas Abraitis <donatas.abraitis@gmail.com>
Wed, 6 May 2020 14:46:10 +0000 (17:46 +0300)
committerDonatas Abraitis <donatas.abraitis@gmail.com>
Mon, 13 Jul 2020 13:35:29 +0000 (16:35 +0300)
commitaef999a28f9a904431795050fc342257345acb02
treec697dae058850d5ca81b1f86ade53308cb5dd4e0
parent635cc1ec60c06f5268c0722bf8f4df37dedd56e8
bgpd: Show the real next-hop address in addition to hostname in `show bgp`

It's hard to cope with cases when next-hop is changed/unchanged or
peers are non-direct.

It would be better to show the hostname and nexthop IP address (both)
under `show bgp` to quickly identify the source and the real next-hop
of the route.

If `bgp default show-nexthop-hostname` is toggled the output looks like:
```
spine1-debian-9# show bgp
BGP table version is 1, local router ID is 2.2.2.2, vrf id 0
Default local pref 100, local AS 65002
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
*  2a02:4780::/64   fe80::a00:27ff:fe09:f8a3(exit1-debian-9)
                                             0             0 65001 ?

spine1-debian-9# show ip bgp
BGP table version is 5, local router ID is 2.2.2.2, vrf id 0
Default local pref 100, local AS 65002
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
*> 10.255.255.0/24  192.168.0.1(exit1-debian-9)
                                             0             0 65001 ?
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
bgpd/bgp_route.c
bgpd/bgp_vty.c
bgpd/bgpd.h