Routing Table Fields Explained: Next Hop, Exit Interface, Metric, and Gateway

Next Hop, Exit Interface and Metric – Fields in a Routing Table

In the previous tutorial, we discussed how network addresses are used in the routing table. In this one, we’ll look into a few more fields you’ll commonly see in a routing table – like Next Hop, Exit Interface, and Metric.

If you haven’t already gone through the basics of routing, static and dynamic routing, you can check this introduction to routing first.


Next Hop

Next hop simply means the next router (or next device) to which a packet should be forwarded in order to reach the destination network.

When a router receives a packet, it checks the destination IP and looks into its routing table. If the destination is not directly connected, it will send the packet to another router – and that router is called the next hop.

Example:

Diagram showing three routers — R1 (1.1.1.1), R2 (1.1.1.2), and R3 (1.1.1.3) — connected to a common subnet. R2 connects to network 2.2.2.0/24 and R3 connects to 3.3.3.0/24. R1 forwards packets to these networks via next hops 1.1.1.2 and 1.1.1.3 respectively.
R1 routing to remote networks via next-hop gateways R2 and R3

In the above topology :
R1 has IP 1.1.1.1/24
R2 has IP 1.1.1.2/24
R3 has IP 1.1.1.3/24

All three are connected to the same switch (so part of the same network).

  • R2 is also connected to network 2.2.2.0/24
  • R3 is connected to network 3.3.3.0/24

Now, if we look from R1’s perspective:

  • To reach 2.2.2.0/24, R1 will send packets to R2, so 1.1.1.2 becomes the next hop.
  • To reach 3.3.3.0/24, it will send to R3, so 1.1.1.3 is the next hop.

So in R1’s routing table, we’ll have something like:

2.2.2.0/24   via 1.1.1.2

3.3.3.0/24   via 1.1.1.3

You can remember it this way:

Next hop = IP of the facing router you’ll send the packet to.

Also note: The next hop IP will always be on the same network as the interface we’re sending the packet out from.


Exit Interface

Exit interface is the interface on our router that will be used to send the packet out.

For example, if R1 is using interface eth0 to connect to R2 and R3, then the routing table may also show:

2.2.2.0/24   via 1.1.1.2   dev eth0

3.3.3.0/24   via 1.1.1.3   dev eth0

That just means — “to reach this destination, send the packet via this interface, to this next hop.”

In some setups (like point-to-point links), routers may only show the interface instead of next hop — but both serve the same purpose: how and where to forward the packet.


Metric

Metric is used when there are multiple possible paths to reach the same destination.

Let’s say a router has two ways to reach the same network. How does it decide which one to use?
It picks the one with the lowest metric.

Think of metric as the cost or distance to reach a network. Lower metric = preferred path.

Different routing protocols calculate metric differently:

  • RIP uses hop count
  • OSPF uses bandwidth
  • EIGRP uses delay, bandwidth, and a few other things

You don’t need to go deep into how each protocol works right now — but just remember:

Routers use metric to choose the best path among multiple options.


Gateway

The term Gateway can have slightly different meanings depending on the context.

1. Gateway as a general term for a router

Before the term “router” became popular, people used the word gateway to refer to a device that forwards packets between networks. So in some explanations, especially older ones, you might still hear phrases like:

“There are multiple gateways in the path to reach the destination.”

In this case, gateway just means a router.

2. Gateway as Next Hop

Often, gateway is used in place of next hop.
For example, in the topology above, we can say:

“The gateway to reach 2.2.2.0/24 is 1.1.1.2”

So here, gateway and next hop are the same thing — the IP of the next router.

3. Gateway configured on a PC

When you assign an IP address to a PC, you usually also configure a default gateway.

For example:

  • IP address = 1.2.3.1/24
  • Gateway = 1.2.3.100

Here, the gateway is the IP of the router interface that the PC will use to send packets outside its own subnet.

Internally, when you set a gateway like this, the system automatically adds a default route in the PC’s routing table:

0.0.0.0/0   via 1.2.3.100

This default route means — “send any packet that doesn’t match a more specific route to 1.2.3.100.”

So in this context, gateway is the next hop for the default route.


Summary

  • Next Hop → IP address of the next router (on the same subnet) to send the packet to.
  • Exit Interface → The interface through which the packet should be sent.
  • Metric → Used to pick the best path when multiple routes exist.
  • Gateway → Can mean a router, the next hop IP, or the default router used by a PC.


We’d love to hear your feedback and suggestions about this article. Feel free to reach out to us using the WhatsApp number below.

Sajith Achipra has been a trainer and testing consultant at Zframez Technologies since 2009. With 15+ years of experience, he specializes in networking, Python, development, and testing. He conducts online courses to help students and professionals enhance their skills. You can reach him on WhatsApp at +91 8884 884 844 for your training and testing requirements.