Wi-Fi & local networks · Offline reference

Gateway Reference

Interpret default routes and next hops for local and off-link destinations. No. That is a common convention. Use the router interface address specified by the design or supplied through the network's configuration mechanism.

Inputs

Result

Selection
All entries
Calculated or matching entries
Route or observationExampleInterpretation
On-link IPv4 route192.0.2.0/24 on eth0An ordinary Ethernet host can resolve 192.0.2.27 directly on that link.
Off-link destination198.51.100.8 via 192.0.2.1The frame goes to the next-hop interface. The IP destination remains the remote host.
IPv4 default0.0.0.0/0 via 192.0.2.1Used in this routing table when no longer prefix matches.
More specific route198.51.100.0/24 via 192.0.2.2This entry wins over the /0 for 198.51.100.8 when both are installed in the selected table.
IPv6 default::/0 via fe80::1 on lan0Link-local next hops need an outgoing link. Default routers are commonly learned in Router Advertisements.
Gateway value missingLocal subnet works but remote destinations failInspect the route selected for the actual destination and any configured policy table before assigning a default.
In this guide11 sections

Introduction

Interpret default routes and next hops for local and off-link destinations. No. That is a common convention. Use the router interface address specified by the design or supplied through the network's configuration mechanism.

Method and concepts

An active interface can supply a connected prefix. Operators can add static routes, and routing protocols can learn paths from neighbors. The routing process chooses eligible paths and installs forwarding entries. Preference rules and metrics depend on the implementation and protocol.

  1. Select an entry to isolate the relevant case.
  2. Read the associated evidence and compare it with your local configuration.

Routing fundamentals diagram

  1. Destination 198.51.100.190
  2. Match /0, /24 and /25
  3. Select /25
  4. Resolve 192.0.2.2 on transit link
For the entries below, the upper-half /25 matches more destination bits than either its /24 parent or the default route.

Worked examples

Read the On-link IPv4 route entry

  1. 192.0.2.0/24 on eth0
  2. An ordinary Ethernet host can resolve 192.0.2.27 directly on that link.

Routing fundamentals: Choose between a branch route and a summary

  1. Assume the router can directly reach next hops 192.0.2.1 and 192.0.2.2. Install the three example entries in the table.
  2. For 198.51.100.190, the /24 and the 198.51.100.128/25 both match. The /25 covers last octets 128–255, so select 192.0.2.2.
  3. For 198.51.100.42 the /25 misses and the /24 selects 192.0.2.1. For 203.0.113.10 neither specific route matches, so use the default.

Reference table

Gateway Reference reference
Route or observationExampleInterpretation
On-link IPv4 route192.0.2.0/24 on eth0An ordinary Ethernet host can resolve 192.0.2.27 directly on that link.
Off-link destination198.51.100.8 via 192.0.2.1The frame goes to the next-hop interface. The IP destination remains the remote host.
IPv4 default0.0.0.0/0 via 192.0.2.1Used in this routing table when no longer prefix matches.
More specific route198.51.100.0/24 via 192.0.2.2This entry wins over the /0 for 198.51.100.8 when both are installed in the selected table.
IPv6 default::/0 via fe80::1 on lan0Link-local next hops need an outgoing link. Default routers are commonly learned in Router Advertisements.
Gateway value missingLocal subnet works but remote destinations failInspect the route selected for the actual destination and any configured policy table before assigning a default.

Reading the result

A route from a branch to headquarters supplies only the outward decision. The reply has a different destination and each router looks it up independently. A valid return path may use different routers.

Common mistakes

  • Choosing the numerically lowest next-hop address before comparing destination prefixes.
  • Assuming two endpoints with different subnet masks agree about which destinations are on-link.

Frequently asked questions

Must the default gateway be the subnet's first host address?

No. That is a common convention. Use the router interface address specified by the design or supplied through the network's configuration mechanism.

Can a low-metric default route override an installed /24?

For ordinary destination-based forwarding in one table, the matching /24 is more specific. Metrics choose among eligible paths to a prefix during route selection.

Why does a packet need both an IP address and a MAC destination?

The IP address identifies the destination for routing across the internetwork. The link address delivers this frame to the next recipient on the local Ethernet segment.

What does a default route do?

It is a fallback route used when no more specific route matches the destination. It points the packet toward a next hop or outgoing interface.

Does a router send a frame directly to a remote server's MAC address?

No. On an Ethernet link, it resolves the next hop's local link-layer address. The remote destination's MAC address is not carried end to end across routed links.

How is the matching route chosen?

Forwarding generally uses longest-prefix match among valid routes, with routing protocol preference and local policy determining which routes enter the forwarding table.

Can two routes to the same prefix exist?

Yes. Routing protocols and static configuration can provide alternatives. The system selects among them using route preference, metrics, policy, and sometimes load-sharing rules.

What is the difference between a routing table and a neighbor table?

A routing table chooses an outgoing path or next hop for an IP destination. A neighbor table maps a directly reachable next-hop IP address to link-layer information on that link.

When is a static route useful?

A static route can provide a simple fixed path in a small or stable design. Dynamic routing is more suitable when paths or topology need to adapt automatically.

Does BGP choose routes based only on the shortest physical path?

No. BGP route selection considers attributes and policy between autonomous systems. The chosen path reflects administrative decisions as well as reachability information.

Can a router have a route without a working neighbor entry?

Yes. The route can be installed while next-hop resolution fails. Packets may then be queued or dropped until the adjacent neighbor becomes reachable.

What is equal-cost multipath routing?

ECMP allows a router to use multiple routes with equal selection cost for the same destination. Traffic may be distributed across paths according to the device's hashing and policy.

Does a route identify every router along the path?

Usually not. A route identifies a destination prefix and a next hop or interface. Each router independently selects its next step.

Why can the forward and return routes differ?

Routing is selected independently at each endpoint and hop. Policy, topology, load balancing, and failures can create asymmetric paths.

What does administrative distance mean?

Some router vendors use administrative distance or preference to choose among routes learned from different sources. The exact value and rules are platform-specific.

Can a default route create a routing loop?

Yes. Misconfigured default routes between routers can send traffic back and forth. TTL or hop-limit prevents indefinite circulation, but the loop still causes packet loss and delay.

Further learning and references