Setting up a PPTP server in Ubuntu
After years of using Windows mobile phones I switched to an iPhone. I got pretty to getting the iPhone’s VPN to work with our Sonicwall 3500, but I ran out of patience. According to the Sonicwall a connection was established, but the iPhone would immediately disconnect. My patience ran out so I decided to take a swing at setting up a PPTP server.
Quick note - anything that is in bold you should be able to use exactly. Anything that is in bold and in italics will need to be updated according to your environment.
Of course I am building this as a virtual machine, so I started with a fresh image of Ubuntu 8.04 JeOS. After you have your server running and up to date, you just need to install pptpd. Just run sudo apt-get install pptpd.
Now we need to configure PPTP. At minimum you will need two additonal IP addresses on your LAN. First, using your favorite text editor open /etc/pptpd.conf for writing. We need to modify or add the following lines:
localip 172.16.0.2
remoteip 172.16.0.3-4
The localip IP is the virtual / secondary IP of your VPN server. The remoteip IP(s) is the IP(s) that VPN clients will be given.
You will also probably want to specify DNS servers for your VPN clients to you use. If so, open /etc/ppp/pptpd-options for editing. You can specify up to two DNS servers by adding or modifying the line ms-dns 172.16.0.5.
Next we need to setup an account for each VPN user. Open /etc/ppp/chap-secrets for editing. Add the following for each VPN user.
username pptpd password “*”
Finally, we need to tell Ubuntu to forward the VPN client traffic. Add, edit or uncomment the following line in /etc/sysctl.conf.
net.ipv4.ip_forward=1
At this point I rebooted - I wasn’t sure if it is required for sysctl.conf change to take place. Modify your internet firewall to allow PPTP connections (TCP port 1723 and protocol ID 47) to your server and you should be all set. If you just need to restart the pptpd daemon run sudo /etc/init.d/pptpd restart.
This combined with an SSH client is going to come in very handy for those occasions when a server needs to be rebooted and I am busy enjoying a pint or two.
Posted: January 2nd, 2009 under Linux.
Comments: none
Write a comment