Re: how do I redirect all outgoing packets using IPTABLES
From: Ramprasad A Padmanabhan (ramprasad.padmanabhan_at_oracle.com)
Date: Wed, 31 Mar 2004 15:36:48 +0530
Alexander Clouter wrote:
> On 2004-03-30, Ramprasad A Padmanabhan <firstname.lastname@example.org> wrote:
>>I am behind a proxy server.
>>Now there is a module which gets information from the internet, but this
>>module does not have the intelligence of using a proxy server.
>>So I want all packets originating from my machine to port 80 (outside my
>>network ) should be redirected to a proxy server.
>>Luckily the proxy server does not ask for authentication
>>I tried doing this
>>iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to
> REDIRECT will only redirect the packets to the local host (which I guess you
> could make an ssh tunnel or something), what you want is
> iptables -t nat -A POSTROUTING -p tcp --dport 80 -j DNAT \
> --to-destination 18.104.22.168:80
> however I would recommend against putting the proxy server on port 80.
> If you had typed 'man iptables' and looked for 'REDIRECT' you would of seen
> where you went wrong.
gives a syntax error
iptables -t nat -A OUTPUT -p tcp --dport 80 -j DNAT --to-destination \
This works but I am not able to make any use of it
FOR eg. This is what I get if I use lynx
lynx -dump http://rediff.com
The following error occurred:
Please contact the administrator.
Is there a way out