I figured out how to get Ubuntu to correctly connect to a Windows style PPTP VPN. Apparently there are a number of large issues with NetworkManager that make it all but unusable for VPN. The fix is enormously simple, so I’m extremely confused as to why on earth they haven’t patched it yet. Okay, so here’s what I have done:
1. Create a shell script that you will run after you connect to the VPN via NetworkManager applet. The contents are like this:
#!/bin/bash echo "search your-domain-name.com" > /etc/resolv.conf echo "nameserver ip-address-of-your-companies-dns-server" >> /etc/resolv.conf sudo route add default gw 10.10.30.1
2. Connect to the VPN using NetworkManager
3. Run this script as root:
bash$ sudo ./vpn
What this does is first it updates my resolv.conf so that I can find the DNS server that my company provides and also setups up my search domain for easy access to stuff like http://wiki. Next it adds a new route to the kernel IP routing table. The issue with NetworkManager is that it not only completely clears out resolv.conf (eeck!) but it also doesn’t always setup a route to get to the VPN network. In my script I just setup a simple default route that will direct all traffic to my VPNs gateway. This procedure assumes that NetworkManager is setting up a host route to the VPN gateway on the ppp network device. If this doesn’t happen, well your routing table could get all screwed up, but I think for now NetworkManager isn’t that stupid (however it might be).
Good luck and happy VPNing.