Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

Default Gateway

Direct answer

The default gateway is the route for 0.0.0.0/0 (and ::/0): where packets go when no more specific route matches.

When to use this

Use it when a host reaches its own subnet but nothing beyond it.

First 30 seconds

1. ip route show default — present and on the right interface?

2. ping <gateway> and ip neigh show <gateway> — reachable and resolved?

3. Two defaults? Check metrics: ip route show default.

4. IPv6: ip -6 route show default (from RA?).

5. Fix in the network tool and reconnect.

Operational verification

default route configured or learned → gateway on a connected subnet → ARP/ND resolves it → off-subnet packets forwarded

Evidence · next step

For Linux Networking → Default Gateway, continue with the first unproven Topic check: Identify the exact default route selected for the failing source/destination context. If that boundary is healthy, advance to the adjacent check: Check interface state, gateway prefix/on-link semantics and neighbor entry. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.

Continue only after interpreting the current observation.
Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
linux
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformlinux
Key commandip route show default
Scope / prerequisiteUse it when a host reaches its own subnet but nothing beyond it.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

5 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Operational evidence path Verify boundary

packet with no more-specific match → policy rule/table → selected default route → gateway/on-link validation → neighbor resolution → upstream forwarding → return path → workload

Healthy evidence: the intended source selects the intended default route, the gateway is neighbor-resolvable on the correct interface and traffic reaches/returns from the actual remote destination.

Step 2 Verification and output interpretation Verify boundary

Existing fast checks for this Topic. - Identify the exact default route selected for the failing source/destination context.

  • Check interface state, gateway prefix/on-link semantics and neighbor entry.
  • Look for competing default routes created by NetworkManager, DHCP, Netplan or static configuration.
  • Test the original remote destination and return path, not only the gateway IP.

Verification chain. packet with no more-specific match → policy rule/table → selected default route → gateway/on-link validation → neighbor resolution → upstream forwarding → return path → workload

Step 3 Commands Verify boundary
ip route show default
ping -c2 $(ip route show default | awk '{print $3}')
Step 4 Failure modes and next checks Narrow the fault

Suspicious evidence: a stale or DHCP-created default wins unexpectedly, the gateway is off-link, multiple defaults cause source-sensitive behavior, or gateway ping works while upstream forwarding fails.

Step 5 Common mistakes Narrow the fault
  • Two default routes with the same metric.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points

Only one default route should normally be active per address family, or set clear metrics. The gateway must be on a directly connected subnet. IPv6 often learns its default route from router advertisements.

Key checks
  • ip -br addr — interfaces and addresses
  • ip route — routing table and default route
  • ip neigh — ARP/neighbour cache
  • ip route get <dest> — route, interface and source chosen for a destination
  • nmcli device status / networkctl — which tool manages each interface
ReferenceWhat it is1 section · depth on demand

Core model

Verify which default route is selected for the exact source/namespace and whether multiple defaults or managers compete. Confirm the gateway is reachable on the intended L2 segment or that the route explicitly encodes on-link behavior, then test beyond the gateway to separate local default-route success from upstream forwarding.

ReferenceImportant terms & boundaries5 sections · depth on demand

What this shows and what it does not

Reachability to a default gateway shows only the first routed hop from the host, but it does not show upstream routes, NAT, DNS or remote service availability.

In depth

Default gateways on Linux

A default gateway is simply the route for default (0.0.0.0/0 or ::/0) in the routing table. Linux has no separate "gateway" setting at the kernel level. ip-route(8) supports several properties that matter for default routes:

  • Preference: metric (also called preference) decides between several default routes. Lower values win.
  • Multipath: nexthop ... weight creates a multipath default with relative weights.
  • Source address: src sets the source address the host uses through that gateway.
  • onlink: treats the gateway as directly attached even if it doesn't match any interface prefix. It's needed for some cloud and point-to-point setups.

Where default routes come from

SourceTypical protoMetric
DHCP via NetworkManager or networkddhcpPer-connection, often 100 + interface order
Static configurationstaticAs configured
IPv6 Router AdvertisementsraSet by the RA client
Manual ip route add defaultboot0 unless specified

Several interfaces, several defaults

A laptop on Wi-Fi and Ethernet, or a server with two uplinks, often ends up with two default routes. The lowest metric is used, and the other is a backup only if its interface goes down. Policy routing with separate tables per uplink makes each uplink usable for its own source address.

host$ ip route show default
default via 10.110.0.1 dev eth0 proto dhcp src 10.110.0.64 metric 100
default via 192.168.50.1 dev wlan0 proto dhcp src 192.168.50.23 metric 600
host$ ip -6 route show default
default via fe80::1 dev eth0 proto ra metric 1024 expires 1794sec pref medium
host$ sudo ip route replace default via 10.110.0.1 dev eth0 metric 50
host$ sudo ip route add default via 203.0.113.1 dev eth1 table 100
host$ sudo ip rule add from 203.0.113.20 table 100
host$ ip route get 1.1.1.1 from 203.0.113.20

Checking reachability of the gateway itself

CheckCommand
The gateway's neighbour entryip neigh show 10.110.0.1
The gateway answersping -c 3 10.110.0.1
The path beyond ittracepath 1.1.1.1

An IPv6 default route almost always points to a link-local address (fe80::), which is normal. Its expires value counts down and is refreshed by each new Router Advertisement.

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

How it works at runtime

