Use both OpenVPN & eth0 together

Posted by shadyabhi on Super User See other posts from Super User or by shadyabhi
Published on 2011-01-14T13:10:57Z Indexed on 2011/01/14 13:55 UTC
Read the original article Hit count: 216

Filed under:
|
|
|
|

I connect to a VPN using openVPN. Now, after the connection is established, all my traffic goes through tun0.

My LAN gateway is 10.100.98.4... So, for apps to use my direct internet connnection I did

sudo route add default gw 10.100.98.4

But, I cant use tun0 now. I know this because

curl --interface tun0 google.com

doesnt give me anything.. How do I go about using both connections simultaneously. How can I achieve that?

ROUTING TABLES:-

Without VPN running:-

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.100.98.0     *               255.255.255.0   U     1      0        0 eth0
default         10.100.98.4     0.0.0.0         UG    0      0        0 eth0

With VPN:-

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.10.0.1       10.10.54.230    255.255.255.255 UGH   0      0        0 tun0
10.10.54.230    *               255.255.255.255 UH    0      0        0 tun0
free-vpn.torvpn 10.100.98.4     255.255.255.255 UGH   0      0        0 eth0
10.100.98.0     *               255.255.255.0   U     1      0        0 eth0
default         10.10.54.230    0.0.0.0         UG    0      0        0 tun0

After the route command-

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.10.0.1       10.10.54.230    255.255.255.255 UGH   0      0        0 tun0
10.10.54.230    *               255.255.255.255 UH    0      0        0 tun0
free-vpn.torvpn 10.100.98.4     255.255.255.255 UGH   0      0        0 eth0
10.100.98.0     *               255.255.255.0   U     1      0        0 eth0
default         10.100.98.4     0.0.0.0         UG    0      0        0 eth0
default         10.10.54.230    0.0.0.0         UG    0      0        0 tun0

© Super User or respective owner

Related posts about linux

Related posts about ubuntu