From: Eric Dumazet <eric.dumazet@gmail.com>
To: Denys Fedoryshchenko <denys@visp.net.lb>
Cc: netdev@vger.kernel.org, netfilter@vger.kernel.org
Subject: Re: conntrack, NAT and icmp echo reply
Date: Thu, 11 Oct 2012 11:57:10 +0200 [thread overview]
Message-ID: <1349949430.21172.8435.camel@edumazet-glaptop> (raw)
In-Reply-To: <e457eb3b6f3e357c3681c7af5f504161@visp.net.lb>
On Thu, 2012-10-11 at 12:41 +0300, Denys Fedoryshchenko wrote:
> Hi all
>
> I have NAT box, with very simple rule
> iptables -t nat -I POSTROUTING -s 10.0.0.0/8 -j MASQUERADE
> It can be SNAT also, and it works fine, as NAT.
>
> When i generate icmp _reply_ packet, to some host
> hping -I ppp0 -1 --icmptype 0 8.8.8.8
>
> It will pass the box, and will exit it without NAT, e.g. with original
> IP 10.x.x.x
> on outgoing interface, which is not expected behavior IMHO.
> Is it a bug or feature?
>
It depends, -s 10.0.0.0/8 wont match the rule if the source address
should be 198.23.44.55 I guess ?
I would try the more obvious
iptables -t nat -I POSTROUTING -o device -j MASQUERADE
next prev parent reply other threads:[~2012-10-11 9:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-11 9:41 conntrack, NAT and icmp echo reply Denys Fedoryshchenko
2012-10-11 9:57 ` Eric Dumazet [this message]
2012-10-11 10:02 ` Denys Fedoryshchenko
2012-10-12 5:13 ` Vigneswaran R
2012-10-12 6:59 ` Denys Fedoryshchenko
2012-10-12 12:41 ` Jozsef Kadlecsik
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=1349949430.21172.8435.camel@edumazet-glaptop \
--to=eric.dumazet@gmail.com \
--cc=denys@visp.net.lb \
--cc=netdev@vger.kernel.org \
--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