Configure And Verify
3.2.c Configure and verify eBGP between directly connected neighbors (best path selection algorithm and neighbor relationships)
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:
- Two routers form a TCP session on port 179.
- They exchange routes with path attributes.
- BGP chooses the best path by comparing the attributes.
- 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.
Example: two ASes on a direct link
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/32R1:
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.255R2:
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.255Note: 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 1Read the last column:
- A number under
State/PfxRcdmeans the session is Established. The number is prefixes received. - A word like
IdleorActivemeans 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: 0x0The AS path shows 65002. The route is external and best.
Neighbor states
| State | Meaning | Check |
|---|---|---|
Idle | BGP is not trying, or a failure reset the session | Neighbor config, remote AS, reachability |
Connect | Waiting for TCP to complete | IP reachability, TCP 179 not blocked |
Active | Still trying to connect | Despite the name, the session is down |
OpenSent | Open message sent, waiting for reply | AS numbers, router ID |
OpenConfirm | Waiting for keepalive | Usually transient |
Established | Session up, routes exchanged | Correct state |
Best path selection order
When BGP has many paths to one prefix, it compares attributes in this order:
- Highest weight (Cisco local, not advertised).
- Highest local preference.
- Locally originated route.
- Shortest AS path.
- Lowest origin code (IGP < EGP < incomplete).
- Lowest Multi-Exit Discriminator (MED).
- eBGP path over iBGP path.
- Lowest IGP metric to the next hop.
- Oldest eBGP path.
- 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:
- Address the link and the loopbacks per the example.
- Ping from R1 to R2 on the link address. Fix Layer 3 before you touch BGP.
- Configure BGP on R1 and R2 with the configs above.
- Verify with
show bgp ipv4 unicast summary. The state must be a number. - Verify the route with
show bgp ipv4 unicastandshow ip route bgpon both routers. - Break the session: change the R2
remote-ason R1 to 65003. Watch the state inshow bgp ipv4 unicast summary. Explain the state you see. - Restore the correct remote AS. Confirm the session returns to Established.
- Remove the
networkstatement on R2. Checkshow bgp ipv4 unicaston R1. Explain why the prefix is gone. - Restore the network statement. Verify the final state.
Exam traps
Activeis not "working".Establishedis working.- BGP uses TCP port 179. IP reachability must exist first.
- The
networkcommand advertises an existing route. It does not create one. - Direct eBGP neighbors use TTL 1. Loopback peering needs
ebgp-multihopandupdate-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 summaryand 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
- 3.2.a Compare routing concepts of EIGRP and OSPF (advanced distance vector vs. link state, load balancing, path selection, path operations, metrics, and area types)
- 3.2.b Configure simple OSPFv2/v3 environments, including multiple normal areas, summarization, and filtering (neighbor adjacency, point-to-point, and broadcast network types, and passive-interface)
- 3.2.d Describe policy-based routing