Re: how do I redirect all outgoing packets using IPTABLES

From: Ramprasad A Padmanabhan (ramprasad.padmanabhan_at_oracle.com)
Date: 03/31/04


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



Relevant Pages

  • Re: How to find proxy server used by lynx
    ... need to change if I want new proxy server to be set. ... through intra-net, but can't access internet. ... lynx and do surfing. ... > for the first time, check the config files of other browsers, or ask ...
    (comp.unix.questions)
  • Re: How to find proxy server used by lynx
    ... > I would like to find out the proxy server used by lynx for connecting to ... If you are installing lynx ... for the first time, check the config files of other browsers, or ask ... your internet provider. ...
    (comp.unix.questions)
  • Re: HttpContext.Current.Request.UserHostAddress issue
    ... what happened is all web app use a sign on portal which authenticate user ... then redirect them to the appropriate application and the login portal is ... I guess there is no way I can get the proper IP in this kind of setup. ... >> IP in the context is the proxy server IP, ...
    (microsoft.public.dotnet.framework.aspnet)
  • [opensuse] Squid 2.6 transparent configuration on opensuse10.2
    ... I have a proxy server and also running as firewall. ... Client cannot access an FTP server using Firefox unless it ... I also set in SuSEfirewall2 to redirect an internal access to port 80 using ...
    (SuSE)
  • How to change SMTP and POP3 settings in Outlook XP on all domain computers?
    ... I set a proxy server and I wish to redirect all of mail traffic to it. ... But for this I have to change settings in clients and I don't want to ...
    (microsoft.public.windows.server.general)