Why still Intrepid (Ubuntu 8.10) server? I just don't have time to upgrade it. For a server, as long as it is secure and stable, no need for the cutting edge.
Why VPN? Check wiki. For me, I want to access some location sensitive files while I am on the iPhone via 3G network.
How? There is an excellent How-To in Chinese. I followed it and it works! This post is a summary of what I did.
For iPhone, three VPN protocols are supported: L2TP, PPTP and Cisco IPSec. I am going to install a pptpd on my Ubuntu server.
- Get the server installed.
sudo apt-get install pptpd - Edit /etc/pptpd.conf file to setup the IP address for connected clients. Enable localip and remoteip to something like
localip 10.100.113.1 remoteip 10.100.113.2-4 - Use /etc/resolv.conf to find the DNS of the system, and edit /etc/ppp/pptpd-options to enable ms-dns - something like
ms-dns 128.218.254.10 ms-dns 128.218.254.40 - Set the VPN account by editing /etc/ppp/chap-secrets. For an account test with password TSET that can connect from any where
test pptpd TSET * - Restart the server by executing
sudo /etc/init.d/pptpd restart - Enable forward for Internet connection. First, edit /etc/sysctl.conf file to enable
net.ipv4.ip_forward=1and
sudo sysctl -pSecond, use iptables (install by apt-get) to setup a route
sudo iptables -t nat -A POSTROUTING -s 10.100.113.0/24 -o eth0 -j MASQUERADE - Setup VPN in the iPhone by General > Network > VPN > PPTP. Enable Auto encryption level. Keep RSA SecurID off.

It should work now. - Automatically enable iptables after rebooting. First, save the working iptables by
# iptables-save > /etc/iptables-rulesSecond, edit /etc/network/interfaces to something like
# The primary network interface auto eth0 iface eth0 inet dhcp pre-up iptables-restore < /etc/iptables-rules
That is all I did and I don't need to tweak other things as listed in the original post. I also tested on a windows xp machine, which works like a charm. Enjoy Ubuntu!
[...] few searches on the internet brought up this page - very useful advice, but I didn’t follow it completely. All I did (initially) was [...]
With the coming of 10.4, upgraded version about installing pptp can be found here (http://eubolist.wordpress.com/2010/01/28/howto-pptp-vpn-server-with-ubuntu-10-04-lucid-lynx/)
[...] Shared How-To » Setup a VPN server in Ubuntu 8.10 for iPhone. [...]
Notes on saving the firewall on MTU:
To save the firewall on 10.4, I had to use:
# sudo bash -c "iptables-save > /etc/iptables-rules"
If web pages freeze when loading certain sites on windows:
Open the /etc/ppp/ip-up file and just before the last line, add the following line.
/sbin/ifconfig $1 mtu 1400
[...] of the easiest tutorials I’ve came across is this one from en.dogeno.us while it is written for Ubuntu the principles remain the same for other distributions, just [...]