PacketLab
Unit 1 · BGP

Reading the BGP Table

Trace one originated prefix across four autonomous systems, then read its candidate paths from different routers.

Configuration

R4 originates 203.0.113.4/32. R1 can learn it through R2 or R3. Every link is an eBGP adjacency; each router belongs to a different AS.

Four ASes, two paths to R4Illustrative topology
192.0.2.0/30192.0.2.4/30192.0.2.8/30192.0.2.12/30R1AS 65010R2AS 65020R3AS 65030R4AS 65040Lo10: 203.0.113.4/32
Solid lines: physical links with eBGP sessions. Every router has a different AS. R4 originates the prefix; R1 receives alternatives through R2 and R3.
Four-router configuration

R1

configure terminal
hostname R1
interface GigabitEthernet1
 ip address 192.0.2.1 255.255.255.252
 no shutdown
exit
interface GigabitEthernet2
 ip address 192.0.2.5 255.255.255.252
 no shutdown
exit
end
configure terminal
router bgp 65010
 bgp router-id 10.255.0.1
 no bgp default ipv4-unicast
 neighbor 192.0.2.2 remote-as 65020
 neighbor 192.0.2.6 remote-as 65030
 address-family ipv4 unicast
  neighbor 192.0.2.2 activate
  neighbor 192.0.2.6 activate
 exit-address-family
end

R2

configure terminal
hostname R2
interface GigabitEthernet1
 ip address 192.0.2.2 255.255.255.252
 no shutdown
exit
interface GigabitEthernet2
 ip address 192.0.2.9 255.255.255.252
 no shutdown
exit
end
configure terminal
router bgp 65020
 bgp router-id 10.255.0.2
 no bgp default ipv4-unicast
 neighbor 192.0.2.1 remote-as 65010
 neighbor 192.0.2.10 remote-as 65040
 address-family ipv4 unicast
  neighbor 192.0.2.1 activate
  neighbor 192.0.2.10 activate
 exit-address-family
end

R3

configure terminal
hostname R3
interface GigabitEthernet1
 ip address 192.0.2.6 255.255.255.252
 no shutdown
exit
interface GigabitEthernet2
 ip address 192.0.2.13 255.255.255.252
 no shutdown
exit
end
configure terminal
router bgp 65030
 bgp router-id 10.255.0.3
 no bgp default ipv4-unicast
 neighbor 192.0.2.5 remote-as 65010
 neighbor 192.0.2.14 remote-as 65040
 address-family ipv4 unicast
  neighbor 192.0.2.5 activate
  neighbor 192.0.2.14 activate
 exit-address-family
end

R4

configure terminal
hostname R4
interface GigabitEthernet1
 ip address 192.0.2.10 255.255.255.252
 no shutdown
exit
interface GigabitEthernet2
 ip address 192.0.2.14 255.255.255.252
 no shutdown
exit
interface Loopback10
 ip address 203.0.113.4 255.255.255.255
exit
end
configure terminal
router bgp 65040
 bgp router-id 10.255.0.4
 no bgp default ipv4-unicast
 neighbor 192.0.2.9 remote-as 65020
 neighbor 192.0.2.13 remote-as 65030
 address-family ipv4 unicast
  neighbor 192.0.2.9 activate
  neighbor 192.0.2.13 activate
  network 203.0.113.4 mask 255.255.255.255
 exit-address-family
end

Check show ip bgp summary on each router before reading the prefix entries. The following output excerpts are illustrative and abbreviated.

Reading the table

R4: the origin

R4# show ip bgp
     Network          Next Hop       Metric LocPrf Weight Path
 *>  203.0.113.4/32   0.0.0.0             0         32768 i

* marks a valid candidate; > marks the best path. Read the markers separately from the attributes to the right.

The local entry has an empty AS path and next hop 0.0.0.0. The final i is the ORIGIN attribute, normally set by network origination.

FieldRead it as
* and >Valid candidate and selected best path.
MetricMED, when present; not a hop count.
LocPrfPreference within an AS, normally 100 by default. Some external-path displays leave it blank.
WeightLocal-only preference in these examples; locally originated paths normally have 32768.
PathAS sequence, followed by the origin code: i, e or ?.

Origin i normally accompanies network origination; ? means incomplete origin and commonly appears after redistribution. The legacy e refers to EGP, not eBGP. These codes do not identify the IGP running in your network.

R2: one external hop

R2# show ip bgp
     Network          Next Hop       Metric LocPrf Weight Path
 *>  203.0.113.4/32   192.0.2.10          0             0 65040 i

