BGP show routines

Synopsis:


show ip bgp [ipv4-addr [mask] [longer-prefixes]]

Displays information about BGP routes installed in the BGP routing information base (RIB.)

ipv4-addr

IP address entered to filter the output to display only a particular host or network in the BGP routing table.

mask

Mask to filter or match hosts that are part of the specified network.

longer-prefixes

If a prefix is specified, optionally specify to show routes matching the specified Network/Mask pair only.

switch(bgp)# show ip bgp

Local AS  : 100              Local Router-id : 10.0.102.138

Status codes: * - valid, > - best, i - internal, e - external, s - stale
Origin codes: i - IGP, e - EGP, ? - incomplete

Network          Nexthop      Metric  LocalPref  Weight AsPath
--------------------------------------------------------------
* e 11.0.0.0/8   10.0.102.40  0               0  200        ?
*>e 11.0.0.0/8   10.0.102.153 0               0  200        i
*>e 22.0.0.0/8   10.0.102.40  0               0  200        ?
* e 22.0.0.0/8   10.0.102.198 0               0  300    500 ?
*>e 33.0.0.0/8   10.0.102.40  0               0  200        ?
* e 33.0.0.0/8   10.0.102.198 0               0  300    400 ?

Synopsis:


show ip bgp ipv4-addr/masklen

Displays specific information on the route and the BGP path attributes of the route.

switch(bgp)# show ip bgp 11.0.0.0/8

Local AS  : 100               Local Router-id  :

Network     : 11.0.0.0/8      Nexthop         : 10.0.102.40
Peer        : 10.0.102.40     Origin          : incomplete
Metric      : 0               Local Pref      : 
Weight      : 0               Calc. Local Pref: 100
Best        : No              Valid           : Yes 
Type        : external        Stale           : No 
AS-Path     : 200
Communities : 200:20 100:50

Network     : 11.0.0.0/8      Nexthop       : 10.0.102.153
Peer        : 10.0.102.153    Origin        : igp 
Metric      : 0               Local Pref       : 
Weight      : 0               Calc. Local Pref : 100
Best        : Yes             Valid            : Yes 
Type        : external        Stale            : No 
AS-Path     : 200
Communities :

Synopsis:


show ip bgp ipv4-addr/masklen regexp aspath-reg-ex

Displays detailed information on the route if the route’s aspath information matches the supplied regular expression. This will filter both on the prefix/len and the regular expression.

switch(bgp)# show ip bgp 11.0.0.0/8 regexp 20

Local AS  : 100               Local Router-id  :

Network     : 11.0.0.0/8      Nexthop         : 10.0.102.40
Peer        : 10.0.102.40     Origin          : incomplete
Metric      : 0               Local Pref      : 
Weight      : 0               Calc. Local Pref: 100
Best        : No              Valid           : Yes 
Type        : external        Stale           : 
No AS-Path  : 200
Communities : 200:20 100:50

Synopsis:


show ip bgp [ipv4-addr]

Displays all the routes in the IP routing table, including BGP routes.

ipv4-addr

IP address entered to filter the output to display only a particular host or network in the IP routing table.

switch(bgp)# show ip route

          IP Route Entries

Destination  Gateway       VLAN Type            Sub-Type  Metric Dist.
-------------------------------------------------------------------
0.0.0.0/0    10.0.0.1      1    static              1         1
10.0.0.0/16  DEFAULT_VLAN  1    connected           1         0
11.0.0.0/8   10.0.102.153  1    bgp                 0         20
22.0.0.0/8   10.0.102.40   1    bgp                 0         20
33.0.0.0/8   10.0.102.40   1    bgp                 0         20
99.0.0.0/8   DEFAULT_VLAN  1    static              1         1
127.0.0.0/8  reject             static              0         0
127.0.0.1/32 lo0                connected           1         0

Synopsis:


show ip route bgp [ipv4-addr]

Displays only the BGP routes in the IP routing table.

ipv4-addr

IP address entered to filter the output to display only a particular host or network in the BGP routing table.

switch(bgp)# show ip route bgp

           IP Route Entries

Destination Gateway      VLAN  Type       Sub-Type  Metric Dist.
----------------------------------------------------------------
11.0.0.0/8  10.0.102.153  1    bgp             0         20
22.0.0.0/8  10.0.102.40   1    bgp             0         20
33.0.0.0/8  10.0.102.40   1    bgp             0         20

Synopsis:


show bgp community comm-nums

Displays the list of routes who have specific communities tagged to them.

switch(bgp)# show ip community 200:20 200:30

Local AS    : 100                    Local Router-id :

Status codes: * - valid, > - best, i - internal, e - external, s - stale
Origin codes: i - IGP, e - EGP, ? - incomplete

Network           Nexthop        Metric LocalPref Weight AsPath
------------------------------------------------------------
* e  11.0.0.0/8 10.0.102.40  0               0  200     ?
*>e  33.0.0.0/8 10.0.102.40  0               0  200     ?

Synopsis:


show ip bgp community regexp community-reg-ex

Displays the routes whose community information matches the supplied regular expression.

switch(bgp)# show ip bgp community regexp “2”

Local AS    : 100                    Local Router-id : 10.0.102.138

Status codes: * - valid, > - best, i - internal, e - external, s - stale
Origin codes: i - IGP, e - EGP, ? - incomplete

Network        Nexthop      Metric  LocalPref Weight AsPath
------------------------------------------------------------
* e 11.0.0.0/8 10.0.102.40  0               0  200     ?
*>e 11.0.0.0/8 10.0.102.153 0               0  200     i
*>e 22.0.0.0/8 10.0.102.40  0               0  200     ?

Synopsis:


show ip bgp community comm-num... regexp aspath-reg-ex

