Hello
I'm currently trying to move my proxy (SQUID) from my DEBIAN to a jail on FreeBSD 9-Release
The server has two network interfaces connected to 2 private subs:
em0: 192.168.200.2
em1: 192.168.199.7
I setup a jail which is connected to em0 with IP 192.168.200.202 and installed SQUID in there. SQUID works fine if I set it's IP address in the browsers as explicit proxy server. My client is 192.168.199.11 and if I set 192.168.200.202 as proxy everything works fine. So ip-forwarding on the server should not be the issue.
But I cannot access the web if I try SQUID as a transparent proxy. To do so I setup the following on the router in the sub connected on em1 (192.168.199.1) in IPTABLES
the 3rd rule is not-active at the moment, but it does not work either if the rule is active
On the FreeBSD server I setup a "port-forward"-rule in my IPNAT rules file /etc/ipnat.rules
imho this should forward all traffic on port 80 to the ip of the jail with SQUID and port 3128.
SQUID is configured as transparent proxy by the following in /usr/local/etc/squid/squid.conf
and finally I have a rule on the router firewall (IPTABLES) of em0-sub to DROP all traffic on port 80 which is not originated by the SQUID ip address
but if I check the state with
for me it seems that the requests are not originated by 192.168.200.202, that should be the only reason for this rule to take action. But this only happens when I try transparent mode. If I set the proxy manually in the browser settings, then this rule seems not to take action as the requests to the web are successful. Otherwise I could not write this post 
does anyone have a clue what I could check or in which region the problem could be? I use IPF as firewall on the server but currently no rules are in place, so imho it should not be a firewall issue too.
Thanks for any hint
tobi
I'm currently trying to move my proxy (SQUID) from my DEBIAN to a jail on FreeBSD 9-Release
The server has two network interfaces connected to 2 private subs:
em0: 192.168.200.2
em1: 192.168.199.7
I setup a jail which is connected to em0 with IP 192.168.200.202 and installed SQUID in there. SQUID works fine if I set it's IP address in the browsers as explicit proxy server. My client is 192.168.199.11 and if I set 192.168.200.202 as proxy everything works fine. So ip-forwarding on the server should not be the issue.
But I cannot access the web if I try SQUID as a transparent proxy. To do so I setup the following on the router in the sub connected on em1 (192.168.199.1) in IPTABLES
Code:
iptables -t mangle -I PREROUTING -j ACCEPT -p tcp --dport 80 -s 192.168.199.1
iptables -t mangle -A PREROUTING -j MARK --set-mark 3 -p tcp --dport 80
#iptables -t mangle -A POSTROUTING -p tcp --dport 80 -d 192.168.199.7 -j SNAT --to 192.168.199.1
ip rule add fwmark 3 table 2
ip route add default via 192.168.199.7 dev br0 table 2
On the FreeBSD server I setup a "port-forward"-rule in my IPNAT rules file /etc/ipnat.rules
Code:
rdr em1 192.168.199.7/32 port 80 -> 192.168.200.202 port 3128 tcp
SQUID is configured as transparent proxy by the following in /usr/local/etc/squid/squid.conf
Code:
http_port 192.168.200.202:3128 transparent
Code:
DROP tcp -- !192.168.200.202 0.0.0.0/0 tcp dpt:80
$ iptables -L FORWARD -nv
I can see that every http request via transparent proxy gets dropped
Code:
[B]3478 181K[/B] DROP tcp -- * * !192.168.200.202 0.0.0.0/0 tcp dpt:80

does anyone have a clue what I could check or in which region the problem could be? I use IPF as firewall on the server but currently no rules are in place, so imho it should not be a firewall issue too.
Thanks for any hint
tobi