Configure PPTP VPN on Ubuntu
Here is a quick tutorial to set up a basic PPTP VPN server on Ubuntu 10.04.
Install necessary packages
sudo aptitude install ppp pptpd iptables
Configure PPTP IP ranges on the server
sudo vim /etc/pptpd.conf
At the bottom of the file add
localip 10.89.64.1
remoteip 10.89.64.100-150
This sets up the PPTP server to use IP 10.89.64.1 while distributing the IP range 10.89.64.100 to 10.89.64.150 to PPTP clients. Change these as you wish as long as they are private IP addresses and do not conflict with IP addresses already used by your server.
Configure DNS servers to use when clients connect to this PPTP server
sudo vim /etc/ppp/pptpd-options
Find lines containing ms-dns
and add
ms-dns 8.8.8.8
ms-dns 8.8.4.4
to use Google's DNS service. You can specify other DNS servers if you know their addresses.
Now add a test account
sudo vim /etc/ppp/chap-secrets
Append a line at the bottom
# client server secret IP addresses
test pptpd abcd1234 *
Configure NAT for PPTP connections, otherwise you cannot reach anywhere from this server
sudo vim /etc/rc.local
adding to the bottom right before exit 0
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
Enable IPv4 forwading
sudo vim /etc/sysctl.conf
Uncomment the line
net.ipv4.ip_forward=1
Then reload the configuration
sudo sysctl -p
Done. Reboot to see if everything goes well.