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

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

On this page

BGP is a path-vector routing protocol. For ENCOR, the focus is not internet-scale policy. It is basic eBGP between directly connected neighbors, neighbor state, and best path selection.

The clean mental model:

  1. Two routers form a TCP session on port 179.
  2. They exchange BGP routes called NLRI.
  3. Each route carries path attributes.
  4. BGP chooses the best path using those attributes.
  5. The best BGP route is installed only if the next hop is reachable and the route beats alternatives by administrative distance.
R1 AS 65001 ↔ R2 AS 65002 · TCP/179 -> OPEN -> KEEPALIVE -> UPDATE · NLRI -> show ip bgp summary · State Established

External BGP expects different autonomous systems on each side. iBGP between routers in the same AS uses different next-hop and loop-prevention rules.

Directly connected eBGP topology

R1 · AS 65001 · Lo0 192.0.2.1/32
10.12.0.0/30
R2 · AS 65002 · Lo0 192.0.2.2/32

R1:

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

R2:

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

Verify:

show ip bgp summary
show ip bgp
show ip route bgp
show ip bgp neighbors 10.12.0.2

The network command requirement

In BGP, network 192.0.2.1 mask 255.255.255.255 does not create the route. It tells BGP to advertise the route if the exact prefix already exists in the local routing table.

If the route is missing, BGP will not advertise it.

Check:

show ip route 192.0.2.1
show ip bgp 192.0.2.1

A loopback interface or static route can satisfy the requirement.

Neighbor states

Common BGP states:

StateMeaning
IdleBGP is not connected. Check neighbor address, AS, reachability, ACLs.
ConnectTrying to establish TCP. Check IP path and port 179.
ActiveStill trying. Despite the name, this often means not established.
OpenSent/OpenConfirmBGP open messages are in progress.
EstablishedNeighbor is up and exchanging routes.

If show ip bgp summary shows a number under State/PfxRcd, the session is established and the number is prefixes received. If it shows a word like Idle or Active, it is not established.

Direct eBGP troubleshooting

Check in this order:

ping 10.12.0.2
show ip interface brief
show run | section router bgp
show ip bgp summary
show tcp brief | include 179
show access-lists

Common problems:

  • Wrong neighbor IP.
  • Wrong remote AS.
  • Interface down.
  • No IP reachability.
  • ACL blocking TCP 179.
  • Using loopback peering without update-source and ebgp-multihop.

For directly connected physical-interface peering, you usually do not need ebgp-multihop.

Basic best path selection

BGP best path selection has many steps. For ENCOR, understand the common early tie-breakers:

  1. Highest weight. Cisco-local, not advertised.
  2. Highest local preference. Local AS-wide preference.
  3. Locally originated routes.
  4. Shortest AS path.
  5. Lowest origin code.
  6. Lowest MED.
  7. eBGP preferred over iBGP.
  8. Lowest IGP metric to next hop.

You do not need to memorize every later tie-breaker for basic ENCOR work, but you should recognize why a route with a shorter AS path can beat another route, and why changing local preference affects outbound path choice.

Best path lab

Add a second path from R1 to the same prefix through R3.

R2 · AS 65002 · advertises 203.0.113.0/24
R1 · AS 65001 · chooses best BGP path
R3 · AS 65003 · alternate eBGP path

On R1, inspect routes:

show ip bgp 203.0.113.0

Change local preference for routes learned from R3:

route-map PREFER-R3 permit 10
 set local-preference 200
!
router bgp 65001
 neighbor 10.13.0.3 route-map PREFER-R3 in
 clear ip bgp 10.13.0.3 soft in

Verify best path changed:

show ip bgp 203.0.113.0
show ip route 203.0.113.0

Directly connected IPv6 eBGP example

R1:

ipv6 unicast-routing
!
interface Loopback0
 ipv6 address 2001:db8:1::1/128
!
interface gi0/0
 ipv6 address 2001:db8:12::1/64
!
router bgp 65001
 neighbor 2001:db8:12::2 remote-as 65002
 address-family ipv6
  neighbor 2001:db8:12::2 activate
  network 2001:db8:1::1/128
 exit-address-family

The IPv6 network statement has the same habit as IPv4: it advertises an exact prefix that already exists in the local IPv6 RIB. It does not create the route. This example advertises the connected Loopback0 /128; a /64 network statement would require an exact /64 route in the IPv6 RIB.

Verify:

show ipv6 route 2001:db8:1::1/128
show bgp ipv6 unicast summary
show bgp ipv6 unicast
show ipv6 route bgp

Exam traps

  • Active is not “working.” Established is working.
  • BGP uses TCP 179. IP reachability must exist first.
  • The network command advertises an existing route; it does not create one.
  • eBGP direct neighbors usually use TTL 1. Loopback peering needs extra config.
  • BGP best path and routing-table installation are separate. The BGP best path still needs a reachable next hop and must win against other route sources.

Quick checklist

  1. Can the peers ping each other?
  2. Are the local AS and remote AS correct?
  3. Is TCP 179 allowed?
  4. Is the BGP state Established?
  5. Does the advertised prefix exist in the local routing table?
  6. Is the BGP next hop reachable?
  7. Which BGP attribute explains the selected best path?