All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vigneswaran R <vignesh@atc.tcs.com>
To: Al Grant <bigal.nz@gmail.com>
Cc: netfilter <netfilter@vger.kernel.org>
Subject: Re: SNAT rule on LAN - unexpected result
Date: Mon, 22 Jul 2013 11:01:13 +0530	[thread overview]
Message-ID: <51ECC3A1.4050002@atc.tcs.com> (raw)
In-Reply-To: <CAODtcdc7X8yJjihVcQomBNuuHGHPLebM2W9SGD_AA62fjwC-cg@mail.gmail.com>

On 07/21/2013 02:21 PM, Al Grant wrote:
> Hi All,
>
> Doing a little experimenting with iptables and more specifically SNAT.
>
> I have two computers, a Ubunutu box and a Win7 box with a  switch between them.
>
> On the Ubuntu box (192.168.15.200) I have added:
>
> iptables -t nat -A POSTROUTING -o eth4 -j SNAT --to-source 192.168.15.201
>
>
> Now I run wireshark on the Win7 machine and various bits of broadcast
> traffic which was coming from .200 now shows as from .201 - great!
>
> So I tried a ping from the Win7 machine and would expect a reply to
> show in wireshark, but that the src address be changed to .201 - but
> nope I get a reply from .200. How is this so?
> Conversely a ping from the Ubuntu machine to the win7 machine shows
> the packets with a src of .201 in wireshark - as expected.

I think, this is due to the fact that 'nat' table will be consulted only 
for new connections. Unlike ping request, the ping *reply* may not be 
considered as part of a new connection.


Regards,
Vignesh

      reply	other threads:[~2013-07-22  5:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-21  8:51 SNAT rule on LAN - unexpected result Al Grant
2013-07-22  5:31 ` Vigneswaran R [this message]

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=51ECC3A1.4050002@atc.tcs.com \
    --to=vignesh@atc.tcs.com \
    --cc=bigal.nz@gmail.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 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.