February 2011
Intermediate to advanced
332 pages
9h 3m
English
Let's have a quick look at the configuration we need to perform. For the following, we'll assume that the IP for the Squid proxy server is 192.0.2.25.
To redirect traffic destined to port 80, we can use iptables as follows:
iptables -t nat -A PREROUTING -s 192.0.2.25 -p tcp --dport 80 -j ACCEPT iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.0.2.25:3128 iptables -t nat -A POSTROUTING -j MASQUERADE
In the previous list of commands, the first command prevents the redirecting HTTP traffic from the Squid server itself. If we don't have the first line in place, we'll face forwarding loops and requests will not be satisfied. The second command captures all ...
Read now
Unlock full access