Default Gateway is part of Linux Networking → Default Gateway. A Linux default gateway is represented by one or more default routes used only when no more-specific route wins in the selected routing table; gateway validity depends on route policy, interface state, on-link reachability and neighbor resolution.

Topic-specific state model. A Linux default gateway is represented by one or more default routes used only when no more-specific route wins in the selected routing table; gateway validity depends on route policy, interface state, on-link reachability and neighbor resolution.

Interpretation rule. - Default route configured ≠ selected for every source or namespace.

  • Gateway address present ≠ gateway is on-link or neighbor-resolvable.
  • Gateway replies ≠ upstream routing/NAT/Internet path works.
  • Multiple defaults ≠ automatic resilience; metrics, policy and failure detection matter.

Quick reference

Default gateway on Linux is the default (0.0.0.0/0) route.

ip route show default
nmcli con mod eth0 ipv4.gateway 10.0.10.1; nmcli con up eth0
ip route add default via 10.0.10.1 dev eth0 metric 100
ping -c3 $(ip route show default | awk '{print $3; exit}')

Multiple defaults (e.g. DHCP on two NICs) are selected by metric; reply traffic may leave the wrong interface (asymmetric routing, dropped by rp_filter). Use policy routing (ip rule add from 10.0.20.5 table 200) for multi-homed servers that must answer on the interface traffic arrived on.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Limits and how it fails

Primary failure point. Reachability to a default gateway shows only the first routed hop from the host, but it does not show upstream routes, NAT, DNS or remote service availability.

ReferenceConfiguration & state1 section · depth on demand

Configuration, persistence and lifecycle

Distribution/platform context. Default Gateway owns host default-route semantics. General FIB/RPDB behavior belongs to Routing Table; DNS and remote-path investigation remain in their branches.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor doclinux current

Authoritative/upstream documentation reviewed for bounded claims in Linux Networking → Default Gateway. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://docs.kernel.org/networking/index.html · confidence 94%
Technical changelog & impact

What changed and what may be affected

Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
linux default gatewaydefault route linuxip route defaultlinux gateway
Embedded reference data

Quick lookup tables

Default Gateway operational reference

Topic-specific lookup boundaries, proof limits and next-step Evidence for Default Gateway.

Lookup boundaryTopic-specific referenceOperational use
Scope / effective stateA Linux default gateway is represented by one or more default routes used only when no more-specific route wins in the selected routing table; gateway validity depends on route policy, interface state, on-link reachability and neighbor resolution.Establish exactly what this Topic owns before crossing into another subsystem.
Fast verificationPin host + namespace + exact flow → identify configuration owner/renderer → identify ifindex/interface + topology → inspect link/carrier → inspect addresses → inspect neighbor resolution → reproduce route/rule lookup → verify VLAN/bond/bridge/MTU as relevant → inspect packets/socket → verify return path → repeat original workload.Use the shortest evidence path first; a fast check is a boundary test, not blanket proof.
Verification chainpacket with no more-specific match → policy rule/table → selected default route → gateway/on-link validation → neighbor resolution → upstream forwarding → return path → workloadTrace requested/configured state through effective state to the observed workload result.
Failure boundaryReachability to a default gateway proves only the first routed hop from the host; it does not prove upstream routes, NAT, DNS or remote service availability.Stop broad troubleshooting at the first boundary that is not supported by evidence.
Positive evidenceCorrelated Linux networking evidence can establish this proof path: packet with no more-specific match → policy rule/table → selected default route → gateway/on-link validation → neighbor resolution → upstream forwarding → return path → workloadUse this observation only for the specific claim it actually supports.
Evidence limitIt does not independently prove behavior outside the captured namespace, interface, local kernel, L2/path or workload scope. Reachability to a default gateway proves only the first routed hop from the host; it does not prove upstream routes, NAT, DNS or remote service availability.Do not promote a local success signal into end-to-end or adjacent-dependency proof.
Next troubleshooting checkContinue from the first unproven boundary: confirm namespace and configuration owner, inspect ifindex/link/address/neighbor/route state for the exact flow, verify L2/MTU construction and packet movement, then test the listening service and return path before making additional changes.Continue to the next unresolved boundary while preserving the original test condition.

Default Gateway · operational reference

Compact Linux state, persistence, verification and boundary reference for fast lookup.

Reference boundaryDefault Gateway
Topic pathLinux Networking → Default Gateway
Runtime stateA Linux default gateway is represented by one or more default routes used only when no more-specific route wins in the selected routing table; gateway validity depends on route policy, interface state, on-link reachability and neighbor resolution.
Fast checks- Identify the exact default route selected for the failing source/destination context. - Check interface state, gateway prefix/on-link semantics and neighbor entry. - Look for competing default routes created by NetworkManager, DHCP, Netplan or static configuration. - Test the original remote destination and return path, not only the gateway IP.
Verification chainpacket with no more-specific match → policy rule/table → selected default route → gateway/on-link validation → neighbor resolution → upstream forwarding → return path → workload Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return path or regression → explicit Evidence boundary.
Failure boundaryReachability to a default gateway proves only the first routed hop from the host; it does not prove upstream routes, NAT, DNS or remote service availability. Boundary chain: process/socket namespace → source/rule/FIB → neighbor → netfilter/eBPF/qdisc → virtual/physical device → peer → return → application.
Persistence ruleProve which configuration source owns the state, then prove that the running consumer loaded or generated the intended state.
Confirmation

Confirm action

Continue?