Re: tc match MAC destination
From: Thomas Graf <hidden>
Date: 2011-06-15 13:23:12
On Wed, Jun 15, 2011 at 11:12:01AM +0300, Andrei Popa wrote:
I want to shape PVSTP+ traffic (traffic that has MAC destination 01:00:0c:cc:cc:cd) and it doesn't work. I've tried filter parent 1: protocol 802_3 pref 2 u32 fh 802::11 order 17 key ht 802 bkt 0 flowid 1:3 match 01000ccc/ffffffff at 0 but it doesn't work.
u32 offset 0 corresponds to the network layer and thus will
match the first byte of the ip layer or whatever protocol
is found on that layer.
You can use the cmp ematch to match on the mac layer:
Use something like this:
filter add basic match 'cmp(0x01000ccc at 0 layer link mask 0xffffffff)'
... cmp(>>help<<)...
Usage: cmp(ALIGN at OFFSET [ ATTRS ] { eq | lt | gt } VALUE)
where: ALIGN := { u8 | u16 | u32 }
ATTRS := [ layer LAYER ] [ mask MASK ] [ trans ]
LAYER := { link | network | transport | 0..2 }
Example: cmp(u16 at 3 layer 2 mask 0xff00 gt 20