ARP攻击三层交换机判断方法

繁简对译:[]  字体设置:[] 2009-02-17  作者:夏丰  阅读  次

方法一
查看CPUFC信息。在接口板上的串口终端,qpmz模式下查看Cpufc信息。具体命令为
Harbour(DEBUG_H)> show cpufc queue count all
QUEUEID   RECVPKT   INPUTPKT  RECVERR  INPUTERR  DISCARD  
========================================================
ipmc             0                 0                0                0                 0        
ttl               1107             1107          0                0                 0        
cpumac     1508798       1508798     0                0                 0       
arp            26563371     26563371   0                0                177429   
..............................................    
igmp          1437            1437            0                0                 0         
...............................................       
ospf          2626897       2626897      0                0                 0         
  
这里分别记录了CPU在接受各种类型的报文时的情况,如果哪种报文的Discard数目在增长,说明这种报文送往CPU的速率超过我们设定的限制。上面的例子ARP报文的Discard数目较大,说明由于我们CPUFC的机制(保护CPU免受报文攻击的一种机制)起作用而丢弃了这么多ARP报文。基本能说明这个模块板可能有ARP攻击报文,很可能有冲击波引起的ARP遍厉攻击。

 

方法二
打开CPUFC的调试开关,观察CPUFC的具体情况。
Harbour(DEBUG_H)> debug cpufc
Packet unit 0 port 4 type 3
cpufc_open_flow: unit 0 type 3 IsOpen 0, pbmp 0x10
cpufc_open_flow: unit 0 type 3 IsOpen 1, pbmp 0x10
出现上面的信息,说明CPU在unit 0 / port 4端口上收到type 为3的报文过多,导致Cpufc起作用,引起ARP的丢弃。
这里的unit 0 port 4 是我们软件中的设备号和物理端口号。Type 3 为报文的类型,这里指ARP报文。
根据unit 0 port 4 这些信息查看对应的面班端口号的方法,用命令
Harbour(DEBUG_H)> show  hardware  stg  0  4
unit      stg_index
0x00000000  0x00000001
phy_port:   0    l2_port:    2    stp_stat:   3
phy_port:   1    l2_port:    4    stp_stat:   3
phy_port:   2    l2_port:    6    stp_stat:   3
phy_port:   3    l2_port:    8    stp_stat:   3
phy_port:   4    l2_port:    10   stp_stat:   3
phy_port:   5    l2_port:    12   stp_stat:   3
phy_port:   6    l2_port:    1    stp_stat:   3
phy_port:   7    l2_port:    3    stp_stat:   3
phy_port:   8    l2_port:    5    stp_stat:   3
phy_port:   9    l2_port:    7    stp_stat:   3
phy_port:   10    l2_port:   9    stp_stat:   3
phy_port:   11    l2_port:   11   stp_stat:   3
phy_port:   12    l2_port:   0    stp_stat:   3
其中的两个参数unit 和port分别为0 和4 ,根据unit 0 port 4得来的。
上面数据说明发生Cpufc的端口时本模块板的端口号10,端口10可能受到ARP的攻击。
需要关闭这个调试开关,可以使用

 


方法三
连续查看各个端口的统计信息,如果某个端口的广播数据连续快速增长,也基本能说明该端口可能收到ARP的攻击。
Harbour(config-if-eth8/10)#show  stat
     Tx good frames      : 7362            Tx error frames     : 0              
     Tx multicast frames : 0               Tx broadcast frames : 0              
     Rx good frames      : 2841574         Rx total frames     : 2841574        
     Rx multicast frames : 0               Rx broadcast frames : 0              
     L2 Rx total packets : 3208154         L2 Tx total packets : 2575949        
     L2 multicast packets: 54957           L2 broadcast packets: 298580           
     L2 SUCC Rx packets  : 3208154         L2 SUCC Tx packets  : 2575949        
     L2 FAIL Rx packets  : 0               L2 FAIL Tx packets  : 0              
     L2 In packets rate  : 0               L2 Out packets rate : 0              
     L2 In Octets rate   : 0               L2 Out Octets rate  : 0                 
正常的业务运行时,端口上的广播报文数目不会很多,这个端口的广播报文占到总收包数量的10%还多,肯定不正常

打印 收藏 关闭