All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Beverley <andy@andybev.com>
To: Jorge Bastos <mysql.jorge@decimal.pt>
Cc: netfilter@vger.kernel.org
Subject: Re: Help on outgoing packet (without NAT)
Date: Wed, 21 Sep 2011 22:47:25 +0100	[thread overview]
Message-ID: <1316641645.9850.225.camel@andybev-desktop> (raw)
In-Reply-To: <5b10ceef17baa191e62d2d9357257887@decimal.pt>

On Wed, 2011-09-21 at 22:23 +0100, Jorge Bastos wrote:
> 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.

Andy



  reply	other threads:[~2011-09-21 21:47 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 [this message]
2011-09-22 15:58           ` Jorge Bastos
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=1316641645.9850.225.camel@andybev-desktop \
    --to=andy@andybev.com \
    --cc=mysql.jorge@decimal.pt \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.