Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have configured squid to work as NAT using

apt-get install squid
iptables -t nat -A PREROUTING -i eth1 -p tcp -m tcp --dport 80 -j DNAT --to-destination
iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128

Have added to /etc/squid/squid.conf

acl internal_network src
http_access allow internal_network

access_log /var/log/squid/access.log squid

Problem: /var/log/squid/access.log is empty when I use proxy from remote computers.
When I make telnet localhost 3128 then it does write to log:
1308144959.810 0 TCP_DENIED/400 1693 NONE NONE:// - NONE/- text/html
So the problem is that logging is somehow turned off for remote proxy use.


  • /var/log/squid/ - 0777
  • /var/log/squid/* - 0666

cat /var/log/squid/cache.log | grep access gives
logfileOpen: opening log /var/log/squid/access.log

without any errors.

share|improve this question
up vote 1 down vote accepted

My network interface was br0, not eth0 or eth1

iptables -t nat -A PREROUTING -i br0 -p tcp -m tcp --dport 80 -j DNAT --to-destination

fixed the problem.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.