I'm using openconnect to connect to my office VPN. They push some pretty crappy/aggressive routing rules allocating ALL of the private IP address spaces >.<

After I connect to my office VPN, my main routing table contains these routes (it contains a lot more actually, but those are the colliding subnets): dev p4p1  proto kernel  scope link  src dev tun0  scope link

As you can see, all traffic to should be routed through tun0. The weird thing though is that it's not.

If I ping a machine in my home LAN (, the ICMP packet reaches the machine and generally everything works OK, so I assume that packets to don't go through the VPN connection.

My question is the following, how does the Linux kernel deal with colliding subnets? I'm suspecting that it chooses to use most precise route, in this case Could you please point me to a document that describes this or provide some hints?


Actually it's not colliding. One subnet has more specific mask has more specific mask than

For example default gateway is default because it has less specific mask /0.

If you add a route to via another interface it would have more specific mask than other two routes.


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.