neighbor [ip] next-hop-self
Sets the router itself as the BGP next hop when advertising routes to iBGP peers.
neighbor <ip-address> next-hop-selfWhen to Use This Command
- ASBR (AS boundary router) advertising eBGP-learned routes to iBGP peers in the same AS.
- Preventing unreachable next-hop issues for iBGP peers who don't know the eBGP peer's IP.
- Required when iBGP peers are not directly connected to external peers.
- Standard practice on all eBGP-facing routers that also have iBGP peers.
Command Examples
ASBR advertising eBGP routes to iBGP peer with next-hop-self
R1(config)# router bgp 65001
R1(config-router)# neighbor 203.0.113.1 remote-as 100
R1(config-router)# neighbor 10.0.0.2 remote-as 65001
R1(config-router)# neighbor 10.0.0.2 next-hop-selfR1(config-router)#
R1 peers eBGP with 203.0.113.1 (ISP) and iBGP with 10.0.0.2 (internal router). Without next-hop-self, R2 would see 203.0.113.1 as the next hop for ISP routes — but R2 has no route to the ISP link subnet. With next-hop-self, R1 advertises itself (10.0.0.1) as next hop.
Verify next hop in iBGP peer's table
R2# show ip bgp 198.51.100.0BGP routing table entry for 198.51.100.0/24, version 3
Paths: (1 available, best #1, table default)
Advertised to update-groups:
1
100
10.0.0.1 from 10.0.0.1 (10.0.0.1)
Origin IGP, localpref 100, valid, internal, bestR2 sees 10.0.0.1 (R1's loopback) as the next hop for the eBGP prefix. R2 can reach 10.0.0.1 via OSPF, so the route is installed as valid and best.
Understanding the Output
No direct output. Verify on the iBGP peer with 'show ip bgp [prefix]' — the next hop should be the ASBR's IP (not the external eBGP peer's IP). Without next-hop-self, iBGP peers receive routes with an unreachable next hop and mark them as invalid.
CCNA Exam Tips
CCNA exam tip: The classic iBGP failure scenario is iBGP peers receiving routes but marking them invalid because the next-hop (eBGP peer IP) is unreachable — next-hop-self fixes this.
CCNA exam tip: next-hop-self is configured on the ASBR toward the iBGP peers, not toward the eBGP peer.
CCNA exam tip: The alternative is to redistribute the eBGP link subnet into the IGP — but next-hop-self is cleaner and more common.
CCNA exam tip: iBGP does not change the next hop when re-advertising routes — next-hop-self overrides this behavior.
Common Mistakes
Mistake 1: Applying next-hop-self on the wrong direction — it must point toward iBGP peers, not the eBGP peer.
Mistake 2: Forgetting next-hop-self in an iBGP full-mesh — routes exist in the BGP table but show as 'inaccessible' or 'invalid'.
Mistake 3: Assuming next-hop-self is automatic — it is always a manual configuration.
Related Commands
neighbor [ip] remote-as [asn]
Defines a BGP neighbor (peer) by specifying its IP address and AS number. If the remote AS matches the local AS, this creates an iBGP session; if different, it creates an eBGP session.
neighbor [ip] update-source [interface]
Specifies the source interface for BGP TCP sessions to a neighbor. Used in iBGP configurations to source sessions from a loopback interface for stability — if the physical link fails but another path exists, the loopback remains reachable and the session stays up.
show ip bgp
Displays the BGP routing table, showing learned BGP routes and their attributes, used for troubleshooting BGP path selection and verifying route advertisement.
Practice for the CCNA 200-301
Test your knowledge with hundreds of CCNA practice questions covering all exam domains.
Practice CCNA Questions