All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philip Craig <philipc@snapgear.com>
To: kaiwen <cal_kaiwen@hotmail.com>
Cc: netfilter@lists.netfilter.org
Subject: Re: Match packet mark with --set-mark to ip rule fwmark
Date: Wed, 07 Jan 2004 16:17:13 +1000	[thread overview]
Message-ID: <3FFBA469.9080205@snapgear.com> (raw)
In-Reply-To: <LAW11-OE14FjwUbowDp0001e8e9@hotmail.com>

kaiwen wrote:
> (2)[root@g root]# ip ro show table test2
> prohibit 192.168.8.88
> prohibit 192.168.250.197
> 
> (3) [root@g root]# iptables -t mangle -L
> Chain OUTPUT (policy ACCEPT)
> target     prot opt source               destination
> MARK       all  --  anywhere             anywhere           MARK set 0x5

But you changed both the IP address for the prohibit *and* the
chain the mark is in.  So you still won't get packets that match
both.  Just change one or the other.

That is, if you want to drop an incoming ping packet, then the
prohibit must specify a local IP, and the mark rule must be in
the PREROUTING chain.  If you want to drop an outgoing ping packet,
then the prohibit must specify a remote IP, and the mark rule must
be in the OUTPUT chain.  You could also just always put the mark
rule in both PREROUTING and OUTPUT.

Here's another option: change the mark rule so that it specifies
the source or destination, and also change the prohibit to be
'prohibit any'.

> Take a look at ip rule, the first rule route all packet to table local,
> which has a route for 192.168.8.0/24. Is it true that once there is one rule
> which match for the packet, it will route according to it. If so, I remove
> the route from table local and put it at table test2, which is
> Configurations B.

Yes, it will use the first route that matches.  Note that moving the
route to table test2 will break routing for packets that don't use
table test2.  You probably want to move it to table main.

-- 
Philip Craig - SnapGear, A CyberGuard Company - http://www.SnapGear.com



  reply	other threads:[~2004-01-07  6:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-07  4:10 Match packet mark with --set-mark to ip rule fwmark kaiwen
2004-01-07  5:00 ` Philip Craig
2004-01-07  5:03   ` kaiwen
2004-01-07  5:35   ` kaiwen
2004-01-07  6:17     ` Philip Craig [this message]
2004-01-07  7:25       ` kaiwen

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=3FFBA469.9080205@snapgear.com \
    --to=philipc@snapgear.com \
    --cc=cal_kaiwen@hotmail.com \
    --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.