Currently I have a physical Linux machine (Centos7) with two physical interfaces. On the eth0 interface I have 3 virtual interfaces - eth0.66, eth0,67, eth0.99 (vlan interfaces). wlan0 is the internal WAN uplink. tun0 is created through an SSL Site-to-Site tunnel. I have enabled ipv4 forwarding in the kernel.

As of currently, the default routing tables looks like this:         UG    0      0        0 wlan0     U     1002   0        0 eth0     U     1004   0        0 eth0.66     U     1005   0        0 eth0.67     U     1006   0        0 eth0.99   U     0      0        0 wlan0   UG    0      0        0 tun0   UG    0      0        0 tun0 UH    0      0        0 tun0 U     0      0        0 eth0.99 U     0      0        0 eth0.66 U     0      0        0 eth0.67

I am trying to force all traffic from the network through the tunnel and use as the default gateway ( is the GW of the firewall on the server side for the VPN, which I also control).

I've tried to make a new routing table (in etc/iproute2/rt_tables) - and adding the appropriate rules (for now in the runtime and not via a script, but I know how to do this for persistent routing).

from all to lookup custom
from lookup custom

and then the routing table:

default via dev tun0

at which point, everything breaks... ping stops working, internet on the eth0.67 network fails, etc. How can I get this routing correctly? Probably a stupid question, but does the kernel routing table get completely ignored and do I need to write in all the other routes the SSL VPN is pushing? (the and 6.0 routes are coming from the SSL OPENVPN config).

1 Answer 1


Solution found: One more route was needed dev eth0.67 src table custom.

Other routes still persist, so no need to double add them. (things for the and networks).

PS- thanks for the downvotes!

Your Answer

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

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