配置ARP安全功能
组网需求
如图1所示,设备通过接口100GE1/0/3连接一台服务器,通过接口100GE1/0/1和接口100GE1/0/2连接VLAN10和VLAN20下的四个用户主机。网络中存在的ARP攻击包括:
- 服务器可能会发送一些目的IP地址不可达的报文,而且这种报文相对其他普通用户主机的报文要多。
- 用户HostA遭到网络攻击者攻击后,会在网络中发送大量的伪造ARP攻击报文,这种报文中的源IP地址会不断变化。
- 用户HostC遭到网络攻击者攻击后,会构造大量的源IP地址固定的ARP报文对网络进行攻击。
- 用户HostD可能会发送一些目的IP地址不可达的报文。
要求在Device配置ARP的安全功能,预防上述攻击。
配置思路
采用如下的思路在Device上配置ARP安全功能:
- 配置全局的ARP表项严格学习的功能,限制设备只学习自己发送的ARP请求报文的应答报文。
- 基于接口配置ARP表项限制功能,限制接口学习ARP表项的最大数目,防止ARP表项溢出。
- 配置ARP表项固化功能,防止网络攻击者通过发送伪造的ARP报文篡改ARP表项。
- 配置ARP报文限速功能,限制设备1秒内处理ARP报文的数量,节省系统开销,保证用户业务不受影响。
- 配置ARP Miss消息限速功能,限制设备1秒内处理ARP Miss消息的数量,节省系统开销,保证用户业务不受影响。同时需要保证设备可以正常处理服务器发出的大量此类报文,避免因丢弃服务器发出的大量此类报文而造成网络无法正常通信。
数据准备
为完成此配置例,需准备如下的数据:
- 基于接口配置ARP表项限制的阈值为20。
- 配置ARP表项固化的固化模式为fixed-mac模式。
- 配置ARP报文限速的阈值为15。
- 配置ARP Miss消息限速的阈值:对用户主机HostD的限速阈值为30,对其他用户主机的限制阈值为20,对服务器的限速阈值为50。
操作步骤
- 配置相关接口的IP地址和路由协议,具体的配置过程参见配置脚本。
- 配置ARP表项严格学习功能。
<HUAWEI> system-view [~HUAWEI] sysname Device [*Device] arp learning strict [*Device] commit
- 基于接口配置ARP表项限制功能。
# 在接口100GE1/0/1上配置VLAN10的ARP表项限制阈值为20。
[~Device] interface 100ge1/0/1 [~Device-100GE1/0/1] portswitch [*Device-100GE1/0/1] arp limit vlan 10 20 [*Device-100GE1/0/1] quit [*Device] commit
#参考接口100GE1/0/1的配置,配置接口100GE1/0/2和接口100GE1/0/3的ARP表项限制阈值。
- 配置ARP表项固化功能。
[~Device] arp anti-attack entry-check fixed-mac enable [*Device] commit
- 配置ARP报文限速功能。
[~Device] arp anti-attack rate-limit source-ip maximum 15 [*Device] commit
- 配置ARP Miss消息限速功能。
[~Device] arp miss anti-attack rate-limit source-ip 10.10.10.10 maximum 30 [*Device] arp miss anti-attack rate-limit source-ip maximum 20 [*Device] arp miss anti-attack rate-limit source-ip 10.20.20.20 maximum 50 [*Device] commit
检查配置结果
# 执行命令display arp learning strict,查看ARP表项严格学习的情况。
<HUAWEI> display arp learning strict
The global arp learning strict state:enable
------------------------------------------------------------
Interface LearningStrictState
------------------------------------------------------------
------------------------------------------------------------
Total:0 Force-enable:0 Force-disable:0
# 执行命令display arp limit,查看100GE 1/0/1接口上配置的ARP表项限制的阈值。
<HUAWEI> display arp limit interface 100ge1/0/1
Interface VLAN Limit Learnt
---------------------------------------------------------------------------
100GE1/0/1 10 20 0
---------------------------------------------------------------------------
Total:1
# 执行命令display arp miss anti-attack rate-limit,查看配置的ARP Miss消息限速的限速值。
<HUAWEI> display arp miss anti-attack rate-limit
Global ARP miss rate-limit : 500 (0 means no limit)
VLAN ID Suppress Rate(pps)(0 means no limit)
-------------------------------------------------------------------------------
All 0
-------------------------------------------------------------------------------
Total: 0, spec of rate-limit configuration for VLAN is 1024.
Source IP Suppress Rate(pps)(0 means no limit)
-------------------------------------------------------------------------------
10.10.10.10/32 30
10.20.20.20/32 50
Other 20
-------------------------------------------------------------------------------
Total: 2, spec of rate-limit configuration for Source IP is 1024.
# 执行命令display arp packet statistics,查看ARP报文的统计信息。
<HUAWEI> display arp packet statistics
ARP Packets Received
Total: 154333
Learnt Count: 8
Discard For Entry Limit: 5
Discard For Speed Limit: 0
Discard For Proxy Suppress: 0
Discard For Other: 151597
ARP Packets Sent
Total: 0
Request: 0
Reply: 0
Gratuitous ARP: 0
ARP-Miss Message Received:
Total: 0
Discard For Speed Limit: 0
Discard For Other: 3
配置脚本
# sysname Device # vlan batch 10 20 30 # arp learning strict arp anti-attack entry-check fixed-mac enable arp anti-attack rate-limit source-ip maximum 15 arp miss anti-attack rate-limit source-ip 10.10.10.10 maximum 30 arp miss anti-attack rate-limit source-ip maximum 20 arp miss anti-attack rate-limit source-ip 10.20.20.20 maximum 50 # interface Vlanif10 ip address 10.9.9.1 255.255.255.0 # interface Vlanif20 ip address 10.10.10.1 255.255.255.0 # interface Vlanif30 ip address 10.20.20.1 255.255.255.0 # interface 100GE1/0/1 arp limit vlan 10 20 # interface 100GE1/0/2 arp limit vlan 20 20 # interface 100GE1/0/3 arp limit vlan 30 20 # return
