<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi,<br>
    <br>
    Yes, we can redirect the ports to squid through our firewall rules.<br>
    <br>
    Check below lines to redirect the ports.<br>
    We have some different methods to do.<br>
    1. In first Method:<br>
        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.<br>
    <br>
        You'll want to use the following set of commands on
    iptables-box:
    <ul>
      <li>iptables -t nat -A PREROUTING -i eth0 -s ! <b>squid-box</b>
        -p tcp --dport 80 -j DNAT --to <b>squid-box</b>:3128</li>
      <li>iptables -t nat -A POSTROUTING -o eth0 -s <b>local-network</b>
        -d <b>squid-box</b> -j SNAT --to <b>iptables-box</b></li>
      <li>iptables -A FORWARD -s <b>local-network</b> -d <b>squid-box</b>
        -i eth0 -o eth0 -p tcp --dport 3128 -j ACCEPT</li>
    </ul>
    <p>2. And have another method:<br>
    </p>
    <ul>
      <li>iptables -t mangle -A PREROUTING -j ACCEPT -p tcp --dport 80
        -s <b>squid-box</b></li>
      <li>iptables -t mangle -A PREROUTING -j MARK --set-mark 3 -p tcp
        --dport 80</li>
      <li>ip rule add fwmark 3 table 2</li>
      <li>ip route add default via <b>squid-box</b> dev eth1 table 2</li>
    </ul>
    <p>        (OR)</p>
    <p>    iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j
      REDIRECT --to-port 3128</p>
    Regards,<br>
    Visolve Squid<br>
    <br>
    <div class="moz-cite-prefix">On 9/30/2014 10:11 PM, hadi wrote:<br>
    </div>
    <blockquote cite="mid:DUB123-DS15337FBB7B90E43B736C7EB3BB0@phx.gbl"
      type="cite">
      <pre wrap="">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.

</pre>
    </blockquote>
    <blockquote cite="mid:DUB123-DS15337FBB7B90E43B736C7EB3BB0@phx.gbl"
      type="cite">
      <pre wrap="">_______________________________________________
squid-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:squid-users@lists.squid-cache.org">squid-users@lists.squid-cache.org</a>
<a class="moz-txt-link-freetext" href="http://lists.squid-cache.org/listinfo/squid-users">http://lists.squid-cache.org/listinfo/squid-users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>