Linux Netfilter discussions
 help / color / mirror / Atom feed
From: "Omar Garcia" <omar.garcia@fractalia.biz>
To: netfilter@lists.netfilter.org
Subject: Re: CONNMARK save-mark and restore-mark not working ?
Date: Fri, 18 Feb 2005 11:56:29 +0100	[thread overview]
Message-ID: <004001c515a8$80403df0$910010ac@coco> (raw)
In-Reply-To: 20050218084044.GA31190@elm.home.idallen.ca

And this?

    iptables -t mangle -A OUTPUT -j CONNMARK --restore-mark
    iptables -t mangle -A OUTPUT -m connmark ! --mark 0 -j ACCEPT
    iptables -t mangle -A OUTPUT -j MARK --set-mark 9
    iptables -t mangle -A OUTPUT -j CONNMARK --save-mark

----- Original Message ----- 
From: "Ian! D. Allen" <idallen@idallen.ca>
To: <netfilter@lists.netfilter.org>
Sent: Friday, February 18, 2005 9:40 AM
Subject: CONNMARK save-mark and restore-mark not working ?


> I think this pair (marking connections with "9"):
>
>     iptables -t mangle -A OUTPUT -j MARK --set-mark 9
>     iptables -t mangle -A OUTPUT -j CONNMARK --set-mark 9
>
> should be equivalent to this pair:
>
>     iptables -t mangle -A OUTPUT -j MARK --set-mark 9
>     iptables -t mangle -A OUTPUT -j CONNMARK --save-mark
>
> The first pair works - I get mark=9 entries in /proc/net/ip_conntrack .
> The second pair does not - I get no marks at all in ip_conntrack.
>
> I think this pair should set packet marks from the ip_conntrack marks:
>
>     iptables -t mangle -A OUTPUT -j CONNMARK --set-mark 9
>     iptables -t mangle -A OUTPUT -j CONNMARK --restore-mark
>
> It does not - the packets aren't marked:
>
> Chain OUTPUT (policy ACCEPT 2989 packets, 395K bytes)
>  pkts bytes target     prot opt in     out     source
destination
>  1695  178K CONNMARK   all  --  *      *       0.0.0.0/0
0.0.0.0/0           CONNMARK set 0x9
>  1695  178K CONNMARK   all  --  *      *       0.0.0.0/0
0.0.0.0/0           CONNMARK restore
>     0     0 LOG        all  --  *      *       0.0.0.0/0
0.0.0.0/0           MARK match 0x9 LOG flags 1 level 7 prefix `IDAMARK '
>  1695  178K            all  --  *      *       0.0.0.0/0
0.0.0.0/0           MARK match 0x0
>
> What am I missing?
>
> Linux elm 2.6.10-1mdk #2 Sat Jan 29 13:10:11 EST
> 2005 i686 AMD Athlon(tm) XP 3200+ unknown GNU/Linux
>
> -- 
> -IAN!  Ian! D. Allen   Ottawa, Ontario, Canada
>        EMail: idallen@idallen.ca   WWW: http://www.idallen.com/
>        College professor (Linux) via: http://teaching.idallen.com/
>        Support free and open public digital rights:  http://eff.org/
>
>




  reply	other threads:[~2005-02-18 10:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-18  8:40 CONNMARK save-mark and restore-mark not working ? Ian! D. Allen
2005-02-18 10:56 ` Omar Garcia [this message]
2005-02-18 21:37   ` Ian! D. Allen
2005-02-18 11:05 ` Vinod Chandran
2005-02-18 21:32   ` Ian! D. Allen
2005-02-20 22:35 ` Ian! D. Allen

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='004001c515a8$80403df0$910010ac@coco' \
    --to=omar.garcia@fractalia.biz \
    --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