Home CCNA What Is the Next-Hop in Networking?
CCNA

What Is the Next-Hop in Networking?

Network Topology Diagram Showing Four Routers (Router0 To Router3) With Labeled Ip Addresses And Next-Hop Connections

The next-hop is the IP address of the next router a packet is forwarded to on its way toward its final destination. When a router receives a packet, it looks up the destination in its routing table and forwards the packet to the next-hop — the immediately adjacent router along the best path. That router then repeats the process, and so on, until the packet reaches its destination.

Understanding the next-hop is fundamental to how routing works. This article explains what a next-hop is, how a router chooses one, the three ways a next-hop can be specified in a static route, and how to verify next-hop reachability — all using a single, consistent example topology so you can follow along without confusion.

How a Router Chooses the Next-Hop

Each router maintains a routing table containing the best-known path to each destination network, along with the next-hop address (or exit interface) for that path. When a packet arrives, the router doesn’t just pick the “lowest metric” blindly — route selection follows a clear order:

  1. Longest prefix match: The router first finds the most specific route that matches the packet’s destination — the one with the longest matching subnet mask. A route to 192.168.20.0/24 is preferred over a less specific 192.168.0.0/16 for a destination in that range.
  2. Administrative distance: If more than one routing source (for example, static vs. OSPF) offers a route to the same destination, the router prefers the source with the lowest administrative distance — a measure of how trustworthy each route source is.
  3. Metric: If a single routing protocol offers multiple paths to the same destination, the router uses that protocol’s metric to break the tie. The metric varies by protocol — hop count for RIP, cost based on bandwidth for OSPF, or a composite metric for EIGRP.

The next-hop, then, is the address associated with whichever route wins this selection process. In a static route, the administrator defines the next-hop manually; with a dynamic routing protocol, the next-hop is learned and updated automatically as network conditions change.

Next-Hop vs. Hop Count

It’s worth clearing up a common point of confusion. The next-hop is which router a packet is forwarded to next. Hop count is something different — it’s a metric (used by RIP) that counts how many routers a packet must pass through to reach its destination. Each router a packet crosses is one “hop.” So if a destination is 10 hops away, the packet passes through 10 routers, and hop count could be used to compare paths. But hop count is just one possible metric for choosing a route; the next-hop is the result of that choice.

Example Network Topology

Packet Tracer Diagram For Illustrating Next Hop What Is The Next-Hop In Networking?
What Is The Next-Hop In Networking? 5

To keep everything concrete and consistent, consider a network with three routers — Router0, Router1, and Router2 — connected in a line, each also serving its own local (LAN) network.

Router-to-router links:

  • Router0 ↔ Router1 over network 10.10.10.0/30 — Router0’s interface is 10.10.10.1 (Gig0/0), Router1’s is 10.10.10.2 (Gig0/0).
  • Router1 ↔ Router2 over network 172.16.0.0/30 — Router1’s interface is 172.16.0.1 (Gig0/1), Router2’s is 172.16.0.2 (Gig0/0).

Local networks:

  • Router0 serves 192.168.10.0/24 (Router0 = 192.168.10.1, Gig0/1).
  • Router1 serves 192.168.20.0/24 (Router1 = 192.168.20.1, Gig0/2).
  • Router2 serves 192.168.30.0/24 (Router2 = 192.168.30.1, Gig0/1).

By default, each router only knows about the networks directly connected to it. It won’t know how to reach any other network until a static route or a dynamic routing protocol tells it the next-hop.

Router0 Routing Table

With no static or dynamic routes configured, Router0 knows only its directly connected networks:

C   10.10.10.0/30 is directly connected, GigabitEthernet0/0
C   192.168.10.0/24 is directly connected, GigabitEthernet0/1

Router0 knows the link to Router1 and its own LAN — but nothing beyond Router1.

Router1 Routing Table

Router1 sits in the middle, so it has three directly connected networks:

C   10.10.10.0/30 is directly connected, GigabitEthernet0/0
C   172.16.0.0/30 is directly connected, GigabitEthernet0/1
C   192.168.20.0/24 is directly connected, GigabitEthernet0/2

Router1 knows both router links and its own LAN, but not Router0’s or Router2’s local networks.

Router2 Routing Table

Router2 knows only its link to Router1 and its own LAN:

C   172.16.0.0/30 is directly connected, GigabitEthernet0/0
C   192.168.30.0/24 is directly connected, GigabitEthernet0/1

Notice the pattern: each router’s table lists only directly connected networks (marked C) and its own interface IP (marked L) Not shown here in the sample. To reach anything else, we need to supply a next-hop.

Routing Table Before And After
What Is The Next-Hop In Networking? 6

Verifying Next-Hop Connectivity

