Hello,
When you configure transparent proxy and gateway on the SAME machine, it works (shows the correct ip in the access.log). On SEPARATE MACHINES shows the gateway ip in the squid log
Gateway: 192.168.0.254 (FreeBSD 8 AMD64)
Proxy Server: 192.168.0.250 (FreeBSD 8 AMD64)
User: 192.168.0.200 (Windows XP)
Squid Version: 3.1.4 (compiled with pf-transparent) - Also tested with 2.6 and 2.6
Details:
Redirect www port to proxy server on GATEWAY (192.168.0.254):
Rules on PROXY SERVER (192.168.0.250)
squid.conf on PROXY SERVER (192.168.0.250)
Checking service:
By testing the transparent proxy on the user's machine works normally (Windows XP/192.168.0.200) But in the squid log shows the gateway IP (192.168.0.254… correct is: 192.168.0.200).
What is the problem? The NAT changes the SOURCE IP? if I disable the NAT, it does not work.
Sorry by my poor english =)
Regards ïŠ
Welkson Renny
Sysadmin
When you configure transparent proxy and gateway on the SAME machine, it works (shows the correct ip in the access.log). On SEPARATE MACHINES shows the gateway ip in the squid log

Gateway: 192.168.0.254 (FreeBSD 8 AMD64)
Proxy Server: 192.168.0.250 (FreeBSD 8 AMD64)
User: 192.168.0.200 (Windows XP)
Squid Version: 3.1.4 (compiled with pf-transparent) - Also tested with 2.6 and 2.6
Details:
Redirect www port to proxy server on GATEWAY (192.168.0.254):
Code:
nat on $int_if from ! 192.168.0.250 to 192.168.0.250 port { 80, 8080 } -> $int_if
rdr inet proto tcp from ! 192.168.0.250 to any port www -> 192.168.0.250 port 8080
pass all # lab test
Rules on PROXY SERVER (192.168.0.250)
Code:
pass all # lab test
squid.conf on PROXY SERVER (192.168.0.250)
Code:
http_port 8080 transparent
…
always_direct allow all
…
forwarded_for on # tested
Checking service:
Code:
[root@services:/] # sockstat -4 | grep 8080
squid squid 1900 11 tcp4 *:8080 *:*
By testing the transparent proxy on the user's machine works normally (Windows XP/192.168.0.200) But in the squid log shows the gateway IP (192.168.0.254… correct is: 192.168.0.200).
Code:
[root@services:/] # tail -f /usr/local/squid/logs/access.log
[color="Red"][B]192.168.0.254[/B][/color] - - [17/Jun/2010:11:53:48 -0300] "GET [url]http://comentarios.uol.com.br/ws/v1/message/retrieve/subject/104?callback=callbackColetarComentarios&product=esporte&limit=50[/url] HTTP/1.1" 0 0 TCP_MISS:DIRECT
What is the problem? The NAT changes the SOURCE IP? if I disable the NAT, it does not work.
Sorry by my poor english =)
Regards ïŠ
Welkson Renny
Sysadmin