zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    进度3
    进度2
    进度1
    库存物资管理系统
    课程管理系统
    文件与流作业
    bzoj4027: [HEOI2015]兔子与樱花
    bzoj2067: [Poi2004]SZN
    bzoj2071:[POI2004]山洞迷宫
    bzoj1063: [Noi2008]道路设计
  • 原文地址:https://www.cnblogs.com/CasonChan/p/5033947.html
Copyright © 2011-2022 走看看