From: Delian Krustev <krustev@krustev.net>
To: netfilter@lists.netfilter.org
Subject: MASQUERADE: Route sent us somewhere else
Date: Thu, 4 Mar 2004 22:11:21 +0200 [thread overview]
Message-ID: <200403042211.21740.krustev@krustev.net> (raw)
Hi,
I've red the postings about similar messages in the syslog posted in the
mailing list. However my problem is quite different. Here's the setup:
eth1
eth0 +---------+ static ip
*LAN* -----------| |-------- \
|linux-box| *INTERNET*
| |-------- /
+---------+ eth2
dhcp configured
*mangle
-A FORWARD -j MARK --set-mark 0x1
*nat
-A POSTROUTING -o eth1 -j SNAT --to-source <eth1 ip>
-A POSTROUTING -o eth2 -j MASQUERADE
/sbin/ip ru add fwmark 0x1 lookup FW prio 40
The main table routes internet traffic via eth2 by default. I'me referencing
the FW table for forwarded traffic, which routes inet traffic via eth1.
However, the SNAT rule in the nat table is ignored(eth1 is not
correctly selected) and the MASQUERADE rule takes place. The packets
are not sent trough eth2 either, and here comes the syslog msg:
MASQUERADE: Route sent us somewhere else
I'm using similar setup for localy generated packets(
*mangle
-A OUTPUT -o eth2 -m owner --uid-owner dev -j MARK --set-mark 0x1
), which works just fine.
Currenly I'm able to workaround the problem by adding the following rule :
/sbin/ip ru add iif eth0 lookup FW prio 45 # [1]
I think there should be two routing decigions(RD) for forwarded packets:
-->PREROUTING-->RD1-->FORWARD-->RD2-->POSTROUTING
, right ?
At least it's that way for the OUTPUT chain. My additional rule [1],
makes both the RDs refer to the same table - FW. Without it the main
table is refered by RD1 and FW by RD2, which breaks the things down.
I'm running kernel 2.4.24 with all the submitted/pending patches from
p-o-m 20030912 applied.
Any ideas ?
Cheers,
Delian
p.s. please CC me when replying since I'm not subscribed to the list.
next reply other threads:[~2004-03-04 20:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-04 20:11 Delian Krustev [this message]
-- strict thread matches above, loose matches on Subject: below --
2005-04-03 13:39 MASQUERADE: Route sent us somewhere else Tim Evans
2005-01-11 13:48 Horváth Szabolcs
2005-01-11 14:54 ` Jason Opperisano
2004-02-26 5:11 Luke Worthy
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=200403042211.21740.krustev@krustev.net \
--to=krustev@krustev.net \
--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.