[squid-users] redirect all ports to squid

Squid squid at visolve.com
Fri Oct 10 09:51:55 UTC 2014


Hi,

Yes, we can redirect the ports to squid through our firewall rules.

Check below lines to redirect the ports.
We have some different methods to do.
1. In first Method:
     First, we need to machine that squid will be running on, You do not 
need iptables or any special kernel options on this machine, just squid. 
You *will*, however, need the 'http_accel' options as described above.

     You'll want to use the following set of commands on iptables-box:

  * iptables -t nat -A PREROUTING -i eth0 -s ! *squid-box* -p tcp
    --dport 80 -j DNAT --to *squid-box*:3128
  * iptables -t nat -A POSTROUTING -o eth0 -s *local-network* -d
    *squid-box* -j SNAT --to *iptables-box*
  * iptables -A FORWARD -s *local-network* -d *squid-box* -i eth0 -o
    eth0 -p tcp --dport 3128 -j ACCEPT

2. And have another method:

  * iptables -t mangle -A PREROUTING -j ACCEPT -p tcp --dport 80 -s
    *squid-box*
  * iptables -t mangle -A PREROUTING -j MARK --set-mark 3 -p tcp --dport 80
  * ip rule add fwmark 3 table 2
  * ip route add default via *squid-box* dev eth1 table 2

         (OR)

     iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT 
--to-port 3128

Regards,
Visolve Squid

On 9/30/2014 10:11 PM, hadi wrote:
> It's possible to redirect all ports to squid ? thru iptables ?
> For example port 25 smtp,143 imap, etc...
> Can squid handle that. In transparent mode.
>
> _______________________________________________
> squid-users mailing list
> squid-users at lists.squid-cache.org
> http://lists.squid-cache.org/listinfo/squid-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squid-cache.org/pipermail/squid-users/attachments/20141010/b35db325/attachment-0001.html>


More information about the squid-users mailing list