December 12, 2007

Facebook blocked

Okay, I cannot access Facebook (amongst other sites). The sites are blocked at proxy level and unfortunately the only way to access the web (that I know of) is via an internal proxy server. I can however access my Linux box at home with SSH directly (no proxy configuration required). This gave me an idea, install a proxy server at home, configure an SSH tunnel and then finally configure my browser to use the proxy server at home. This worked very well indeed and was surprisingly easy to set up. You would think it would be slow, but in fact it was no problem with sites like YouTube, etc. Great! My home broadband connection is 3 Mbps download/300 kbps upload. So effectively the maximum theoretical download bandwidth I can get from my browser will never be more than my home broadband upload bandwidth (i.e. 300 kbps).

Set up instructions

1. Install Squid on your home Linux box. So on a Debian-type installation (like Ubuntu), simply type:

# apt-get install squid squid-common

2. Configure Squid to allow access to any client. This can be done by editting /etc/squid/squid.conf and replacing the line containing http_access deny all with http_access allow all and then restarting squid:

# /etc/init.d/squid restart

3. Configure the browser on your Windows PC to use the new proxy settings (localhost:3128). In my case I wanted to leave Internet Explorer as it was so I installed Firefox and configured the proxy settings as follows:

  • Under Edit, Preferences, Advanced, Network, Connection, Settings.
  • Select Manual proxy configuration and enter localhost under HTTP proxy and 3128 in Port.
  • Enable the option Use this proxy server for all protocols.

4. Install Putty on the same Windows PC and configure SSH tunnelling as follows:

  • Download Putty from http://www.chiark.greenend.org.uk/~sgtatham/putty/
  • Run Putty and enter your home IP address (this may also be known as the 'WAN' IP address. Of course if you're Linux box is behind NAT on your home router, you'll need to configure at least port forwarding for SSH to your Linux box).
  • Within Putty, under Connection, SSH, Tunnels, enter 3128 in Source port and the 'local' IP address of your Linux box in Destination.
  • Click Open and enter your username and password.

5. That's it. Start Firefox or whatever and you can now browse the Web unrestricted!