UPDATE: There was an error in one of the steps, the file /etc/ppp/options does not have to be edited, but /etc/ppp/pptpd-options does. The steps are now correct.
Like many Canadians I am jealous of the American’s and their ability to watch Hulu or listen to free music with Pandora. Both services claim they are working on making their site available to the world but I don’t like waiting.
[ad name=”Google Adsense 468×60″]
The way these types of sites figure out that you are not an American is by your IP address. I don’t know of any way of using an American IP address on my computer at home but it just so happens I have several Cloud Servers that are located in the US which of course have American IP addresses.
I have heard of people outside the US using the Proxy server or VPN server method but I had no idea it was so easy to setup. If you already have a cloud server up and running you could literally have it working in about 5 minutes. Setting it up from scratch should take about 10 minutes.
Below are the steps I followed to setup a Ubuntu based VPN server that allows me to access these coveted American sites from either my Mac or PC.
I use Rackspace Cloud Servers for all my cloud server accounts but any VPS or dedicated server provider (provided they’re servers are located in the US) will work. I used Ubuntu 10.04 but any version of Ubuntu should work.
Connect to your server via SSH and start typing commands
If you just created a new Rackspace Cloud Server you’ll want to change your password.
passwd
Next update the package list and upgrade any packages that need updating.
apt-get update apt-get upgrade
Now install the PPTP server package.
apt-get install pptpd
Specify the local and remote IP addresses. Default should work unless your local network is 192.168.123.0
nano /etc/pptpd.conf
Add these lines (or uncomment and modify existing ones)
localip 192.168.123.1 remoteip 192.168.123.234-238,192.168.123.245
Create a user account to connect to your server
nano /etc/ppp/chap-secrets
Add a user to the file in the following format:
username pptpd password *
For example:
john pptpd abc123 *
would create a user named john with a password abc123.
[ad name=”Google Adsense 468×60″]
Now restart the pptpd service
/etc/init.d/pptpd restart
You should be able to connect to your server via PPTP but you won’t be able to access any websites outside your server without a few more steps.
Setup DNS servers in the PPP Server options
nano /etc/ppp/pptpd-options
Uncomment and change the 2 lines starting with ms-dns
This sets up your server to make DNS requests via OpenDNS
ms-dns 208.67.222.222 ms-dns 208.67.220.220
Open the system configuration file and setup IP forwarding
nano /etc/sysctl.conf
Uncomment the following line
net.ipv4.ip_forward=1
To make the system configuration changes take effect:
sysctl -p
Edit this file
nano /etc/rc.local
Add these two lines above exit (0) in this file:
/sbin/iptables -t nat -A POSTROUTING -s 192.168.123.0/24 -o eth0 -j MASQUERADE /sbin/iptables -I FORWARD -p tcp -syn -i ppp+ -j TCPMSS -set-mss 1356
Server is done. You can connect to this server using any PPTP client.
Hi John,
This is exactly what i need! However, I could not seem to get this to work after following these instructions. I can connect via PPTP (using my mac) just fine, but cannot see any web pages. I have set the ms-dns to the openDNS ips, but still no go.
Any ideas?
Hey John,
Great post- thanks! 🙂
Could you let us know what sort of bandwidth/ other cost you are paying with Rackspace for the proxy server usage?
Thanks!
Did you execute the following command?
/sbin/iptables -t nat -A POSTROUTING -s 192.168.123.0/24 -o eth0 -j MASQUERADE
Rackspace Cloud Server pricing starts at $0.015 per hour (about $11 per month) for a 256 MB Cloud Server which should be sufficient for a proxy. Bandwidth is charged on a per usage basis at $0.18 per GB outgoing and $0.08 per GB incoming. http://www.rackspacecloud.com/cloud_hosting_products/servers/pricing/
I added these two lines
/sbin/iptables -t nat -A POSTROUTING -s 192.168.123.0/24 -o eth0 -j MASQUERADE
/sbin/iptables -I FORWARD -p tcp -syn -i ppp+ -j TCPMSS -set-mss 1356
to /etc/rc.local
for those of us who do not program and dont know what an IP address is or does check out the free software at http://www.jumpto.com
Jumpto is a browser that I use to access Hulu and Pandora.
Did you execute the following command?