04-09-2019 11:48 AM - edited 04-09-2019 11:49 AM
A simple question : how can I list bgp neighbors for global routing only ? I am working on a script that should be able to collect them.
The command "show ip bgp vpnv4 vrf xyz summary" lists the neighbors for the xyz vrf only, which is fair enough.
On the other hand, "show ip bgp summary" or "show ip bgp neighbors" list all bgp neighbors regardless what vrf they belong to. On top of this, no vrf information is present in the output, so it is impossible to tell the vrf for a peering (at least on IOSv) from this command.
Eventually, a bgp peering for vrf xyz is listed by both commands. So the only way I can imagine is to poll all existing vrf names, then all bgp neighbors for these vrfs, then compare this list to the list presented by "show ip bgp summary". However, this is very inefficient and I am pretty sure there must be a way to gather neighbors for global routing only.
Any ideas please ?
04-09-2019 12:27 PM
Hi Frank,
You can use "show bgp ipv4 unicast summary" or "show bgp ipv6 unicast summary" to list the global neighbors.
Regards,
04-09-2019 12:38 PM
Hello Harold, thanks for quick reply and the suggested solution, which I will check later on.
At the same time, I also wanted to add, that I was checking the same on an ISR4331 running IOS-XE, and it behaves differently.
On this IOS, the "show ip bgp summary" only lists the neighbors for global routing. So maybe the issue I am facing with pertains to IOSv only, not sure about this.
04-09-2019 12:53 PM
Hi Frank,
Bear in mind that "show ip bgp summary" is part of the legacy CLI. The current CLI uses the following format; "show bgp <address-family> <sub-address-family>". It is recommended to use the current CLI.
Regards,
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide