title: Transparent Proxy Squid with internal and external network
body: <p>I have network setup like this with external and internal network.</p>
  
  <p>I have successfully got squid running with proxy for internal browser and now I want to set up as transparent but having some problem.</p>
  
  <p><strong>network</strong></p>
  
  <p><img src="https://i.stack.imgur.com/4ZSV1.jpg" alt="THIS IS MY NETWORK"></p>
  
  <p>First, I did change "http_port 8080 intercept" but having trouble with setting up correct Iptables on the external server as the packet is not getting back to squid box.</p>
  
  <pre><code>iptables --policy INPUT DROP 
  iptables --policy OUTPUT DROP 
  iptables --policy FORWARD ACCEPT
  iptables -A INPUT -i lo -j ACCEPT 
  iptables -A OUTPUT -0 lo -j ACCEPT
  iptables -t nat -A POSTROUTING -o enpos3 (this is NAT) -j MASQUERADE
  iptables -I INPUT -s 192.168.1.0/24 -p tcp --dport 8080 -j ACCEPT
  iptables -t nat -A PREROUTING -i enp0s3 -p tcp --dport 80 -j DNAT --to-destination 10.10.1.254:8080
  iptables -t nat -A PREROUTING -i enp0s8 -p tcp --dport 80 -j REDIRECT --to-port 8080
  </code></pre>
  
  <p>This is far as I got and internet works fine on internal pc but I'm not sure how to redirect http 80 packet to Squid box (<code>10.10.1.254:8080</code>)</p>