Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Geoff Crompton <geoffc@trinity.unimelb.edu.au>
To: netfilter@vger.kernel.org
Subject: ip rule fwmarks letting me down
Date: Thu, 08 May 2008 15:58:22 +1000	[thread overview]
Message-ID: <4822967E.8030407@trinity.unimelb.edu.au> (raw)

Hi,

I'm having problems using fwmarks in my routing policy database, and I'm
not sure why they are not working. We've got two internet uplinks, and
we like to use our internode (our ISP) link for some of our traffic. So
I've got an ip rule output like this:

$ ip rule list
0:      from all lookup 255
32765:  from all fwmark 0x2 lookup internode
32766:  from all lookup main
32767:  from all lookup default

$ ip route list table internode
default via 203.28.240.92 dev vlan9
$ ip route list table main | grep default
default via 203.28.240.91 dev vlan9

To isolate and test this bug, I have done:
# iptables -t mangle -N test-marks
# iptables -t mangle -A test-marks -j MARK --set-mark 0x02
# iptables -t mangle -I PREROUTING 1 -d 192.231.203.132 -j test-marks

Of course if I wanted to affect routing for -d 192.231.203.132 it would
be much easier to do that as a normal routing command. But I need to get
fwmark working, because we use it for other types of traffic.

So when I ping from a machine behind this firewall, it should be routed
via 203.28.240.92, but it isn't. I've been running tcpdump on both
203.28.240.92 and 203.28.240.91, and the packets are definately being
routed via 203.28.240.91.

I'm sure the packets are getting marked. After doing some pinging from a
PC behind the firewall:
# iptables-save -c | grep test-marks
:test-marks - [0:0]
[4:336] -A PREROUTING -d 192.231.203.132 -j test-marks
[4:336] -A test-marks -j MARK --set-mark 0x2

Can anyone please suggest what I've done wrong, or gotchas to watch out
for that I could go and check?

-- 
+-Geoff Crompton
+--Debian System Administrator
+---Trinity College

             reply	other threads:[~2008-05-08  5:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-08  5:58 Geoff Crompton [this message]
2008-05-08 12:51 ` ip rule fwmarks letting me down whiplash
2008-05-09  1:57   ` Geoff Crompton

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=4822967E.8030407@trinity.unimelb.edu.au \
    --to=geoffc@trinity.unimelb.edu.au \
    --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