From: Patrick McHardy <kaber@trash.net>
To: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2005@gmx.net>
Cc: Netfilter Development Mailinglist <netfilter-devel@lists.netfilter.org>
Subject: Re: SNAT from multiple interfaces with the same IP?
Date: Sun, 04 Dec 2005 16:31:59 +0100 [thread overview]
Message-ID: <43930BEF.9000602@trash.net> (raw)
In-Reply-To: <4392E148.7010102@gmx.net>
Carl-Daniel Hailfinger wrote:
> Hi,
>
> some time ago, I read that netfilter is unable to perform SNAT
> for identical ranges on different interfaces.
>
> Scenario:
>
> eth0: 192.168.0.1/16
> eth1: 192.168.0.1/16
> eth2: 10.2.0.1/8
>
> iptables -t nat -A POSTROUTING -i eth0 -s 192.168.0.0/16 -j SNAT
> --to-source 10.0.0.0-10.0.255.255
> iptables -t nat -A POSTROUTING -i eth1 -s 192.168.0.0/16 -j SNAT
> --to-source 10.1.0.0-10.1.255.255
>
> Will that work or is connection tracking unable to differentiate
> between the 192.168/16 subnets on eth0 and eth1? My problem is
> that although the ranges on eth0 and eth1 are sparsely populated,
> some IPs exist in both networks. Communication between the networks
> on eth0 and eth1 is not necessary, I just want them to be able to
> communicate with the outside (on eth2).
I don't see why it wouldn't work, but you can't use -i in POSTROUTING
directly, you need to mark the packets or just SNAT unconditionally.
next prev parent reply other threads:[~2005-12-04 15:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-04 12:30 SNAT from multiple interfaces with the same IP? Carl-Daniel Hailfinger
2005-12-04 15:31 ` Patrick McHardy [this message]
2005-12-04 15:37 ` Herve Eychenne
2005-12-04 16:02 ` Patrick McHardy
2005-12-04 23:35 ` Herve Eychenne
2005-12-04 23:41 ` Patrick McHardy
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=43930BEF.9000602@trash.net \
--to=kaber@trash.net \
--cc=c-d.hailfinger.devel.2005@gmx.net \
--cc=netfilter-devel@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.