Search squid archive

Re: redirect all ports to squid

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxxxx
http://lists.squid-cache.org/listinfo/squid-users

_______________________________________________
squid-users mailing list
squid-users@xxxxxxxxxxxxxxxxxxxxx
http://lists.squid-cache.org/listinfo/squid-users

[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux