Use it when a host reaches its own subnet but nothing beyond it.
Default Gateway
The default gateway is the route for 0.0.0.0/0 (and ::/0): where packets go when no more specific route matches.
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.
default route configured or learned → gateway on a connected subnet → ARP/ND resolves it → off-subnet packets forwarded
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
Operational reference
Fast context before you go deeper.
ip route show defaultVerification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
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 · 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.
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.
ip -br addr— interfaces and addressesip route— routing table and default routeip neigh— ARP/neighbour cacheip route get <dest>— route, interface and source chosen for a destinationnmcli 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
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 ... weightcreates a multipath default with relative weights. - Source address:
srcsets 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
| Source | Typical proto | Metric |
|---|---|---|
| DHCP via NetworkManager or networkd | dhcp | Per-connection, often 100 + interface order |
| Static configuration | static | As configured |
| IPv6 Router Advertisements | ra | Set by the RA client |
Manual ip route add default | boot | 0 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
| Check | Command |
|---|---|
| The gateway's neighbour entry | ip neigh show 10.110.0.1 |
| The gateway answers | ping -c 3 10.110.0.1 |
| The path beyond it | tracepath 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.
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.
Limits and how it fails
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
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
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%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.
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.
Quick lookup tables
Default Gateway operational reference
Topic-specific lookup boundaries, proof limits and next-step Evidence for Default Gateway.
| Lookup boundary | Topic-specific reference | Operational use |
|---|---|---|
| Scope / effective state | 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. | Establish exactly what this Topic owns before crossing into another subsystem. |
| Fast verification | Pin 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 chain | packet with no more-specific match → policy rule/table → selected default route → gateway/on-link validation → neighbor resolution → upstream forwarding → return path → workload | Trace requested/configured state through effective state to the observed workload result. |
| Failure boundary | 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. | Stop broad troubleshooting at the first boundary that is not supported by evidence. |
| Positive evidence | Correlated 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 → workload | Use this observation only for the specific claim it actually supports. |
| Evidence limit | It 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 check | Continue 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 boundary | Default Gateway |
|---|---|
| Topic path | Linux Networking → Default Gateway |
| Runtime state | 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. |
| 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 chain | packet 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 boundary | 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. Boundary chain: process/socket namespace → source/rule/FIB → neighbor → netfilter/eBPF/qdisc → virtual/physical device → peer → return → application. |
| Persistence rule | Prove which configuration source owns the state, then prove that the running consumer loaded or generated the intended state. |