Configure Witopia VPN on DD-WRT

I like using a VPN service for a more secure browsing experience and I have used Witopia for the past little while with great success. The only issue was that I had to install it on all the PCs that I wanted to use it with and then remember to turn it on, etc which I did not like very much. So after a decent amount of googling, I decided to get a second router that supports DD-WRT and set that up to always be connected via VPN. This way, it is just a matter of switching my wireless connection from any device.

After some research I settled on Buffalo AirStation WHR-HP-G300N (bought from Newegg) which is a tiny little router that comes with DD-WRT installed. The only downside, I later found, is that since it’s got smaller memory on-board it does not support OpenVPN.

Witopia itself does provide a Cloakbox Pro device itself which is a higher end Buffalo router pre-configured to VPN, but I wanted to do it my way. So keep in mind as you read the instructions below that my setup is using a VPN router that is behind my main router.

Setup Instructions

  1. Add Google’s public DNS servers as static DNS servers for the DHCP server. Note that since my main router is using 192.168.1.x, I put this router on 192.168.11.x to make sure there is no complications.
  2. Configure the wireless access point on the router so that it does not conflict with your main wirless connection (i.e. give it a different name and use a different channel to be extra safe).
  3. Enable and configure the PPTP client on the router to connect to your favorite VPN location. You can get a list of the VPN location for Witopia here. For the Server IP or DNS Name I put in the IP address of the vpn server I wanted to connect to (e.g.
  4. Add a startup script to the router to configure it to use the VPN connection properly.

    The script below will wait until VPN is connected and then update the router’s routing appropriately. Note that is the internal IP of my main router, not the VPN router which is

    echo "echo \"Startup Config started\" >> /tmp/mylog.txt" > /tmp/
    echo PPTPSERVER=$(/usr/sbin/nvram get pptpd_client_srvip) >> /tmp/
    echo PPTPGWY= >> /tmp/
    echo "/sbin/route add -host \$PPTPSERVER gw \$PPTPGWY" >> /tmp/
    echo "#/sbin/route del default" >> /tmp/
    echo "/sbin/route add default gw \$PPTPGWY metric 100" >> /tmp/
    echo "/sbin/route add default dev ppp0" >> /tmp/
    echo "/sbin/route del default" >> /tmp/
    echo "/sbin/route del default" >> /tmp/
    echo iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE >> /tmp/
    echo "ifconfig ppp0 > /dev/null" > /tmp/
    echo "RC=\$?" >> /tmp/
    echo "echo \"Checking ppp0: \$RC\" >> /tmp/mylog.txt" >> /tmp/
    echo "while [ \$RC -ne 0 ]; do" >> /tmp/
    echo "  sleep 5" >> /tmp/
    echo "  ifconfig ppp0 > /dev/null" >> /tmp/
    echo "  RC=\$?" >> /tmp/
    echo "  echo \"Checking ppp0: \$RC\" >> /tmp/mylog.txt" >> /tmp/
    echo "done" >> /tmp/
    echo "echo \"Running\" >> /tmp/mylog.txt" >> /tmp/
    echo "ifconfig ppp0 >> /tmp/mylog.txt" >> /tmp/
    echo "sh /tmp/" >> /tmp/
    sh /tmp/ &

Once all this is setup, connect to the wireless for the VPN router, and go to IP Location Finder and make sure that it reports your location correctly. If it is still reporting your current location, then VPN is not working and you have to get your hands dirty and login to the router itself and poke around. That is beyond what I wanted to get into here, but I am sure you can find your solution on the internets.






Leave a Reply

Your email address will not be published. Required fields are marked *