Setting up VPN server

Warning: This guide is very out of date.

Data going via Evil router Wi-Fi hotspots can sniff any unencrypted data and manipulate pages you open.

VPN encrypts and tunnels all Internet traffic to a machine of your choice. It's quite important if you want to use Wi-Fi hotspots with iPhone, because owner of Wi-Fi hotspot can view all unencrypted traffic, and if Wi-Fi signal isn't encrypted, anyone can. OTOH with VPN you can leech any connection on nobody will see what you're doing (except tunelling lots of unrecognizable data).

Data going via Mac Your Mac compresses and securely pipes data to your iPhone. I've heard people don't read anyting except image captions.

You will need a Mac with Tiger or Leopard and external IP address that can accept incoming TCP and UDP connections. Mac must be kept switched on while you browse from your iPhone (you will still be able to browse if Mac is shut down, but you'll have to disable VPN and lose security).

Don't forget to open ports in your firewall, forward ports on router and enable L2TP/VPN passthrough in your router's configuration (if it has such option).

To set up VPN server just follow an excellent guide on

Leopard needs a little help. In Terminal run:

sudo killall vpnd
sudo racoon -Fv

Now you should be asked to confirm KeyChain access. Click “Always Allow”. Press Control+C in Terminal window.

sudo killall racoon

Configuring iPhone

Go to Settings → General → Network → VPN.


  1. Disable Wi-Fi on iPhone
  2. Stop and start VPN in iPhone's settings. Wait until it finishes connecting.
  3. Open (and refresh) any of the what's my IP websites and check which IP you appear to be using.
    • If it's the same as your Mac's — congratulations!
    • If it's IP of your EDGE connection, then VPN isn't working.

BTW: iPhone will have to drop VPN whenever you change networks, and unfortunately isn't smart enough to re-enable VPN on a new network, so remember to keep re-enabling it (complain to Apple, not me).

You can also use Internet (Tiger) or create VPN device in Network Preferences (Leopard) and see if your Mac can connect.

Back to start of the guide

Next step: Ziproxy

Images created with Tango Icons and OmniGraffle.