BGP 4 states

The BGP states reflect the state of the BGP session.

Check the BGP state:

router{}show routing ip bgp summary
BGP router identifier 192.168.0.1, local ASN 65500

2 BGP AS-PATH entries

0 BGP community entries

Neighbor     V  AS     MsgRcvd   MsgSent  TblVer  InQ  OutQ  Up/Down  State/PfxRcd
10.1.1.3     4  65510        99       99       0    0     0  01:35:23            1
192.168.0.2  4  65500        99      100       0    0     0  01:35:24            2
IDLE
The router will not accept connections from the peer. This state is entered briefly after a connection has timed out.
ACTIVE
The router is listening for connection requests from the peers.
CONNECT
The router has sent out an active TCP connection request to the peer.
OPENSENT and OPENCONFIRM
The two peers are exchanging packets to establish their BGP session.
ESTABLISHED
Exchanges are successful.

A valid BGP session must be in ESTABLISHED state.

The peers must continue to exchange periodic KEEPALIVE packets to remain in the ESTABLISHED state, unless the negotiated hold time is 0.

show routing ip bgp

This command displays the IPv4 RIB of the BGP 4 protocol.

router{}show routing ip bgp
BGP table version is 0, local router ID is 192.168.0.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i -IGP, e - EGP, ? - incomplete

    Network        Next Hop     Metric  LocPrf  Weight  Path
*>  172.16.1.0/24  10.1.1.4          0               0  65520 i
*  i               10.1.1.4          0     100       0  65520 i
*  i192.168.0.0    192.168.0.2       0     100       0  i
*>                 0.0.0.0 0                     32768  i

Total number of prefixes 2
Local router ID
This id is used to identify the router, it is chosen as the highest IP address configured on an interface. The router id can be manually configured using the command bgp router-id.
Status codes:
s
Entry is suppressed.
d
Prefix was dampened (in case dampening is enabled).
*
Entry is valid.
>
In case there are multiple entries for this prefix, > indicates the best one.
i
Entry was learnt by interior BGP (in the same AS)
e
Entry was learnt by exterior BGP (different AS)
?
Entry was learnt through redistribution
Origin codes:
i
The origin of this entry is interior BGP (in the same AS).
e
The origin of this entry is exterior BGP (different AS).
?
The origin of this entry is redistribution.
Network
Prefix entry in the BGP RIB.
Next Hop
Next-hop attribute advertised by BGP in case the next-hop is 0.0.0.0 it means that this prefix is locally originated.
Metric
Multi-exit Descriminator value.
LocPrf
Local preference value. By default it is set to 100.
Weight
Weight associated to the prefix. By default the received routes is set to 0 while the weight of local routes is 32768.

Displaying an IPv4 network’s BGP 4 RIB prefixes

Display a specific IPv4 network’s BGP 4 RIB prefixes:

router{}show routing ip bgp 10.1.1.4
BGP routing table entry for 10.1.1.0/28
Paths: (4 available, best #4, table Default-IP-Routing-Table)
  Advertised to non peer-group peers:
  10.1.1.2 10.1.1.3 10.1.1.5
  65505
    10.1.1.5 from 10.1.1.5 (128.16.16.1)
      Origin IGP, metric 0, localpref 100, valid, external
      Last update: Thu Sep 7 21:14:52 2000

  65520
    10.1.1.3 from 10.1.1.3 (192.168.3.1)
      Origin IGP, metric 0, localpref 100, valid, external
      Last update: Thu Sep 7 20:51:16 2000

  65510
    10.1.1.2 from 10.1.1.2 (192.168.2.1)
      Origin IGP, metric 0, localpref 100, valid, external
      Last update: Thu Sep 7 20:40:41 2000

  Local
    0.0.0.0 from 0.0.0.0 (192.168.1.1)
      Origin IGP, metric 0, localpref 100, weight 32768, valid, sourced, local, best
      Last update: Thu Sep 7 20:39:44 2000

The various fields that are displayed are described into the following list:

  • (aggregated by ASN A.B.C.D)
  • (Received from a RR-client)
  • (Received from a RS-client)
  • (suppressed due to dampening)
  • (inaccessible)
  • Origin IGP
  • Origin EGP
  • Origin incomplete
  • metric — MED = Multi-exit discriminator
  • weight
  • localpref
  • valid
  • external
  • internal
  • confed-external
  • atomic-aggregate
  • best

Displaying IPv4 network BGP 4 protocol prefixes with mask longer or equal to prefix/M

  • Display any IPv4 network prefixes of the that have a mask longer or equal to prefix/M:

    router{}show routing ip bgp A.B.C.D/M longer-prefix
    

The fields are the same as the show routing ip bgp command.