Link to home
Start Free TrialLog in
Avatar of sagarh
sagarhFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Setting up Linux and Squid

Hi

I am hoping someone could help me or point me in the right direction with this issue.
I basically have set up a Linux Server with 2 network cards (eth0 and eth1) both working - I also have installed Squid version 3 administered from Webmin.

I would like to know how I can set the system up so that I can route from 1 network card to the other so that my internet traffic uses NAT. My eth1 card is linked to my broadband modem.

I also need to know (if any) how to setup Squid to forward requests to eth1 once it is approved.

Thanks for the help!

Sagar

ASKER CERTIFIED SOLUTION
Avatar of Casey Herman
Casey Herman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

Use pfSense - http://www.pfsense.org

It is a router and firewall with bundled squid3.
The configuration is also web based.

You can try it without installing it, just boot up with the CD.

Download The live CD version - pfSense-1.2.3-RELEASE-LiveCD-Installer.iso.gz from http://www.pfsense.org/mirror.php?section=downloads 
Write it to a CD, and boot with it.

There is plenty help available online, and you can even buy the book on amazon.com
You can use;
echo 1 > /proc/sys/net/ipv4/ip_forward

to temporarily enable routing
But basically it depends what distribution you are using

You need to use either iptables or ipchains which will allow you to enable Masquarading (NAT) on anything entering the server on a specific NIC

see http://tldp.org/HOWTO/IP-Masquerade-HOWTO/firewall-examples.html#RC.FIREWALL-IPTABLES

Once this is setup squid will block or allow traffic through the server based on your squid ACLs