From: Gavin Hamill <gdh@acentral.co.uk>
To: netfilter@lists.netfilter.org
Subject: Fun with the mangle table + LARTC
Date: Mon, 1 Aug 2005 09:16:37 +0100 [thread overview]
Message-ID: <200508010916.37911.gdh@acentral.co.uk> (raw)
Hi - this is one of those "not sure if it's netfilter or LARTC" issues, so
here we go. I have a LAN on eth0 two Internet connections on eth1 and eth2. I
have the default route pointing at eth1 but would like HTTP requests from the
LAN to go out eth2.
When beginning, I have the following rules in the nat table.
-A POSTROUTING -s 10.0.0.0/255.255.255.0 -o eth1 -j MASQUERADE
-A POSTROUTING -s 10.0.0.0/255.255.255.0 -o eth2 -j MASQUERADE
and the default route is via the ISP gateway on eth1 - Hurrah - normal net
access works.
However if I now add this to the mangle table:
-A PREROUTING -i eth0 -p tcp --dport 80 -j MARK --set-mark 0x50
and populate table 0x50 (80 decimal) with:
ip rule add fwmark 80 table 43
ip route add default via 80.X.X.1 table 43
using tcpdump I can see the outgoing and reply packets on eth2 with the
correct source address (i.e. the one the ISP on eth2 gives me) set, but
tcpdump on eth0 shows only the packets from the MASQ'd host - the replies
from the Internet host are not passed through.
Of course, remove the PREROUTING rule in mangle and all is well again...
Any ideas would be warmly welcomed, this is Debian sarge, kernel 2.6.8,
iptables 1.2.11 if it makes a difference. :)
Cheers,
Gavin.
next reply other threads:[~2005-08-01 8:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-01 8:16 Gavin Hamill [this message]
2005-08-01 13:01 ` Fun with the mangle table + LARTC /dev/rob0
2005-08-01 15:41 ` Gavin Hamill
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=200508010916.37911.gdh@acentral.co.uk \
--to=gdh@acentral.co.uk \
--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