LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   what routes to add in order to make VPN work? (https://www.linuxquestions.org/questions/linux-networking-3/what-routes-to-add-in-order-to-make-vpn-work-787166/)

stevena 02-05-2010 12:52 AM

what routes to add in order to make VPN work?
 
Hi, i installed the free PacketIX vpn client on my ubuntu 9.04.
it created a virtual network adapter, i was able to configure and connect to the VPN service but when i add a default route to the routing table so that all internet traffic goes through the VPN, my internet connection stops working until i remove the line i added.

here's my routing table before :

Code:

Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
192.168.222.0  0.0.0.0        255.255.255.0  U    0      0        0 eth0
169.254.0.0    0.0.0.0        255.255.0.0    U    1000  0        0 eth0
10.0.0.0        0.0.0.0        255.0.0.0      U    0      0        0 vpn_vpn
0.0.0.0        192.168.222.2  0.0.0.0        UG    0      0        0 eth0

and after i add the route:

Code:

192.168.222.0  0.0.0.0        255.255.255.0  U    0      0        0 eth0
169.254.0.0    0.0.0.0        255.255.0.0    U    1000  0        0 eth0
10.0.0.0        0.0.0.0        255.0.0.0      U    0      0        0 vpn_vpn
10.0.0.0        10.0.0.1        0.0.0.0      U    0      0        0 vpn_vpn

here's the virtual network adapter configuration :


Code:

ifconfig vpn_vpn
vpn_vpn  Link encap:Ethernet  HWaddr 00:ac:55:bc:9e:bf 
          inet addr:10.4.80.192  Bcast:10.255.255.255  Mask:255.0.0.0
          inet6 addr: fe80::2ac:55ff:febc:9ebf/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:34625 errors:0 dropped:0 overruns:0 frame:0
          TX packets:298 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:3176333 (3.1 MB)  TX bytes:16090 (16.0 KB)

i installed the same VPN client on windows XP and it's working like a charm. how can this be fixed

karpi 02-05-2010 02:32 PM

Hello,

did you mixup the parameters for route?

route add default gw vpn_vpn


HTH

Karpi
<fluctuat nec mergitur>

stevena 02-06-2010 04:09 AM

Quote:

Originally Posted by karpi (Post 3854178)
Hello,

did you mixup the parameters for route?

route add default gw vpn_vpn


HTH

Karpi
<fluctuat nec mergitur>

Karpi, thank you for answering.

is your command syntax flawed? because i tried it and it said:

Code:

route add default gw vpn_vpn
vpn_vpn: Unknown host

anyway here's what, after i connect to the service i end up with the following routing table

Code:

Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
192.168.222.0  0.0.0.0        255.255.255.0  U    0      0        0 eth0
169.254.0.0    0.0.0.0        255.255.0.0    U    1000  0        0 eth0
10.0.0.0        0.0.0.0        255.0.0.0      U    0      0        0 vpn_vpn
0.0.0.0        192.168.222.2  0.0.0.0        UG    0      0        0 eth0

so i delete the last line, the eth0 default route and add a new one like this :
Code:

route add default dev vpn_vpn
but then it adds the following as the default route
Code:

0.0.0.0        0.0.0.0        0.0.0.0      U    0      0        0 vpn_vpn
if i do it manually like this( i got the gateway from windows XP) :
Code:

route add default gw 10.0.0.1
i get
Code:

0.0.0.0        10.0.0.1        0.0.0.0      UG    0      0        0 vpn_vpn
which i think is the correct syntax, only it doesn't work

Code:

wget www.google.com
...
Connecting to www.google.com|209.85.229.106|:80 ...failed: No route to host.



All times are GMT -5. The time now is 08:44 AM.