Purpose
Assuming that all the routers are correctly configured for BGP, you can verify if IBGP and EBGP sessions are properly established, external routes are advertised and received correctly, and the BGP path selection process is working properly.
Figure 15 illustrates an example BGP network topology used in this topic.
Figure 15: BGP Network Topology

The network consists of two directly connected ASs consisting of external and internal peers. The external peers are directly connected through a shared interface and are running EBGP. The internal peers are connected through their loopback (lo0) interfaces through IBGP. AS 65001 is running OSPF and AS 65002 is running IS-IS as its underlying IGP. IBGP routers do not have to be directly connected, the underlying IGP allows neighbors to reach one another.
The two routers in AS 65001 each contain one EBGP link to AS 65002 (R2 and R4) over which they announce aggregated prefixes: 100.100.1.0, 100.100.2.0, 100.100.3.0, and 100.100.4.0. Also, R1 and R5 are injecting multiple exit discriminator (MED) values of 5 and 10, respectively, for some routes.
The internal routers in both ASs are using a full mesh IBGP topology. A full mesh is required because the networks are not using confederations or route reflectors, so any routes learned through IBGP are not distributed to other internal neighbors. For example, when R3 learns a route from R2, R3 does not distribute that route to R6 because the route is learned through IBGP, so R6 must have a direct BGP connection to R2 to learn the route.
In a full mesh topology, only the border router receiving external BGP information distributes that information to other routers within its AS. The receiving router does not redistribute that information to other IBGP routers in its own AS.
From the point of view of AS 65002, the following sessions should be up:
To verify BGP peers, follow these steps:
To check that all IBGP and EBGP sessions are properly established.
To check that all IBGP and EBGP sessions are properly established, enter the following JUNOS CLI operational mode command:
The following sample output from R2 shows four peers that are not established:
user@R2> show bgp summary Groups: 2 Peers: 4 Down peers: 1 Table Tot Paths Act Paths Suppressed History Damp State Pending inet.0 6 4 0 0 0 0 Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Damped... 10.0.0.3 65002 86 90 0 2 42:54 0/0/0 0/0/0 10.0.0.4 65002 90 91 0 1 42:54 0/2/0 0/0/0 10.0.0.6 65002 87 90 0 3 3 Active 10.1.12.1 65001 89 89 0 1 42:54 4/4/0 0/0/0
The following sample output shows that all peers are established:
user@R2> show bgp summary Groups: 2 Peers: 4 Down peers: 0 Table Tot Paths Act Paths Suppressed History Damp State Pending inet.0 6 4 0 0 0 0 Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Damped.. 10.0.0.3 65002 54440 54457 0 1 2w4d21h 0/0/0 0/0/0 10.0.0.4 65002 51505 51507 0 0 2w3d21h 0/2/0 0/0/0 10.0.0.6 65002 14066 14070 0 1 4d 21:15:14 0/0/0 0/0/0 10.1.12.1 65001 88580 88587 0 0 4w2d18h 4/4/0 0/0/0 user@R3> show bgp summary Groups: 1 Peers: 3 Down peers: 0 Table Tot Paths Act Paths Suppressed History Damp State Pending inet.0 6 4 0 0 0 0 Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Damped.. 10.0.0.2 65002 54476 54460 0 1 7:17 4/4/0 0/0/0 10.0.0.4 65002 51527 51511 0 0 2w3d21h 0/2/0 0/0/0 10.0.0.6 65002 54459 54459 0 0 2w4d21h 0/0/0 0/0/0 user@R4> show bgp summary Groups: 2 Peers: 4 Down peers: 0 Table Tot Paths Act Paths Suppressed History Damp State Pending inet.0 8 4 0 0 0 0 Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Damped... 10.0.0.2 65002 51530 51532 0 1 8:59 2/4/0 0/0/0 10.0.0.3 65002 51512 51531 0 0 2w3d21h 0/0/0 0/0/0 10.0.0.6 65002 51515 51530 0 0 2w3d21h 0/0/0 0/0/0 10.1.45.2 65001 51520 51530 0 0 2w3d21h 2/4/0 0/0/0 user@R6> show bgp summary Groups: 1 Peers: 3 Down peers: 0 Table Tot Paths Act Paths Suppressed History Damp State Pending inet.0 6 4 0 0 0 0 Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Damped.. 10.0.0.2 65002 88610 88587 0 2 10:30 2/4/0 0/0/0 10.0.0.3 65002 54464 54468 0 1 2w4d22h 0/0/0 0/0/0 10.0.0.4 65002 51532 51520 0 0 2w3d21h 2/2/0
Sample output 1 shows a peer that is not established, while sample output 2 shows that all IBGP and EBGP sessions shown in the network diagram in Figure 15 are established.
Sample output 1 shows one peer (10.0.0.6) is not established, as indicated by the Down Peers: 1 field. The State|#Active/Received/Damped column also displays Active, indicating that the peer is in the Active state and not yet established.
The State|#Active/Received/Damped) column is a dual purpose field, as indicated by the pipe (|). When a peer is not established (as in our example), the field indicates the state of the peering session, such as active, connect, or idle. When the peer is in the Established state, the field displays the number of active, received, or damped routes received from the neighbor. For example, peer 10.0.0.6 is an example of the last column displaying the Active state, and peer 10.1.12.1 is an example of the last column showing the number of active, received, and damped routes (4/4/0). For more detailed information on the show bgp summary command, see the JUNOS Routing Protocols and Policies Command Reference.
If the BGP neighbor session is not established, use the ping and show route commands to verify network connectivity to the BGP neighbor. Also, use the show log messages command to look for any errors pertaining to the peer in question.
Sample output 2 shows that all IBGP and EBGP sessions shown in the network diagram in Figure 15 are established, as indicated by the Down Peers: 0 field and the last column that shows the number of routes.
Following is a description of the output for all established BGP peers, R2, R3, R4, and R6.
The route information for border router R2 shows the following:
The route information for internal router R3 shows the following:
The route information for border router R4 shows the following:
The route information for internal router R6 shows the following:
Other information in the sample output includes the following:
You can determine if a particular route that you have configured is being advertised by a neighbor.
To verify that a neighbor is advertising a particular route, enter the following JUNOS CLI operational mode command:
user@R2> show route advertising-protocol
bgp 10.0.0.4 inet.0: 20 destinations, 22 routes (20 active, 0 holddown, 0 hidden) Prefix Nexthop MED Lclpref AS path * 100.100.1.0/24 Self 5 200 65001 I * 100.100.2.0/24 Self 5 100 65001 I * 100.100.3.0/24 Self 100 65001 I * 100.100.4.0/24 Self 100 65001 I
The sample output shows the BGP routes advertised from R2 to its neighbor, 10.0.0.4 (R4). Out of 22 total routes in the inet.0 routing table, 20 are active destinations . No routes are hidden or in the hold-down state. Routes reside in the hold-down state prior to being declared active, and routes rejected by a routing policy can be placed into the hidden state. The information displayed reflects the routes that the routing table exported to the BGP routing protocol.
Display the routing information as it is received through a particular BGP neighbor and advertised by the local router to the neighbor.
To verify that a particular BGP route is received on your router, enter the following JUNOS CLI operational mode command:
user@R6> show route receive-protocol
bgp 10.0.0.2 inet.0: 18 destinations, 20 routes (18 active, 0 holddown, 0 hidden) Prefix Nexthop MED Lclpref AS path * 100.100.1.0/24 10.0.0.2 5 200 65001 I * 100.100.2.0/24 10.0.0.2 5 100 65001 I 100.100.3.0/24 10.0.0.2 100 65001 I 100.100.4.0/24 10.0.0.2 100 65001 I iso.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden) user@R6> show route receive-protocol bgp 10.0.0.4 inet.0: 18 destinations, 20 routes (18 active, 0 holddown, 0 hidden) Prefix Nexthop MED Lclpref AS path * 100.100.3.0/24 10.0.0.4 100 65001 I * 100.100.4.0/24 10.0.0.4 100 65001 I iso.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
The sample output shows four BGP routes from R2 and two from R4. Of the four routes from R2, only two are active in the routing table, as indicated by the asterisk (*), while both routes received from R4 are active in the routing table. All BGP routes came through AS 65001.