From: Tomas Mudrunka <mudrunka@spoje.net>
To: netfilter@vger.kernel.org
Subject: Re: Traffic shaping with nftables maps and tc
Date: Fri, 03 Nov 2017 01:07:35 +0100 [thread overview]
Message-ID: <392d67152072ea965fd56fbe6efefab7@spoje.net> (raw)
In-Reply-To: <62018f4d1c124ef84a7bd2281b1b2dcc@spoje.net>
I've been doing some online research and done several experiments:
1.) This seems to load properly, but i have not checked if it sets the
classid correctly:
table ip filter {
chain input {
type filter hook input priority 0; policy accept;
meta priority set 1:3065
}
}
however this is not really usefull as it does not do any real hashing /
maping, so i can't just use it for lots of rules. So i tried to adapt it
to use maps or dictionaries:
=======================================================
2.) This does not load:
table ip filter {
map prometheus {
type ipv4_addr : classid
elements = {
10.11.171.247 : "0001:4095",
10.11.171.248 : "0001:3065",
10.11.171.249 : "0001:2023"
}
}
}
test2.nft:3:34-40: Error: syntax error, unexpected classid, expecting
string or dscp or ecn or mark
type ipv4_addr : classid
^^^^^^^
test2.nft:2:13-22: Error: map definition does not specify key data type
map prometheus {
^^^^^^^^^^
=======================================================
3.) This also does not load:
table ip filter {
map prometheus {
type ipv4_addr : verdict
elements = {
10.11.171.247 : meta priority set "0001:4095",
10.11.171.248 : meta priority set "0001:3065",
10.11.171.249 : meta priority set "0001:2023"
}
}
}
test2.nft:5:41-44: Error: syntax error, unexpected meta
10.11.171.247 : meta priority set "0001:4095",
^^^^
test2.nft:6:25-37: Error: syntax error, unexpected string
10.11.171.248 : meta priority set "0001:3065",
^^^^^^^^^^^^^
test2.nft:7:25-37: Error: syntax error, unexpected string
10.11.171.249 : meta priority set "0001:2023"
^^^^^^^^^^^^^
test2.nft:10:1-1: Error: syntax error, unexpected '}'
}
^
It seems to me that maps are not generic enough to work with relatively
new "meta priority set" feature.
Do you have any suggestions how to make this work?
--
S pozdravem
Best regards
Tomáš Mudruňka - SPOJE.NET s.r.o.
next prev parent reply other threads:[~2017-11-03 0:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-02 20:34 Traffic shaping with nftables maps and tc Tomas Mudrunka
2017-11-03 0:07 ` Tomas Mudrunka [this message]
2017-11-03 10:48 ` Arturo Borrero Gonzalez
2017-11-03 12:37 ` Tomas Mudrunka
2017-11-03 16:01 ` Arturo Borrero Gonzalez
2017-11-03 16:28 ` Tomas Mudrunka
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=392d67152072ea965fd56fbe6efefab7@spoje.net \
--to=mudrunka@spoje.net \
--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