Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a Ubuntu 12.04 host that has a squid proxy on it running on port 8080. I want to proxy all the web traffic from the host through squid using iptables. Is the correct method:

iptables -t nat -I OUTPUT -p tcp -d --dport 80 -j REDIRECT --to-ports 8080

This is not working. When I browse to a page it appears normally, even when the proxy is disabled. Any suggestions appreciated.

share|improve this question

1 Answer 1

iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080

share|improve this answer
You can change that -A to -I to see immediate effect on the command line. –  Timothy Makobu Mar 23 '13 at 11:05

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.