Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 a Linux as router, eth0 ( connect to LAN, eth1 ( connect to Internet. squid works well, I can set or as proxy in web browser and visit http and https web-site.

now, I want to use iptables to setup transparent proxy, which means I can visit web site without setting proxy in my web browser.

Now, http is OK, but https is failed. would someone help me? thank you!

iptables config

iptables -t filter -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -t filter -A FORWARD -i eth0 -p tcp --dport 443 -j ACCEPT
iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to-source
iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j DNAT --to-destination
iptables -t nat -A PREROUTING -i eth1 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
share|improve this question
What is the error message? Do you want to allow https to pass through firewall or get redirected to proxy transparently? – Khaled Feb 3 '13 at 15:03
I want to visit https without setting proxy in browser (now i have to set – siyuan Feb 3 '13 at 23:36

Your Answer


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

Browse other questions tagged or ask your own question.