4

I have this is my routing table (in that order):

10.3.68.0/22 via 172.16.100.9 dev vlan4
10.3.68.0/22 dev eth3  proto kernel  scope link  src 10.3.69.254

eth3 has ip 10.3.69.254/22.

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

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

It only says that it will try the link local routing when I ask for 10.3.68.0 ("network" address), 10.3.71.254 (broadcast), or 10.3.69.254 (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
0

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.