Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Jorge Bastos <mysql.jorge@decimal.pt>
To: Andrew Beverley <andy@andybev.com>
Cc: netfilter@vger.kernel.org
Subject: Re: Help on outgoing packet (without NAT)
Date: Thu, 22 Sep 2011 16:58:49 +0100	[thread overview]
Message-ID: <675a49fcb8ddc3c241fab160c59946d8@decimal.pt> (raw)
In-Reply-To: <1316641645.9850.225.camel@andybev-desktop>

Hi Andy,

>> Howdy, I'd like some help on how can I redirect the outgoing packets
>> without using NAT. I have a machine, that when requests to IP 
>> 5.5.5.5
>> and port 80 are made, the request be redirected to 192.168.1.221:80 
>> I'm
>> trying this but no luck, maybe I'm close to it: iptables -I FORWARD 
>> -d
>> 5.5.5.5 -p tcp --dport 80 --to 192.168.1.221:80 What can I missing 
>> or
>> what do I need to add?
>
> Assuming that you are referring to packets generated on the local
> machine (which is what is implied), then you need to use OUTPUT 
> instead
> of FORWARD.
>
> FORWARD is only for packets that arrive from another machine. OUTPUT 
> is
> for locally generated packets.

Correct, local generated packets.
Tried:

iptables -I OUTPUT -d 5.5.5.5 -p tcp --dport 80 --redirect-to 
192.168.1.221:80

I'm missing something but not sure what, but it's on the redirect part.

  reply	other threads:[~2011-09-22 15:58 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-19 15:29 ping broadcast into forward chain?? (IN=eth0 OUT=eth0)!! Julio A. Romero
2011-09-19 15:38 ` Jan Engelhardt
     [not found]   ` <9C0FCAA46B9040869B79B468CCA7391C@poweredge1800>
2011-09-19 15:55     ` Jan Engelhardt
2011-09-19 16:10       ` Julio A. Romero
2011-09-19 16:15         ` Jan Engelhardt
2011-09-19 16:38           ` Julio A. Romero
2011-09-19 17:07             ` Jan Engelhardt
2011-09-20  0:22           ` Julio A. Romero
2011-09-21 21:23       ` Help on outgoing packet (without NAT) Jorge Bastos
2011-09-21 21:47         ` Andrew Beverley
2011-09-22 15:58           ` Jorge Bastos [this message]
2011-09-22 16:29             ` Jan Engelhardt
2011-09-22 16:31               ` Jorge Bastos
2011-09-22 16:39             ` Leonardo Rodrigues
2011-09-22 16:44               ` Jorge Bastos
2011-09-22 16:46                 ` Jan Engelhardt
2011-09-22 17:02                 ` Leonardo Rodrigues
2011-09-21 22:42         ` Jan Engelhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=675a49fcb8ddc3c241fab160c59946d8@decimal.pt \
    --to=mysql.jorge@decimal.pt \
    --cc=andy@andybev.com \
    --cc=netfilter@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox