|
Using Shorewall with Squid |
|
ACTION SOURCE DEST PROTO DEST
PORT(S)SOURCE
PORT(S)ORIGINAL
DESTREDIRECT loc 3128 tcp www -
!206.124.146.177 ACCEPT fw net tcp www
WARNING: This setup may conflict with
other aspects of your gateway including but not limited to traffic shaping
and route redirection. For that reason, I don't recommend it.
echo 202 www.out >> /etc/iproute2/rt_tables
if [ -z "`ip rule list | grep www.out`" ] ; then
ip rule add fwmark 202 table www.out
ip route add default via 192.168.1.3 dev eth1 table www.out
ip route flush cache
echo 0 > /proc/sys/net/ipv4/conf/eth1/send_redirects
fi
ACTION | SOURCE | DEST | PROTO | DEST PORT(S) |
SOURCE PORT(S) |
ORIGINAL DEST |
ACCEPT |
loc | loc |
tcp | www | |
SOURCE |
DESTINATION |
POLICY |
LOG LEVEL |
BURST PARAMETERS |
loc |
loc |
ACCEPT |
iptables -t mangle -A PREROUTING -i eth1 -s ! 192.168.1.3 -p tcp --dport 80 -j MARK --set-mark 202
iptables -t nat -A PREROUTING -i eth0 -d ! 192.168.1.3 -p tcp --dport 80 -j REDIRECT --to-ports 3128
If you are running RedHat on the server, you can simply execute the following commands after you have typed the iptables command above:
iptables-save > /etc/sysconfig/iptables
chkconfig --level 35 iptables start
echo 202 www.out >> /etc/iproute2/rt_tables
if [ -z "`ip rule list | grep www.out`" ] ; then
ip rule add fwmark 202 table www.out
ip route add default via 192.0.2.177 dev eth1 table www.out
ip route flush cache
fi
iptables -t nat -A PREROUTING -i eth2 -p tcp --dport 80 -j MARK --set-mark 202
ACTION
SOURCE
DEST
PROTO
DEST
PORT(S)
CLIENT
PORT(2)
ORIGINAL
DEST
ACCEPT
dmz
net
tcp
80
iptables -t nat -A PREROUTING -i eth0 -d ! 192.0.2.177 -p tcp --dport 80 -j REDIRECT --to-ports 3128
If you are running RedHat on the server, you can simply execute the following commands after you have typed the iptables command above:
iptables-save > /etc/sysconfig/iptables
chkconfig --level 35 iptables start
Updated 1/10/2003 - Tom Eastep
Copyright © 2003 Thomas M. Eastep.