* tc filter fw flowid and masks
@ 2017-03-28 7:19 Salatiel Filho
2017-03-28 7:27 ` Marco Gaiarin
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Salatiel Filho @ 2017-03-28 7:19 UTC (permalink / raw)
To: lartc
Hi guys, when i mark a packet using, for example,
# iptables ... -j MARK --set-mark 10
i can match it using
#tc filter add dev ... handle 10 fw flowid 1:10
But how can i match it using tc filter if the mark using iptables has a mask?
# iptables ... -j MARK --set-mark 10/0xff
The mark is needed because there are a few QOS scripts that set marks
using masks 0xff00.
When using maks i am always getting in to the default tc class.
Thanks!
[]'s
Salatiel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: tc filter fw flowid and masks
2017-03-28 7:19 tc filter fw flowid and masks Salatiel Filho
@ 2017-03-28 7:27 ` Marco Gaiarin
2017-03-28 9:24 ` Andy Furniss
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Marco Gaiarin @ 2017-03-28 7:27 UTC (permalink / raw)
To: lartc
Mandi! Salatiel Filho
In chel di` si favelave...
> But how can i match it using tc filter if the mark using iptables has a mask?
You have to use u32:
$TC filter add dev $IFACE parent 1:0 protocol ip prio $l \
u32 match mark $l $MASK flowid 1:$LVLH
--
dott. Marco Gaiarin GNUPG Key ID: 240A3D66
Associazione ``La Nostra Famiglia'' http://www.lanostrafamiglia.it/
Polo FVG - Via della Bontà, 7 - 33078 - San Vito al Tagliamento (PN)
marco.gaiarin(at)lanostrafamiglia.it t +39-0434-842711 f +39-0434-842797
Dona il 5 PER MILLE a LA NOSTRA FAMIGLIA!
http://www.lanostrafamiglia.it/25/index.php/component/k2/item/123
(cf 00307430132, categoria ONLUS oppure RICERCA SANITARIA)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: tc filter fw flowid and masks
2017-03-28 7:19 tc filter fw flowid and masks Salatiel Filho
2017-03-28 7:27 ` Marco Gaiarin
@ 2017-03-28 9:24 ` Andy Furniss
2017-03-28 9:33 ` Phil Sutter
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Andy Furniss @ 2017-03-28 9:24 UTC (permalink / raw)
To: lartc
Salatiel Filho wrote:
> Hi guys, when i mark a packet using, for example,
> # iptables ... -j MARK --set-mark 10
> i can match it using
> #tc filter add dev ... handle 10 fw flowid 1:10
>
> But how can i match it using tc filter if the mark using iptables has a mask?
> # iptables ... -j MARK --set-mark 10/0xff
>
> The mark is needed because there are a few QOS scripts that set marks
> using masks 0xff00.
>
> When using maks i am always getting in to the default tc class.
Maybe you need to put 0x everywhere you can.
Like Marco I would have said use u32 mark match, but I
have seen router setups that seem to use fw with masks.
untested but maybe something like -
iptables ... -j MARK --set-mark 0x10/0xff
tc filter add dev ... handle 0x10/0xff fw flowid 1:10
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: tc filter fw flowid and masks
2017-03-28 7:19 tc filter fw flowid and masks Salatiel Filho
2017-03-28 7:27 ` Marco Gaiarin
2017-03-28 9:24 ` Andy Furniss
@ 2017-03-28 9:33 ` Phil Sutter
2017-03-29 16:13 ` Marco Gaiarin
2017-03-29 16:58 ` Phil Sutter
4 siblings, 0 replies; 6+ messages in thread
From: Phil Sutter @ 2017-03-28 9:33 UTC (permalink / raw)
To: lartc
Hi,
On Tue, Mar 28, 2017 at 04:19:48AM -0300, Salatiel Filho wrote:
> Hi guys, when i mark a packet using, for example,
> # iptables ... -j MARK --set-mark 10
> i can match it using
> #tc filter add dev ... handle 10 fw flowid 1:10
>
> But how can i match it using tc filter if the mark using iptables has a mask?
> # iptables ... -j MARK --set-mark 10/0xff
f_fw.c supports handles in form of val/mask, see
| tc filter add fw help
So it should be possible to match the packets like this:
| tc filter add dev ... handle 10/0xff fw flowid 1:10
Cheers, Phil
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: tc filter fw flowid and masks
2017-03-28 7:19 tc filter fw flowid and masks Salatiel Filho
` (2 preceding siblings ...)
2017-03-28 9:33 ` Phil Sutter
@ 2017-03-29 16:13 ` Marco Gaiarin
2017-03-29 16:58 ` Phil Sutter
4 siblings, 0 replies; 6+ messages in thread
From: Marco Gaiarin @ 2017-03-29 16:13 UTC (permalink / raw)
To: lartc
Mandi! Phil Sutter
In chel di` si favelave...
> f_fw.c supports handles in form of val/mask, see
> | tc filter add fw help
...by what version? On debian jessie:
root@tank:~# tc filter add fw help
Usage: ... fw [ classid CLASSID ] [ police POLICE_SPEC ]
POLICE_SPEC := ... look at TBF
CLASSID := X:Y
NOTE: CLASSID is parsed as hexadecimal input.
root@tank:~# tc -V
tc utility, iproute2-ss140804
root@tank:~# uname -a
Linux tank 3.16.0-4-amd64 #1 SMP Debian 3.16.39-1+deb8u2 (2017-03-07) x86_64 GNU/Linux
So seems not.
--
dott. Marco Gaiarin GNUPG Key ID: 240A3D66
Associazione ``La Nostra Famiglia'' http://www.lanostrafamiglia.it/
Polo FVG - Via della Bontà, 7 - 33078 - San Vito al Tagliamento (PN)
marco.gaiarin(at)lanostrafamiglia.it t +39-0434-842711 f +39-0434-842797
Dona il 5 PER MILLE a LA NOSTRA FAMIGLIA!
http://www.lanostrafamiglia.it/25/index.php/component/k2/item/123
(cf 00307430132, categoria ONLUS oppure RICERCA SANITARIA)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: tc filter fw flowid and masks
2017-03-28 7:19 tc filter fw flowid and masks Salatiel Filho
` (3 preceding siblings ...)
2017-03-29 16:13 ` Marco Gaiarin
@ 2017-03-29 16:58 ` Phil Sutter
4 siblings, 0 replies; 6+ messages in thread
From: Phil Sutter @ 2017-03-29 16:58 UTC (permalink / raw)
To: lartc
On Wed, Mar 29, 2017 at 06:13:01PM +0200, Marco Gaiarin wrote:
> Mandi! Phil Sutter
> In chel di` si favelave...
>
> > f_fw.c supports handles in form of val/mask, see
> > | tc filter add fw help
>
> ...by what version? On debian jessie:
>
> root@tank:~# tc filter add fw help
> Usage: ... fw [ classid CLASSID ] [ police POLICE_SPEC ]
> POLICE_SPEC := ... look at TBF
> CLASSID := X:Y
>
> NOTE: CLASSID is parsed as hexadecimal input.
>
> root@tank:~# tc -V
> tc utility, iproute2-ss140804
> root@tank:~# uname -a
> Linux tank 3.16.0-4-amd64 #1 SMP Debian 3.16.39-1+deb8u2 (2017-03-07) x86_64 GNU/Linux
>
> So seems not.
Since v4.9.0.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-03-29 16:58 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-28 7:19 tc filter fw flowid and masks Salatiel Filho
2017-03-28 7:27 ` Marco Gaiarin
2017-03-28 9:24 ` Andy Furniss
2017-03-28 9:33 ` Phil Sutter
2017-03-29 16:13 ` Marco Gaiarin
2017-03-29 16:58 ` Phil Sutter
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.