show ip bgp
Use this command to display BGP routes.
Command Syntax
show ip bgp
show ip bgp ipv4 (unicast|multicast)(vrf (VRFNAME|all|default))
Parameters
ipv4
IPv4 routes
unicast
Unicast prefixes
multicast
Multicast prefixes
VRFNAME
VPN routing/forwarding instance name
all
All VRFs
default
Default VRF
Command Mode
Privileged Exec mode and Exec mode
Applicability
This command was introduced before OcNOS version 1.3.
Examples
This example shows routes learned from both iBGP and eBGP peers.
#show ip bgp
BGP table version is 0, local router ID is 10.100.0.77
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, S stale,
Origin codes: i - IGP, e - EGP,? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 172.16.1.0/24 10.10.10.78 0 1 4 i
*> 192.16.1.0 10.10.10.78 200 0 1 4 ?
* 10.100.0.62 100 0 3 4 ?
*>i 192.17.1.0 10.100.0.62 100 0 i
Total number of prefixes 2
Header
BGP table version is 0, local router ID is 10.100.0.77
• The BGP table version tracks the local BGP table version. Any time the BGP best path algorithm executes, the table version increments.
• The Router ID of the local router is 10.100.0.77.
Status codes: s suppressed, d damped, h history, p stale, * valid, > best, i - internal
Table 4-63 explains the status codes in the header.
Table 4-63: status codes
Status code | Description | Comments |
s | suppressed | Whether the route is suppressed and will not be advertised to the neighbors. |
d | damped | When the penalty of a flapping route exceeds the suppress limit, the route is damped and remains in a withdrawn state until its penalty decreases below the reuse limit. |
h | history | When the penalty of a flapping route does not exceed the suppress limit, the route is not damped and BGP maintains a history of the flapping route. |
p | stale | When the BGP neighbor from which a route is learned is in graceful restart, the route is retained in the BGP routing table, but marked as stale. |
* | valid | Whether the route is valid. When a route is not suppressed, damped, or present in the history, it is valid. |
> | best | The route selected as the best path and installed in the kernel routing table. |
i | internal | Whether the route is learned from an iBGP peer. If this symbol is not present, the route was learned from an eBGP peer. |
Origin codes: i - IGP, e - EGP, ? - incomplete
Table 4-64 explains the codes are at the end of each routing entry that show where the route originated.
Table 4-64: origin codes
Origin code | Description | Comments |
i | IGP | The route originated from an Interior Gateway Protocol. |
e | EGP | The route originated from an Exterior Gateway Protocol. |
? | incomplete | Origin not known. Typically, these are routes redistributed from an Interior Gateway Protocol. |
Route Entry Fields
Table 4-65 explains the fields shows for each route.
Table 4-65: route entry fields
Field | Description |
---|
Network | Network prefix installed in BGP. If multiple routes exist for the same prefix, only the first prefix is identified and others have blank spaces. The status codes are explained in Table 4-63. |
Next Hop | IP address of the nexthop for this route. |
Metric | Multiple-Exit Discriminator (MED). If there are multiple paths to the same destination from a single routing protocol, then the multiple paths have the same administrative distance and the best path is selected based on this metric. The path with the lowest metric is selected as the optimal path and installed in the routing table. |
LocPrf | Local preference set with the set local-preference command. This value is used only with iBGP sessions within the local autonomous system to determine if a route towards a destination is the “best” one. The path with the highest local preference is preferred. |
Weight | This field applies only to routes within an individual router. If a route was learned from a peer, it has a default weight of 0. All routes generated by the local router have a weight of 32,768. |
Path and origin | The autonomous systems through which the prefix advertisement passed. The origin codes are explained in Table 4-64 |
Route Entry Examples
*> 172.16.1.0/24 10.10.10.78 0 1 4 i
• The absence of status code “i” means the route is external and was learned from an eBGP peer.
• The “>” means this route is selected to be installed in the kernel routing table. Its network address is 172.16.1.0/24.
• The IP address of the nexthop for this route is 10.10.10.78.
• This route was learned from a peer, so it has a default weight of 0.
• The path “1 4” means the prefix advertisement passed through AS1 and AS4.
• The origin code “i” means the prefix was added by a network statement at an originating AS.
*> 192.16.1.0 10.10.10.78 200 0 1 4 ?
* 10.100.0.62 100 0 3 4 ?
• The same prefix was learned from two different ASs, AS1 and AS3.
• The route learned from AS1 is chosen as the best route because AS1 has a lower Router ID (10.10.10.78) than AS2 (10.100.0.62). Although the metric of the route learned from AS1 is higher (200) than the route learned from AS3 (100), this attribute is not used in the best path selection decision because the metrics are compared only if the first (neighboring) AS is the same in the two paths.
• The origin code “?” indicates that the routes were learned through redistribution.
*>i192.17.1.0 10.100.0.62 100 0 i
• The route is learned through an iBGP peer as indicated by the status code “i”.
• The preference of the route, used only with the local AS, is 100 (the default value).
Last modified date: 07-13-2023