neighbor [ip] next-hop-self
Sets the router itself as the BGP next hop when advertising routes to iBGP peers.
Definition: neighbor [ip] next-hop-self is a Cisco IOS router config command. Forces a BGP router to advertise itself as the next hop for routes sent to a specific iBGP neighbor. Used on eBGP-to-iBGP boundary routers so that iBGP peers can reach eBGP-learned prefixes.
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.
neighbor [ip] next-hop-self vs neighbor [ip] remote-as [asn]
Both commands are configured under BGP router configuration and use the 'neighbor [ip]' syntax, which can lead to confusion. However, 'next-hop-self' modifies BGP path attributes for route advertisement, while 'remote-as' establishes the BGP peering session itself.
| Aspect | neighbor [ip] next-hop-self | neighbor [ip] remote-as [asn] |
|---|---|---|
| Purpose | Forces router to advertise its own IP as next-hop for routes sent to iBGP neighbor | Defines BGP neighbor and its AS number to establish peering |
| Scope | Per-neighbor (iBGP) modification of next-hop attribute | Per-neighbor mandatory parameter to initiate BGP session |
| Configuration Mode | Router(config-router)# | Router(config-router)# |
| Persistence | Optional; applied after session is established | Required before session can be established |
| Precedence | Affects route advertisement, not session state | Determines iBGP (same AS) vs eBGP (different AS) session type |
| Typical Use | On eBGP-to-iBGP boundary routers to ensure iBGP peers have reachable next-hop | On any router that needs to form a BGP peering |
Use neighbor [ip] next-hop-self when you need an iBGP router to advertise its own IP as the next-hop for routes learned via eBGP, so that iBGP peers can reach those prefixes without an IGP route to the original next-hop.
Use neighbor [ip] remote-as [asn] when you need to define a BGP peer and establish a BGP session, whether iBGP (same AS) or eBGP (different AS).
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 practice questions covering all CCNA 200-301 exam domains.
Practice CCNA 200-301 Questions