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, local ASN 65500

2 BGP AS-PATH entries

0 BGP community entries

Neighbor     V  AS     MsgRcvd   MsgSent  TblVer  InQ  OutQ  Up/Down  State/PfxRcd     4  65510        99       99       0    0     0  01:35:23            1  4  65500        99      100       0    0     0  01:35:24            2
The router will not accept connections from the peer. This state is entered briefly after a connection has timed out.
The router is listening for connection requests from the peers.
The router has sent out an active TCP connection request to the peer.
The two peers are exchanging packets to establish their BGP session.
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
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
*>          0               0  65520 i
*  i               0     100       0  65520 i
*  i192.168.0.0       0     100       0  i
*>        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:
Entry is suppressed.
Prefix was dampened (in case dampening is enabled).
Entry is valid.
In case there are multiple entries for this prefix, > indicates the best one.
Entry was learnt by interior BGP (in the same AS)
Entry was learnt by exterior BGP (different AS)
Entry was learnt through redistribution
Origin codes:
The origin of this entry is interior BGP (in the same AS).
The origin of this entry is exterior BGP (different AS).
The origin of this entry is redistribution.
Prefix entry in the BGP RIB.
Next Hop
Next-hop attribute advertised by BGP in case the next-hop is it means that this prefix is locally originated.
Multi-exit Descriminator value.
Local preference value. By default it is set to 100.
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
BGP routing table entry for
Paths: (4 available, best #4, table Default-IP-Routing-Table)
  Advertised to non peer-group peers:
  65505 from (
      Origin IGP, metric 0, localpref 100, valid, external
      Last update: Thu Sep 7 21:14:52 2000

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

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

  Local from (
      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.