What is NEXT_HOP?
Next hop
NEXT_HOP is a mandatory BGP path attribute giving the IP address that traffic for a route should be forwarded to, normally the router that advertised it.
Every BGP route carries a NEXT_HOP. When a router installs the route, it looks up that address in its own routing table to find out how to reach it, a recursive lookup. If the next hop is unreachable, the route is not valid: it stays in the BGP table but can't be selected as best or installed. The rules for setting it differ by session type. On an eBGP session, the sending router normally sets the next hop to its own address on the link, so the receiver forwards traffic straight to it. On an iBGP session the next hop is passed on unchanged by default, so a core router learns the external neighbour's address, such as 203.0.113.0 on the edge router's upstream link. IPv6 routes, and other address families carried with multiprotocol BGP, put their next hop inside the MP_REACH_NLRI attribute rather than the original NEXT_HOP field, but the idea is the same.
The unchanged iBGP next hop is behind one of the most common BGP mistakes: internal routers see the routes but have no route to the next hop, so nothing is installed. There are two fixes. Either the border router uses next-hop-self so iBGP peers see its loopback, or the edge links are carried in the IGP. Next hop also shapes path selection, because BGP prefers the path whose next hop is closest by IGP metric ("hot-potato" routing). At Internet Exchanges, route servers usually leave the next hop as the original peer's address, so traffic flows directly between members. The BGP Fundamentals lesson covers path attributes and next-hop validity, and Edge and core shows next-hop-self in action.
Lessons that use NEXT_HOP
- BGP FundamentalsTeaches this term · Intermediate · 75 min
How the Border Gateway Protocol glues the internet together: autonomous systems, sessions, path attributes, best-path selection, iBGP scaling and a hands-on eBGP lab with real FRR configuration.
- OSPF FundamentalsBeginner · 70 min
The link-state IGP that runs inside most networks: neighbour adjacencies, LSA flooding, SPF, costs, DR/BDR, areas and LSA types, a hands-on FRR lab, and how OSPF underpins BGP.