5.9.08

Proxy Server , Squid 2.6. Ubuntu

Now, I want to share my experience to install squid server on Ubuntu as transparent proxy.
One important thing you need is install Ubuntu Server edition, Just install basic package than configure the server to connected to internet properly. If needed, set the /etc/apt/sources.list to link to local repository server which near with your location for new version of package or just installed from your CD/DVD installer. For this tutorial, I’m using squid 2.6. Let’s go to run.


me@simplyeko:~$ sudo apt-get install squid

After all finished, edit the file configuration. Use your favorite editor. For this tutorial, I’m using “vi” as my favourite editor

me@simplyeko:~$ sudo vi /etc/squid/squid.conf

Find this in squid.conf and change it

visible_hostname proxy.simplyeko.com
cache_mgr admin@simplyeko.com
http_port 3128 transparent
always_direct allow all


That’s all you need to change on squid.conf, but if you want more configuration file for squid.conf you can use this setting in here as comparison. The keyword for transparent proxy configuration on squid.conf is http_port 3128 transparent.

Now create the cache directory by typing

me@simplyeko:~$ sudo squid -z

Now you can run the squid

me@simplyeko:~$ sudo /etc/init.d/squid start

Transparent proxy already set. Transparent proxy means that we don’t have to enter any proxy address on browser. If you browse a website, you are going to port 80. But with this tutorial, we’re forwarding any connection that’s going to port 80 to our squid server automatically. So let’s start setting this.

me@simplyeko:~$ sudo echo 1 > /proc/sys/net/ipv4/ip_forward

This method is to enabling ip forwarding

Put that script in your startup scripts.

Now you have to put masquerading method so you can forward the connection

me@simplyeko:~$ sudo apt-get install ipmasq

The last..

me@simplyeko:~$ sudo iptables -A PREROUTING -t nat -p tcp –dport 80 -j REDIRECT –to-port 3128

This command is for forward any request on port 80, will be forwarded to port 3128 (our squid port)

Now you can run transparent squid proxy

me@simplyeko:~$ sudo /etc/init.d/squid start

Congratulations….!!! You have Transparent Proxy on your server and ready for production.

zte c300 trunk mode

  gpon   profile tcont PPPOE type 4 maximum 9900000   profile tcont 100M type 4 maximum 100000   profile tcont 50M-TRUNK type 4 maximum 5000...