R2 uses R4’s link address as next hop. AS 65040 appears because R4 sent this route over eBGP.

R1: two alternatives

R1# show ip bgp
     Network          Next Hop       Metric LocPrf Weight Path
 *   203.0.113.4/32   192.0.2.6                         0 65030 65040 i
 *>                   192.0.2.2                         0 65020 65040 i

The blank prefix on the second line continues the same destination. Both paths are candidates; this sample shows R2 selected. The full tie-break sequence is a later lesson, and the selected path can depend on arrival order and other attributes.

R1# show ip route bgp
B    203.0.113.4/32 [20/0] via 192.0.2.2

The installed route uses the chosen next hop. The 20 in brackets is administrative distance, not AS-path length.

R3: direct versus indirect

R3# show ip bgp
     Network          Next Hop       Metric LocPrf Weight Path
 *   203.0.113.4/32   192.0.2.5                         0 65010 65020 65040 i
 *>                   192.0.2.14          0             0 65040 i

R3 can receive a longer alternative through R1 while retaining its direct route from R4 as best.

Prefix details

R1# show ip bgp 203.0.113.4/32
Paths: (2 available, best #2, table default)
  65030 65040
    192.0.2.6 from 192.0.2.6
      Origin IGP, localpref 100, valid, external
  65020 65040
    192.0.2.2 from 192.0.2.2
      Origin IGP, localpref 100, valid, external, best

Use the detailed entry to distinguish the advertising neighbor, next hop and path attributes. A status-side i means an internal session; the final origin i does not. This lab uses only external sessions.

Other status markers
s · suppressedRetained in BGP but suppressed from the relevant advertisement, for example by aggregation policy.
d · dampedSubject to route-dampening suppression.
h · historyHistorical state retained without a current usable route.
r · RIB failureBGP selected a path but failed to install it, for example because another source won by administrative distance.
S · staleA route retained as stale during recovery.
Check installation and forwarding · example commands and results
Illustrative excerpts · clean lab, no competing route
R1# show ip bgp rib-failure
Network            Next Hop       RIB-failure

R1# show ip route 203.0.113.4
Routing entry for 203.0.113.4/32
  Known via "bgp 65010", distance 20, metric 0
  * 192.0.2.2

R1# show ip cef 203.0.113.4
203.0.113.4/32
  nexthop 192.0.2.2 GigabitEthernet1

The empty RIB-failure listing has no failed entries in this example. The route and forwarding entry both use R2. A different result needs investigation; the > marker alone does not prove hardware programming.

A best path is best within BGP. Use show ip bgp rib-failure, show ip route and show ip cef if installation or forwarding differs. Table version is a change indicator, not a prefix count.

BGP looking glass

A public looking glass provides a read-only view from another network. Select a router, inspect a specific prefix, then compare its next hops and AS paths with this lab.

Distinguish network entries (prefixes) from path entries (alternatives). Counts and routes change over time; a large table may contain several paths per destination.

Constructed summary excerpt · not a live Internet measurement
LookingGlass# show ip bgp summary
BGP router identifier 192.0.2.200, local AS number 64496
BGP table version is 7201, main routing table version 7201
1000 network entries
2500 path entries

Here 1,000 is the destination-prefix count and 2,500 counts all candidate paths. The table version is a change indicator, and the router identifier identifies the speaker. These four numbers are not interchangeable.

A public Internet view can be much larger. Select a router on a public looking glass, query a destination, and compare the prefix, next hop and AS sequence with the small lab. Commands depend on the service; do not treat these constructed numbers as current Internet totals.

Key Takeaways

  • A BGP table can contain several candidate paths for the same destination prefix.
  • The * marker means valid and > marks the selected best path; a blank prefix continues the destination above.
  • Read next hop, MED, local preference, weight and AS path as separate fields.
  • The final origin i differs from the status-side i for an internally learned path.
  • Check the IP route and forwarding entry separately; network-entry counts and path-entry counts measure different things.

Reading the BGP Table Quiz

Six questions · four options each · select one answer per question. Submit all answers to see your score and explanations.

1. R4 originates 203.0.113.4/32. What does next hop 0.0.0.0 mean in its BGP table?
2. R1 shows two rows for 203.0.113.4/32. The second row leaves Network blank. What does that mean?
3. Which marker identifies the path selected as best by BGP?
4. The final character in AS path 65020 65040 i is i. What does it represent?
5. Can a BGP best path fail to be installed in the IP routing table?
6. A summary has 1,000 network entries and 2,500 path entries. How should you read it?
Command references

BGP show commands · Symbol credits. Outputs vary by release.