A quick way to see this in action is with ping. Because Router0 has 10.10.10.0/30 directly connected, it can reach Router1’s near-side interface at 10.10.10.2:

Router0> ping 10.10.10.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/0 ms

The ping succeeds because 10.10.10.0/30 is in Router0’s routing table as a directly connected network.

Now try to ping addresses on networks Router0 doesn’t have a route to — Router1’s other interface (172.16.0.1) and Router1’s LAN (192.168.20.1):

Router0> ping 172.16.0.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.0.1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
Router0> ping 192.168.20.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.20.1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)

Both pings fail because Router0 has no routing-table entry for 172.16.0.0/30 or 192.168.20.0/24 — it simply doesn’t know where to send the packets. This is exactly the problem a next-hop solves: we tell Router0 which adjacent router to forward those packets to.

You can download the same packet tracer file from here without further configuration. You can try further configuration with the help of this guide with us.

The Three Ways to Specify a Next-Hop in a Static Route

When configuring a static route on Cisco IOS, you can identify the next-hop in three ways. The examples below are all configured on Router0 to reach Router1’s LAN (192.168.20.0/24), whose next-hop is Router1 at 10.10.10.2.

E Static Route Types
What Is The Next-Hop In Networking? 7

1. Next-Hop Route

Specify only the next-hop IP address:

Router0(config)# ip route 192.168.20.0 255.255.255.0 10.10.10.2

Router0 will forward packets destined for 192.168.20.0/24 to 10.10.10.2 (Router1), which then handles the next leg.

2. Directly Connected Static Route (Exit Interface)

Specify only the local exit interface:

Router0(config)# ip route 192.168.20.0 255.255.255.0 GigabitEthernet0/0

Router0 will send packets for 192.168.20.0/24 out its GigabitEthernet0/0 interface. This form is typically used on point-to-point links, where there’s only one possible device at the other end.

3. Fully Specified Static Route

Specify both the exit interface and the next-hop IP address:

Router0(config)# ip route 192.168.20.0 255.255.255.0 GigabitEthernet0/0 10.10.10.2

This combines both, which is useful and recommended on multi-access networks (like Ethernet segments with more than two devices), where specifying only an exit interface could be ambiguous.

Troubleshooting a Missing Next-Hop

If traffic isn’t reaching a destination, a few commands help diagnose a next-hop problem:

  • show ip route — check whether a route to the destination network actually exists, and what next-hop or interface it uses.
  • show ip interface brief — confirm the relevant interfaces are up and have the expected IP addresses.
  • ping the next-hop address — verify the adjacent router is reachable.

If no route exists, add a static route (or configure a dynamic routing protocol) so the router learns the correct next-hop.

Summary

The next-hop is the address of the next router along the best path to a destination, stored in each router’s routing table. A router selects the route — and therefore the next-hop — using longest-prefix match first, then administrative distance between route sources, then the protocol metric. By default, routers know only their directly connected networks, which is why pings to unknown networks fail until a next-hop is supplied. On Cisco IOS, a static route can specify the next-hop as an IP address, an exit interface, or both. Master this, and you’ve grasped one of the core mechanics of how packets find their way across an internetwork.

Frequently Asked Questions

What is a next-hop in routing?

The next-hop is the next router a packet is forwarded to on the way to its destination, determined by the router's routing table based on the best matching route.

How is the next-hop selected?

The router chooses the best route using longest-prefix match first, then administrative distance (if multiple route sources exist), then the routing protocol's metric (such as hop count for RIP or bandwidth-based cost for OSPF). The next-hop is the address tied to the winning route.

Why did my ping fail from Router0 to 172.16.0.1?

Because Router0 has no routing-table entry for the 172.16.0.0/30 network, so it doesn't know where to forward the packet. Configuring a static route or a dynamic routing protocol to provide the next-hop fixes this.

What is the difference between a next-hop and an exit interface?

A next-hop specifies the IP address of the next router, while an exit interface specifies the local interface to send packets out of. Exit-interface routes are common on point-to-point links; a fully specified route uses both.

How can I troubleshoot a missing next-hop?

Use show ip route to check for a matching route, show ip interface brief to confirm interface status and addressing, and ping the next-hop to test reachability. Add a static route if one is missing.

Can the next-hop change dynamically?

Yes. With dynamic routing protocols such as OSPF or EIGRP, the next-hop is updated automatically when the network topology changes — for example, if a link fails and traffic must take a different path.
Avatar Of Muhammad Khattak
Muhammad Khattak

Author

Routing and switching specialist, CCNA certified, with extensive experience in network configuration and troubleshooting. Covers OSPF, EIGRP, VLAN management, and advanced routing concepts.

Related Articles