Skip to content
Study CCNP

Configure And Verify

3.2.c Configure and verify eBGP between directly connected neighbors (best path selection algorithm and neighbor relationships)

4 min read ENCOR 350-401 v1.2 Updated

Aligned to Cisco's 350-401 ENCOR v1.2 exam topics.

On this page

What this objective tests

The objective says "configure and verify". The exam wants a working external Border Gateway Protocol (eBGP) session between two directly connected routers. You must also read the neighbor state and explain basic best path selection.

BGP is a path-vector protocol. The clean mental model:

  1. Two routers form a TCP session on port 179.
  2. They exchange routes with path attributes.
  3. BGP chooses the best path by comparing the attributes.
  4. The best path enters the routing table when the next hop is reachable.

External BGP means the two routers use different autonomous system (AS) numbers.

Topology:

R1 -- AS 65001 -- Lo0 10.1.1.1/32
   Gi0/0 192.0.2.1/30
        |
   Gi0/0 192.0.2.2/30
R2 -- AS 65002 -- Lo0 10.2.2.2/32

R1:

interface Loopback0
 ip address 10.1.1.1 255.255.255.255
!
interface GigabitEthernet0/0
 description To R2
 ip address 192.0.2.1 255.255.255.252
 no shutdown
!
router bgp 65001
 bgp router-id 10.1.1.1
 bgp log-neighbor-changes
 neighbor 192.0.2.2 remote-as 65002
 network 10.1.1.1 mask 255.255.255.255

R2:

interface Loopback0
 ip address 10.2.2.2 255.255.255.255
!
interface GigabitEthernet0/0
 description To R1
 ip address 192.0.2.2 255.255.255.252
 no shutdown
!
router bgp 65002
 bgp router-id 10.2.2.2
 bgp log-neighbor-changes
 neighbor 192.0.2.1 remote-as 65001
 network 10.2.2.2 mask 255.255.255.255

Note: The BGP network command does not create a route. It advertises a prefix that already exists in the local routing table. The loopbacks above satisfy this rule.

Expected verification output

R1# show bgp ipv4 unicast summary
BGP router identifier 10.1.1.1, local AS number 65001
BGP table version is 3, main routing table version 3
2 network entries using 496 bytes of memory
2 path entries using 272 bytes of memory
1/1 BGP path/bestpath attribute entries using 272 bytes of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 1064 total bytes of memory

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
192.0.2.2       4        65002      47      48        3    0    0 00:40:12        1

Read the last column:

  • A number under State/PfxRcd means the session is Established. The number is prefixes received.
  • A word like Idle or Active means the session is down.

Check the learned route:

R1# show bgp ipv4 unicast 10.2.2.2
BGP routing table entry for 10.2.2.2/32, version 3
Paths: (1 available, best #1, table default)
  Not advertised to any peer
  Refresh Epoch 1
  65002
    192.0.2.2 from 192.0.2.2 (10.2.2.2)
      Origin IGP, metric 0, localpref 100, valid, external, best
      rx pathid: 0, tx pathid: 0x0

The AS path shows 65002. The route is external and best.

Neighbor states

StateMeaningCheck
IdleBGP is not trying, or a failure reset the sessionNeighbor config, remote AS, reachability
ConnectWaiting for TCP to completeIP reachability, TCP 179 not blocked
ActiveStill trying to connectDespite the name, the session is down
OpenSentOpen message sent, waiting for replyAS numbers, router ID
OpenConfirmWaiting for keepaliveUsually transient
EstablishedSession up, routes exchangedCorrect state

Best path selection order

When BGP has many paths to one prefix, it compares attributes in this order:

  1. Highest weight (Cisco local, not advertised).
  2. Highest local preference.
  3. Locally originated route.
  4. Shortest AS path.
  5. Lowest origin code (IGP < EGP < incomplete).
  6. Lowest Multi-Exit Discriminator (MED).
  7. eBGP path over iBGP path.
  8. Lowest IGP metric to the next hop.
  9. Oldest eBGP path.
  10. Lowest neighbor router ID.

For ENCOR, the first eight steps cover most questions.

Lab: bring up eBGP and break it

Topology: the two-router diagram from the example above.

Do these steps:

  1. Address the link and the loopbacks per the example.
  2. Ping from R1 to R2 on the link address. Fix Layer 3 before you touch BGP.
  3. Configure BGP on R1 and R2 with the configs above.
  4. Verify with show bgp ipv4 unicast summary. The state must be a number.
  5. Verify the route with show bgp ipv4 unicast and show ip route bgp on both routers.
  6. Break the session: change the R2 remote-as on R1 to 65003. Watch the state in show bgp ipv4 unicast summary. Explain the state you see.
  7. Restore the correct remote AS. Confirm the session returns to Established.
  8. Remove the network statement on R2. Check show bgp ipv4 unicast on R1. Explain why the prefix is gone.
  9. Restore the network statement. Verify the final state.

Exam traps

  • Active is not "working". Established is working.
  • BGP uses TCP port 179. IP reachability must exist first.
  • The network command advertises an existing route. It does not create one.
  • Direct eBGP neighbors use TTL 1. Loopback peering needs ebgp-multihop and update-source.
  • BGP best path and routing-table installation are separate steps. The next hop must be reachable.

Pass check

You are ready when you can do these things:

  • Build an eBGP session between two directly connected routers from memory.
  • Read show bgp ipv4 unicast summary and state the session health in one sentence.
  • Name the neighbor states in order and the usual cause for a stuck state.
  • List the first eight best path steps in order.

Related objectives