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.

Steps to check the default route with ip route in Linux:

  1. 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.

  2. 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 
        cache 

    Using an IP avoids DNS, and the src value shows which local address would be used.

  3. 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.

  4. 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.