I have this is my routing table (in that order): via dev vlan4 dev eth3  proto kernel  scope link  src

eth3 has ip

Why does Linux choose to go through the gateway to access the subnet (thus not trying direct link)?

I tested with ip route get for example. It says it will go through, and in practice, it does.

It only says that it will try the link local routing when I ask for ("network" address), (broadcast), or (itself). I think this is because these 3 cases are specifically handled by the higher priority local table (ip route show table local).

Anyway, why does Linux consider the first route as the higher priority route?

  • In the order of your routing table from the more to the less precise – Kiwy Feb 17 '14 at 15:39
  • @Kiwy can you source that information please? – Totor Feb 25 '14 at 21:59
  • Sorry I can't I'd rather delete my answer I don't even understand why I wrote this. The thing is for real routing table is processed from the more specific to the more broad but with vlan i really don't know – Kiwy Feb 26 '14 at 8:11

In my opinion a Vlan is more specific than a whole interface that's why it appears first in your routing table. Thought I've not yet found documentation on it. I will update my answer if I find materials.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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