Courseiva
BGPRouter Config

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.

Syntax·Router Config
neighbor <ip-address> next-hop-self

When 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-self
R1(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.0
BGP 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, best

R2 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

1.

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.

2.

CCNA exam tip: next-hop-self is configured on the ASBR toward the iBGP peers, not toward the eBGP peer.

3.

CCNA exam tip: The alternative is to redistribute the eBGP link subnet into the IGP — but next-hop-self is cleaner and more common.

4.

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.

Aspectneighbor [ip] next-hop-selfneighbor [ip] remote-as [asn]
PurposeForces router to advertise its own IP as next-hop for routes sent to iBGP neighborDefines BGP neighbor and its AS number to establish peering
ScopePer-neighbor (iBGP) modification of next-hop attributePer-neighbor mandatory parameter to initiate BGP session
Configuration ModeRouter(config-router)#Router(config-router)#
PersistenceOptional; applied after session is establishedRequired before session can be established
PrecedenceAffects route advertisement, not session stateDetermines iBGP (same AS) vs eBGP (different AS) session type
Typical UseOn eBGP-to-iBGP boundary routers to ensure iBGP peers have reachable next-hopOn 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

Practice for the CCNA 200-301

Test your knowledge with practice questions covering all CCNA 200-301 exam domains.

Practice CCNA 200-301 Questions