Displays the routes whose community information matches the supplied community numbers and also the AS_PATH information matches the supplied regular expression.

switch(bgp)# show ip bgp community 20 regexp “2”

Local AS    : 100                    Local Router-id : 10.0.102.138

Status codes: * - valid, > - best, i - internal, e - external, s - stale
Origin codes: i - IGP, e - EGP, ? - incomplete

Network           Nexthop      Metric LocalPref Weight AsPath
------------------------------------------------------------
* e 11.0.0.0/8    10.0.102.40  0             0  200     ?

Synopsis:


show ip bgp community comm-num... exact regexp aspath-reg-ex

Displays the routes whose community information matches exactly the supplied community numbers and also whose AS_PATH information matches the supplied regular expression.

switch(bgp)# show ip bgp community 200:20 100:50 exact regexp “2”

Local AS   : 100                    Local Router-id : 10.0.102.138

Status codes: * - valid, > - best, i - internal, e - external, s - stale
Origin codes: i - IGP, e - EGP, ? - incomplete

Network        Nexthop      Metric  LocalPref  Weight AsPath
------------------------------------------------------------
* e 11.0.0.0/8 10.0.102.40  0               0  200     ?

Synopsis:


show ip bgp regex reg-ex

Displays all routes whose AS_PATH matches the regular-expression given.

switch(bgp)# show ip bgp regexp “^300"
Local AS    : 100                    Local Router-id :

Status codes: * - valid, > - best, i - internal, e - external, s - stale
Origin codes: i - IGP, e - EGP, ? - incomplete

Network        Nexthop      Metric LocalPref  Weight AsPath
------------------------------------------------------------
* e 22.0.0.0/8 10.0.102.198 0              0  300    500  ?
* e 33.0.0.0/8 10.0.102.198 0              0  300    400  ?

Synopsis:


show ip bgp [ipv4-addr/masklen [longer-prefix]] route community

Displays basic route information (destination and nexthop) and the communities tagged to the route in full. This show routine is especially helpful when you want to look at the communities that are tagged to all routes at a glance.

switch(bgp)# show ip bgp 22.0.0.0/8 route community

Local AS   : 100                    Local Router-id :

Status codes: * - valid, > - best, i - internal, e - external, s - stale
Origin codes: i - IGP, e - EGP, ? - incomplete

Network        Nexthop          Community
------------------------------------------------------------
*>e 22.0.0.0/8 10.0.102.40      200:20 100:50           ?
*e  22.0.0.0/8 10.0.102.198     no-export               ?

Synopsis:


show ip bgp neighbor [ipv4-addr]

Displays information about the state of BGP’s IPv4 peering sessions.

switch(bgp)# show ip bgp neighbor 10.0.102.40

BGP Neighbor 10.0.102.40

BGP Version      : 4
Remote Router ID : 10.0.102.40   Local Router ID      :10.0.102.138
Remote-AS        : 200           Local-AS             : 100
Remote Port      : 179           Local Port           : 56126
State            : Established   Up Time              : 0h:3m:29s 
Admin Status     : Start         Link Type            : External 
Conn Established : 1             Conn Dropped         : 0
Last Read        : 0h:0m:29s     Last Write           : 0h:0m:29s
Last reset time  : 0h:0m:0s      Error Subcode Sent   : 0
Last reset reason: Never         Gr. Restart Time     : 120 secs.

MAXIMUM Prefix    : 4294967295   Send Community       : Yes 
Weight            : 0            RtReflectorClient    : No 
Use MED           : Yes          Passive              : No 
AS-Override       : No           Allow-AS in          : 0
Ignore Lead AS    : No           Out-Delay            : 0
Remove Private AS : No           Ttl                  : 1
Update Source     : 
Route-Map-In      : 
Route-Map-Out     : 
Password          :
Cfg. Hold Time    : 180        Cfg. Keep Alive      : 60
Neg. Hold Time    : 180        Neg. Keep Alive      : 60

Capability                     Announced   Received
------------------------------ ---------   -------- 
Route Refresh                  No          Yes 
Dynamic                        No          No 
Graceful Restart (ipv4-uni)    Yes         No
Multi-protocol (ipv4-uni)      Yes         Yes

Message Type                   Sent        Received
------------------------------ ---------   -------- 
Opens                          1           1
Notifications                  0           0
Capability                     0           0
Updates                        1           1
Keepalives                     4           4
Route Refresh                  0           0
Total                          6           6

Prefix Activity                Sent        Received
------------------------------ ---------   -------- 
Prefixes Current               1           3
Prefixes Total                 1           3
Implicit Withdraw              0           0
Explicit Withdraw              0           0
Used as BestPath               n/a         2

Local Policy Denied Prefixes   Outbound    Inbound
------------------------------ ---------   -------- 
Routemap                       0           0
Bad lead AS                    n/a         0
Exceeded Max-prefix            n/a         0
Exceeded Allow-as in           n/a         0
Total                          0           0

                                     Max       Min
                                     --------- -------- 
Number of NLRIs in the update sent   1         0

Synopsis:


show ip bgp as-path

Displays the list of AS_PATHs that BGP has learned from the routing information it has received.

switch# show ip bgp as-path
BGP AS-Path Information

AS Path                                   Metric      RefCount
----------------------------------------- ----------  ----- 
 I                                        0           4
 ?                                        0           3
200 i                                     0           2
300 ?                                     250         2

Synopsis:


show ip bgp redistribute

Displays the list of protocols whose routes are being redistributed into BGP.

switch# show ip bgp redistribute

Route type  RouteMap
----------  -------------------------------------------------- 
static      rtmap-static
rip

Synopsis:


show ip bgp summary

Displays a summarized view of global BGP configuration and current BGP neighbor peering state.