被arp攻击不能上网怎么解决 (局域网发生arp断网攻击怎么解决)

背景信息

如果用户发现上网时断时续,且网速特别慢,则很有可能是因为私网存在ARP攻击。此时,可以参考本节内容,检查设备上是否存在ARP攻击。

定位步骤

【1】执行命令display logbuffer检查设备运行日志,看是否有ARP协议报文因CPU阀值的限制被丢弃。

<Huawei> display logbuffer
Sep  9 2022 16:01:55+00:00 Huawei %%01SECE/4/PORT_ATTACK(l)[0]:Port attack occurred.(Slot=MPU, SourceAttackInterface=GigabitEthernet0/0/0, OuterVlan/InnerVlan=0/0, AttackPackets=64 packets per second)
Sep  9 2022 16:01:54+00:00 Huawei %%01DEFD/4/CPCAR_DROP_MPU(l)[1]:Some packets are dropped by cpcar on the MPU. (Packet-type=arp-miss, Drop-Count=770)
Sep  9 2022 16:01:54+00:00 Huawei %%01DEFD/4/CPCAR_DROP_MPU(l)[2]:Some packets are dropped by cpcar on the MPU. (Packet-type=arp-request, Drop-Count=3458)

【2】如果日志中有ARP报文被丢弃,则怀疑设备连接的私网中存在ARP攻击。此时,可以在设备上配置攻击溯源功能,进一步排查。

<Huawei> system-view
[Huawei] cpu-defend policy 1
[Huawei-cpu-defend-policy-1] auto-defend enable
[Huawei-cpu-defend-policy-1] auto-defend threshold 40  //可适当调整建议不要太小
[Huawei-cpu-defend-policy-1] auto-defend attack-packet sample 5
[Huawei-cpu-defend-policy-1] auto-defend protocol all
[Huawei-cpu-defend-policy-1] auto-defend trace-type source-ip source-mac source-portvlan
[Huawei-cpu-defend-policy-1] auto-defend alarm enable
[Huawei-cpu-defend-policy-1] quit
[Huawei] cpu-defend-policy 1  
[Huawei] cpu-defend-policy 1 global  

【3】配置完攻击溯源后,当网络出现异常时,在设备上执行命令display auto-defend attack-source进一步确认是否存在ARP攻击。

[Huawei] display auto-defend attack-source
  Attack Source User Table:
  -------------------------------------------------------------------------
      MacAddress       InterfaceName      Vlan:Outer/Inner      TOTAL 
  -------------------------------------------------------------------------
  xxxx-xxxx-xxxx   GigabitEthernet0/0/1         0               368    
  yyyy-yyyy-yyyy   GigabitEthernet0/0/0         0               7152   
  -------------------------------------------------------------------------
  Total: 2

  Attack Source Port Table:
  -----------------------------------------------------
    InterfaceName        Vlan:Outer/Inner       TOTAL  
  -----------------------------------------------------
  GigabitEthernet0/0/1     0                    368   
  GigabitEthernet0/0/0     0                    23472 
  -----------------------------------------------------
  Total: 2

  Attack Source IP Table:
  -------------------------------------
   IPAddress        TOTAL Packets 
  -------------------------------------
  x.x.x.x      368    
  y.y.y.y      7152   
  -------------------------------------  
  Total: 2

如上所示,私网中源IP地址为y.y.y.y,源MAC为yyyy-yyyy-yyyy的用户发送了大量的攻击报文(本例中GE0/0/1为公网接口,报文数量增长不大,可以忽略)。此时,根据被攻击端口GE0/0/0,逐层往下找到攻击源用户,使用杀毒软件杀毒,解决故障。

微信公众号:网络民工 专注于IT技术领域,结合实战经验,为您分享网络技术、系统集成、网络工程等一线技术解析和实践案例等深度干货文章,愿我们一起悦享技术,成就梦想!

【4】如果无法查到攻击源用户,可以在设备的私网接口GE0/0/0上配置ACL规则过滤掉二层ARP流量功能,拒绝源MAC地址为yyyy-yyyy-yyyy的报文通过私网接口,解决故障。

[Huawei] acl number 4444
[Huawei-acl-L2-4444] rule 5 deny l2-protocol arp source-mac yyyy-yyyy-yyyy 
[Huawei] interface gigabitethernet 0/0/0
[Huawei-GigabitEthernet0/0/0] traffic-filter inbound acl 4444
[Huawei-GigabitEthernet0/0/0] quit
[Huawei] quit