Re: Marking packets by mac addr using tc filter u32 match?

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Juan Pizarro wrote:
> 
> Hi
> Is there a way of marking packets by mac address instead of ip or ports
> using a "tc filter u32 match"?
> I read somewhere that I could use the offset -8 and -14 to grab the mac
> addresses but if I use anything lower than -8, for example -9, I get an
> error.
> I'm modifying the wondershaper script to cap the download speed by mac
> address.
> 
> Any sugestions?

These work for me.  Kernel 2.4.31, iproute2 2.6.10.
INGRESS:
tc filter add dev eth1 parent 1: protocol ip prio 5 u32 match u16 0x0800
0xffff at -2 match u16 0x4455 0xffff at -4 match u32 0x00112233
0xffffffff at -8 flowid 1:40

EGRESS:
tc filter add dev eth1 parent 1: protocol ip prio 5 u32 match u16 0x0800
0xffff at -2 match u32 0x22334455 0xffffffff at -12 match u16 0x0011
0xffff at -14 flowid 1:40
--
gypsy
_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux