3

I'm connecting to a Cisco compatible VPN, in Xubuntu 14.04.

I can connect and access IPs and servers on the network. However, I cannot access external websites. When I change the settings this situation reverses and I can access the internet but not the internal stuff on the VPN.

Under VPN config -> ipv4 setting -> routes I have tried all permutations of "ignore automatically obtained routes" and "use this connection only for resources on its network".

I've also tried manually configuring the DNS servers for both the VPN and using Google's public ones, and the additional search domain for the VPN as revealed in syslog output when connecting to it.

I've also done dpkg-reconfigure resolveconf to no avail.

All I want is to be able to connect to the VPN, access servers and IPs on it whilst also being able to access the wider internet without first disconnecting the VPN.


ip route output as requested

no VPN:

default via 192.168.1.1 dev eth0  proto static 
192.168.1.0/24 dev eth0  proto kernel  scope link  src 192.168.1.151  metric 1 

VPN:

default via 192.168.1.1 dev eth0  proto static 
10.0.0.0/24 dev tun0  proto static 
10.0.1.0/24 dev tun0  proto kernel  scope link  src 10.0.1.116 
10.0.4.0/24 dev tun0  proto static 
10.0.6.0/24 dev tun0  proto static 
xx.xx.xx.xx via 192.168.1.1 dev eth0  proto static 
172.16.0.0/24 dev tun0  proto static 
192.168.1.0/24 dev tun0  proto static 
192.168.1.0/24 dev eth0  proto kernel  scope link  src 192.168.1.151  metric 1 

(xx.xx.xx.xx is my public IP)

  • Have you compared the output of the ip route command? Start with pinging IP addresses for testing (assuming that ICMP is not blocked). – Lekensteyn Jul 30 '14 at 9:27
  • @Lekensteyn compare it under which two circumstances? VPN and no VPN, or VPN and each of the various configurations/checkbox options? – bcmcfc Jul 30 '14 at 9:30
  • VPN enabled/disabled. – Lekensteyn Jul 30 '14 at 14:11
  • @Lekensteyn I have added the output above. – bcmcfc Jul 31 '14 at 7:59
2

The problem was being caused by the router's settings.

It was using 192.168.1.x for the local range and when I changed it to use 192.168.0.x everything started to work properly.

The VPN was using IPs in two ranges - 10.0.0.x and 192.168.1.x. As my machine was assigned an IP in the 10.0.0.x range it wasn't clear that the VPN was also using a range that was conflicting.

  • It will obviously result in problems if your VPN and local network are using the same subnet... changing one or the other is indeed the easy solution. – Lekensteyn Jul 31 '14 at 10:20
  • It wasn't clear that they were - the VPN was supposedly using 10.0.x.x – bcmcfc Jul 31 '14 at 10:22
1

Your VPN server pushes routes that your VPN client sets. Those routes are ok, but the default route might be over the VPN connection. So after connecting to the VPN, just change the default route back to your normal one.

Remove the default route in a terminal:

sudo route del default

Add the new route:

sudo route add default gw <ip>

Replace <ip> with your route at home. If you don't know that ip, just type this command while NOT connected to the VPN (it prints your default gateways/routers ip):

sudo route -n | awk '/^0.0.0.0/{print $2}'

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.