Start by installing pptpconfig. Add the following to your /etc/apt/sources.list file:
# James Cameron's PPTP GUI packaging
deb http://quozl.netrek.org/pptp/pptpconfig ./
Then install the app:
sudo apt-get update
sudo apt-get install pptpconfig
Now run it (sudo pptpconfig) and configure your VPN. In the "Routing" options, select "Client to LAN". Lets assume you called your new configuration MyVPN.
You can close pptpconfig. Go over to /etc/ppp/ip-up.d/ and create a new file called vpnroute (sudo gedit vpnroute). Assuming that the network you want to connect to uses IPs like 192.168.0.*, add this to the file:
#!/bin/shDon't forget to make it executable, or it won't work:
if [ "${PPP_IPPARAM}" = "MyVPN" ]; then
route add -net 192.168.0.0 netmask 255.255.255.0 dev ppp0
fi
chmod a+x vpnroute
And that's it. To start your VPN run:
sudo pon MyVPN
To stop it run:
sudo poff MyVPN