XBox/Netflix via VPN HOWTO

Unfortunately Australia is way behind the rest of the world when it comes to online services. Digital streaming services like Netflix and Hulu are geo-locked, so if you try and access them from an Australian IP address your get the lame “not available in you country” message.

Thankfully VPN technology easily overcomes this. Here is a quick HOWTO on how to set this up with an Xbox 360, a linux server, and an internet connection.

These instructions should work for RHEL/CentOS 6.

Find yourself a VPN provider. The instructions below are for the PPTP protocol.

Install relevant packages and create your PPTP configuration file:

yum install ppp pptp
cat > /etc/ppp/peers/vpn <<EOF
pty "pptp <vpn_hostname> --nolaunchpppd --debug"
name <vpn_username>
password <vpn_password>
remotename PPTP
maxfail 0
chkconfig iptables on
service iptables start

Test your VPN:

chmod +x /usr/share/doc/ppp-2.4.5/scripts/pon
/usr/share/doc/ppp-2.4.5/scripts/pon vpn debug nodetach dump

Don’t ask me why the pon script doesn’t come with execute perms by default.

If you remove your default route before creating the VPN (as I do below), your machine will use the VPN as the default gateway for all traffic once the VPN is established. So before you do this, it’s a good idea to make a list of any hosts you wish to connect to via your old default gateway. You’ll need to add static routes for them.

Update your RC/start scripts to create any necessary static routes, start the VPN, enable NAT, etc.

cat >> /etc/rc.local < <EOF
# Create static routes via old gateway
for HOST in \
  ; do
    route add -host $HOST gw <old_default_gw>
# Add a route for VPN provider
route add -host <vpn_hostname> gw <old_default_gw>
route delete default   # vpn will create new default gw at ppp endpoint
# Start VPN
/usr/share/doc/ppp-2.4.5/scripts/pon vpn
# Create NAT rules
iptables -A INPUT -i eth0 -p tcp --dport 1723 -j ACCEPT
iptables -A INPUT -i eth0 -p gre -j ACCEPT
iptables -A FORWARD -i ppp+ -o eth0 -j ACCEPT
iptables -A FORWARD -i eth0 -o ppp+ -j ACCEPT
iptables -t nat -A POSTROUTING -o ppp0 -s <xbox_ip_address> -j MASQUERADE
# Allow IP Forwarding
sysctl -w net.ipv4.ip_forward=1

A lot of this config you can put elsewhere, like /etc/sysctl.conf and /etc/sysconfig/iptables. I like to put it in /etc/rc.local because when i rebuild my machine I just have one file to copy.

Once your done, run /etc/rc.local and it should start up your VPN and turn your linux server into a VPN gateway for your XBox 360.

Then go into your XBox 360’s network settings and change your default gateway to be your linux server’s IP address.

To install the Netflix app, you’ll need a US silver xbox live account. There are plenty of guides on how to create one. Once you have a US live account, log in on your XBox and install the Netflix app. Then log out and back in with your gold account and you should be able to start using Netflix. Sign up for your free month and enjoy.

2 thoughts on “XBox/Netflix via VPN HOWTO

Leave a Reply

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