All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philip Craig <philipc@snapgear.com>
To: Jesse Gordon <jesseg@nikola.com>
Cc: netfilter@lists.netfilter.org
Subject: Re: Unmatchable packet?
Date: Wed, 23 Nov 2005 16:05:19 +1000	[thread overview]
Message-ID: <4384069F.3010201@snapgear.com> (raw)
In-Reply-To: <078401c5efcf$bd9eb210$5e00800a@printserver>

On 11/23/2005 11:46 AM, Jesse Gordon wrote:
> I actually want to rewrite the source IP of TCP packets that exit a given 
> ethernet card -- even (especially) if they are generated as responses to 
> incoming connections to the box.
> 
>  Lets say I have 2 machines: S, and C;
> S is the server, and I am on C[lient]. Both machines are sitting on a simple 
> isolated flat LAN.
> 
> Normally, when C connects to S, S replies with it's own source address. This 
> is normal operation, and is what I want to alter.
> I wish for the replies from S to be to reach C with an arbitrarly assigned 
> source address.
> (And I want the source address rewrite to be performed inside S)

You can't do this with iptables.  NAT rules only match the first packet
of a connection, and the NAT mapping that is determined for that first
packet is applied to all subsequent packets in that connection.

Futhermore, it doesn't make sense to do this.  The client will receive
packets from your arbitarily assigned source address, but will not know
what to do with them since it never sent any packets to that address,
and so it will just drop them.


  reply	other threads:[~2005-11-23  6:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-22 20:58 Unmatchable packet? Jesse Gordon
2005-11-22 21:28 ` Jesse Gordon
2005-11-23  0:46   ` Nikolai Georgiev
2005-11-23  1:46     ` Jesse Gordon
2005-11-23  6:05       ` Philip Craig [this message]
2005-11-23  7:03         ` Jesse Gordon
2005-11-23  7:19           ` Philip Craig
2005-11-24 11:48             ` Jesse Gordon
2005-11-24 14:29               ` Robert Nichols
2005-11-25  1:11               ` Philip Craig
2005-11-28 19:11                 ` Jesse Gordon

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=4384069F.3010201@snapgear.com \
    --to=philipc@snapgear.com \
    --cc=jesseg@nikola.com \
    --cc=netfilter@lists.netfilter.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.