From: Simon Lodal <simonl@parknet.dk>
To: netfilter@lists.netfilter.org
Subject: Re: DNAT hiding routers behind it
Date: Sat, 07 Aug 2004 04:51:36 +0200 [thread overview]
Message-ID: <411443B8.8090202@parknet.dk> (raw)
In-Reply-To: <200408062356.16206.Antony@Soft-Solutions.co.uk>
> My guess is that you have a MASQUERADE rule with no interface specified - so
> packets get the source address of the firewall whether they're going out or
> coming in?
>
> Make sure you specify "-o eth0" or "-o ppp0" or whatever your external
> interface is called.
>
> If not that, post your ruleset so we can have a further think...
Testcase, as simple as possible:
pc has 10.44.252.2
fw has 10.44.252.1 on inside (vmnet2), 10.44.8.10 on outside (eth0).
On outside of fw there is a chain of routers; 10.44.8.1 => 192.168.44.1,
which is again connected to both 192.168.1.11 and 192.168.2.11 which
I'll use below.
masquerading or snat (tried both, no difference):
root@fw # iptables -t nat -A POSTROUTING -o eth0 -s 10.44.252.2 -j SNAT
--to-source 10.44.8.10
No other iptables rules are defined yet.
simonl@pc $ traceroute -q1 -I 192.168.1.11
traceroute to 192.168.1.11 (192.168.1.11), 30 hops max, 38 byte packets
1 10.44.252.1 (10.44.252.1) 4.297 ms
2 10.44.8.1 (10.44.8.1) 3.892 ms
3 192.168.44.1 (192.168.44.1) 4.826 ms
4 192.168.1.11 (192.168.1.11) 5.095 ms
All good. Now for the fun (dnat to another host at similar distance):
root@fw # iptables -t nat -A PREROUTING -i vmnet2 -s 10.44.252.2 -d
192.168.1.11 -j DNAT --to-destination 192.168.2.11
simonl@pc $ traceroute -q1 -I 192.168.1.11
traceroute to 192.168.1.11 (192.168.1.11), 30 hops max, 38 byte packets
1 10.44.252.1 (10.44.252.1) 1.854 ms
2 192.168.1.11 (192.168.1.11) 9.378 ms
3 192.168.1.11 (192.168.1.11) 17.237 ms
4 192.168.1.11 (192.168.1.11) 3.783 ms
See?
I tried dnat'ing without snat on a real network, same problem.
So snat/masquerade has no influence (it is just needed for my setup).
Simon
next prev parent reply other threads:[~2004-08-07 2:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-06 17:25 DNAT hiding routers behind it Simon Lodal
2004-08-06 18:26 ` Dick St.Peters
2004-08-06 21:08 ` Simon Lodal
2004-08-06 22:56 ` Antony Stone
2004-08-07 2:51 ` Simon Lodal [this message]
2004-08-07 7:37 ` Antony Stone
2004-08-07 14:47 ` Simon Lodal
2004-08-11 20:29 ` Aleksandar Milivojevic
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=411443B8.8090202@parknet.dk \
--to=simonl@parknet.dk \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox