LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Redirecting all traffic through HTTP proxy using iptables (https://www.linuxquestions.org/questions/linux-networking-3/redirecting-all-traffic-through-http-proxy-using-iptables-738918/)

globemast 07-09-2009 10:14 AM

Redirecting all traffic through HTTP proxy using iptables
 
Hi all,

I would like to redirect all traffic to a known HTTP proxy my ISP owns and which i have access to it.

Is this possible via IPTABLES?

If yes, could you give me a hint on the rules?

Thanks in advance.

anandnenwani 11-17-2011 01:11 AM

What actually you want to do ..??

and what is your network map...??

TimothyEBaldwin 11-17-2011 04:49 PM

No, you can only redirect HTTP traffic via HTTP proxy, Iptables will not add the CONNECT line that is required forward non-HTTP traffic, and can not redirect IPv6 traffic.

Something like this should work:
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-destination proxy.example.com


All times are GMT -5. The time now is 03:19 PM.