Friday, November 20, 2009

VPN configurations for internet addicts

Preamble :

One of my friends have blogged on how he managed to connect via VPN and to generic internet in parallel.

http://tdevinda.blogspot.com/2009/11/whats-inside-what-virtualization.html

This ended up in bringing a nice discussion on routing, VPN and VMs.

Following is my solution.


Issue :

Under normal conditions; when you get connected to a VPN, it is not possible to get connected with the internet.

Reason:

When you get connected to the VPN, automatically it is set as the default route.


Solution:

  1. Once you are connected to VPN, remove the default route for VPN. Under linux vpn is normally tun0.
  2. Then add a default entry for your usual network interface. (eth0, ppp0, etc)
  3. Then add the routing entry for the specific IP or the subnet which you need to get connected through VPN for tun0