Default routes decide where traffic goes when no more specific route exists, so a wrong gateway can make everything beyond the local network disappear.
On Linux, the kernel routing table defines the chosen gateway and interface, and ip route reads that table directly to show via (gateway), dev (interface), and selection hints like metric and proto.
Multiple default routes can coexist (wired, Wi‑Fi, VPN), and the lowest metric typically wins within the same address family, so confirming both the default entries and the effective path for a real external IP avoids misdiagnosing DNS or firewall issues.
Related: How to troubleshoot a Linux network outage
Related: How to add a static route in Linux
Steps to check the default route with ip route in Linux:
- Display the default route entries, including their metric values.
$ ip route show default default via 192.0.2.1 dev eth0 proto dhcp src 192.0.2.40 metric 100
Lower metric values are preferred when multiple default routes are present.
- Confirm the selected gateway, interface, and source address for an external IPv4 destination.
$ ip route get 203.0.113.50 203.0.113.50 via 192.0.2.1 dev eth0 src 192.0.2.40 uid 0 cacheUsing an IP avoids DNS, and the src value shows which local address would be used.
- Display the IPv6 default route when IPv6 connectivity is expected.
$ ip -6 route show default default via 2001:db8:1::1 dev eth0 metric 100 pref medium
proto ra entries come from router advertisements; static defaults show proto static or omit the proto entirely.
- Confirm the selected IPv6 gateway and source address for an external IPv6 destination.
$ ip -6 route get 2001:db8:203:113::50 2001:db8:203:113::50 from 2001:db8:1::10 via 2001:db8:1::1 dev eth0 src 2001:db8:1::10 metric 100 pref medium
The src address shows which local IPv6 address would be used for the destination.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
