The problem is, the old PC has only One NIC (Network Interface Card) and I’m too lazy to buy a new one. But I want to make it to become a router as a solution for other PCs, so they can also connect to the Internet.
Here are the list of what I want:
1. Create a router
2. Make it as a proxy server
3. Make the proxy transparent
I already setup my SQUID proxy to work on port 3128.
I’m using SQUID proxy server with the version > 2.6, and to make it transparent I add these lines on the /etc/squid/squid.conf :
http_port 3128 transparent
As I only have one NIC, I need to create a virtual ethernet, so it can have two different IP address (which of course, can have two different subnet). I’m using Ubuntu Server, so I change it on /etc/network/interfaces
# The primary network interface
#iface eth0 inet dhcp
iface eth0 inet static
name Ethernet Public IP
iface eth0:0 inet static
name Ethernet alias LAN card
Here’s the complete script of my Proxy Server, so it can work with only one network card, and work as a transparent proxy for the client. I give it a name /root/makemetransparent.sh
Voila ! Now, all PCs under the 192.168.168.0/24 network can connect to the Internet without having to put the proxy server in the browser setting.
– end of story –
The script is modified version from what I read here.