Automate the "check service" process for Unblock Us

Unblock Us is a service that changes the country from which the IP address you use to connect to other websites appears to come from. This is particularly useful when you’re e.g. a british expatriate but you’d still like to use iPlayer (their video on-demand service) to watch BBC programs of the past couple of weeks.

Unfortunately Unblock Us requires you to run a client software on your PC in order to detect when the IP address by which you’re connected to the internet changes. This usually happens every 24 hours for DSL connections which are disconnected once a day by most ISPs.

After detecting the change of your IP address the client will make sure that you get the Unblock Us service.

But what to do if you – a) don’t have a Windows PC – OR – b) don’t want to keep it running all the time because you use other devices more?

The solution requires three distinct steps:

  1. Set up your router to use the Unblock Us DNS servers
  2. Set up your router to register a DynDNS hostname
    This is necessary for Unblock Us to automatically pick up your IP address change
  3. Set up your router to automatically send a “check service” request to Unblock Us
    After seeing your IP address change Unblock Us treats this as the confirmation that your new IP address is valid

Points (1) and (2) are covered by the FAQ and knowledgebase of the Unblock Us website itself. The challenge is how to get your router to send the “check service” request automatically once your internet connection is dis- and reconnected.

This tutorial covers routers which run the Tomato firmware but will work for any other firmware which can execute a command upon establishing an internet connection and has the ‘telnet’ executable.

The necessary ‘check service’ is basically just a HTTP POST request which is sent to ‘http://check.unblock-us.com’. So if you can send this POST request you’re sorted.

1. Enable a permanent storage in your router (e.g. JFFS) and create a new file called ‘unblock-us-post’ with this content:

POST / HTTP/1.1
Host: check.unblock-us.com
Content-Length: 51
Content-Type: application/x-www-form-urlencoded

validated=1&email=YOUR_EMAIL@ADDRESS.COM&rid=0

Replace the text ‘YOUR_EMAIL@ADDRESS.COM’ with your actual e-mail address that you’ve registered with Unblock Us.

2. Go to ‘Administration->Script->WAN up’ in your router web user interface

Add the following line:

cat /path/to/unblock-us-post - | telnet check.unblock-us.com 80

Make sure that you use the correct path to your created file in the line above.

That’s it. When your internet connection is connected the script sends the POST request to Unblock Us using telnet (you could also use wget or cURL but Tomato firmware does not include a version of either which supports sending a POST request).

Now disconnect your internet connection and reconnect it.

Try a service which you use with Unblock Us to see if your service is working.

Timo

Timo