Take the 2-minute tour ×

My computer has two connections: ppp0 (to internet) and eth0 (as masquerade). I'm also running a proxy on port 8080. I'm using this computer as a router. Is there a quick iptables hack that will redirect port 80 to port 8080 (my local proxy)?

share|improve this question
add comment

1 Answer

Traffic from the local machine or from the attached internal network?

For local: iptables -t nat -A OUTPUT -p tcp --dport 80 -j DNAT --to-destination


share|improve this answer
Shouldn't you be using REDIRECT for local traffic not DNAT –  topdog Jul 29 '10 at 6:43
That's the command I used, but I'm getting errors from Privoxy saying something about the headers being wrong. I'm going to try REDIRECT. –  user49657 Jul 29 '10 at 20:54
It's quite possible that's a more efficient solution. I'm actually not sure I've ever tried redirecting to a service on before (most services I run only listen on a specific public IP and not localhost), and if so it was pre-redirect-target days (2.2 kernel). –  Jeremy M Jul 30 '10 at 1:06
add comment

Your Answer

