In my routing table (ip route show command), I've got the following entries: via dev tun0
default via dev wlan0

What is the difference between and default? All default traffic is currently being routed through tun0, but if both lines have the same purpose, shouldn't the second line take precedence over the first line?

2 Answers 2


A routing table entry requires a prefix length, ie. /1 in your case.

That entry matches only through (with being non-routable as loopback range - thx @tontongerrit), so it's not a default route (that needs to match anything: /0).

Using and in combination as a practical default route is a trick used with some VPN clients to point into a tunnel interface, so they don't have to remove your previous default route, pointing to the Internet. Since /1 prefixes are longer than the /0 prefix they take precedence.


In routing, the more specific route (= the higher netmask value - the number behind the "/") takes precedence over the less specific route (lower netmask value). The default route, as stated above, has a netmask of /0. It is the lowest possible number, and it is the solution of last resort, if there is no more specific prefix in the routing table for a specific IP address, then traffic will be routed there. covers to (not 127/8 which would typically refer to loopback IPs), and that route will be preferred over (= default) if your destination IP address falls into the former range, simply because that prefix is more specific.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.