u32 mac以及arp匹配

# Examples that match MAC (a big "thank you" to Julian Anastasov for this!):


M0 through M5 are the 6 bytes of the MAC address.






Egress (match destination MAC):


tc filter add dev eth1 parent 1: protocol ip prio 5 u32 match u16 \


  0x0800 0xffff at -2 match u32 0xM2M3M4M5 0xffffffff at -12 match u16 \


  0xM0M1 0xffff at -14 flowid 1:40






Ingress (match source MAC):


tc filter add dev eth1 parent 1: protocol ip prio 5 u32 match u16 \


  0x0800 0xffff at -2 match u16 0xM4M5 0xffff at -4 match u32 \


  0xM0M1M2M3 0xffffffff at -8 flowid 1:40


# Example that matches ARP (a big "thank you" to Martin Brown for this!):


# dst MAC is 6 bytes at -14


# src MAC is 6 bytes at -8


# the ARP protocol is 2 bytes at -2


# the "0806" comes from linux/include/linux/if_ether.h


tc filter add dev $DEV parent 1: protocol ip prio 5 u32 \


   match u16 0x0806 0xffff at -2 flowid 1:50

 

转载于:https://www.cnblogs.com/CasonChan/p/5033947.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值