netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jack Ma <Jack.Ma@alliedtelesis.co.nz>
To: Florian Westphal <fw@strlen.de>
Cc: "netfilter-devel@vger.kernel.org" <netfilter-devel@vger.kernel.org>
Subject: Re: conntrack enhancement
Date: Thu, 25 Jan 2018 21:31:10 +0000	[thread overview]
Message-ID: <1516915870809.26703@alliedtelesis.co.nz> (raw)
In-Reply-To: <20180125062211.GE14192@breakpoint.cc>

Hi Florian,


Lets start with iptables setting

iptables -t mangle

Chain EXAMPLE_MAIN

pkts bytes target     prot opt in     out     source               destination 
3709K  204M MARK       all  --  any    any     anywhere             anywhere             MARK and 0xfffff
37  6952 CONNMARK   all  --  any    any     anywhere             anywhere             CONNMARK restore mask 0xfff00000
0     0 MARK       udp  --  any    any     anywhere             anywhere             match .... and MARK xset 0xabc00000/0xfff00000         
    5   308 CONNMARK   all  --  any    any     anywhere             anywhere             CONNMARK save mask 0xfff00000


For the first packet of 'a' flow we mark the packet with fwmark = ct->mark.

ip rule

then direct traffic using such fwmark.

250:    from all fwmark 0xabc lookup TABLE

However, we also implemented firewall feature, packet inspection feature.... etc to use fwmark at the same time.

which makes such 32 bit far more occupied than ct->mark (32)..

Hopefully this can help!

Please let me know if this confuses you..

Thanks,
Jack

  parent reply	other threads:[~2018-01-25 21:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-16  2:26 conntrack enhancement Jack Ma
2018-01-16 14:17 ` Florian Westphal
2018-01-23  1:16   ` Jack Ma
2018-01-25  2:34   ` Jack Ma
     [not found]     ` <20180125062211.GE14192@breakpoint.cc>
2018-01-25 21:31       ` Jack Ma [this message]
2018-02-06 23:46       ` shift by n bits while performing '--restore-mark' Jack Ma
2018-02-06 23:53         ` Florian Westphal
2018-02-15  4:13           ` Jack Ma

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=1516915870809.26703@alliedtelesis.co.nz \
    --to=jack.ma@alliedtelesis.co.nz \
    --cc=fw@strlen.de \
    --cc=netfilter-devel@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;
as well as URLs for NNTP newsgroup(s).