Re: how do I redirect all outgoing packets using IPTABLES
From: Ramprasad A Padmanabhan (ramprasad.padmanabhan_at_oracle.com)
Date: 03/31/04
- Next message: Hetfield: "Re: sharing cdrwriter and scanner"
- Previous message: jack: "Re: Routing with multiple IPs"
- In reply to: Alexander Clouter: "Re: how do I redirect all outgoing packets using IPTABLES"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 31 Mar 2004 15:36:48 +0530
Alexander Clouter wrote:
> On 2004-03-30, Ramprasad A Padmanabhan <ramprasad.padmanabhan.nospam@oracle.com> 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
>>148.87.19.20:80
>>
>
> 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 148.87.19.20: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.
>
> Cheers
>
> Alex
Doesnt work
gives a syntax error
I tried
iptables -t nat -A OUTPUT -p tcp --dport 80 -j DNAT --to-destination \
--to-destination 148.87.19.20:80
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
Server Error
The following error occurred:
Bad URL
_________________________________________________________________
Please contact the administrator.
Is there a way out
- Next message: Hetfield: "Re: sharing cdrwriter and scanner"
- Previous message: jack: "Re: Routing with multiple IPs"
- In reply to: Alexander Clouter: "Re: how do I redirect all outgoing packets using IPTABLES"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|