华为数通---配置ARP安全综合功能案例

简介

ARP(Address Resolution Protocol)安全是针对ARP攻击的一种安全特性,它通过一系列对ARP表项学习和ARP报文处理的限制、检查等措施来保证网络设备的安全性。ARP安全特性不仅能够防范针对ARP协议的攻击,还可以防范网段扫描攻击等基于ARP协议的攻击。

组网需求

如下图所示,Switch作为网关通过接口GE0/0/3连接一台服务器,通过接口GE0/0/1、GE0/0/2连接VLAN10和VLAN20下的四个用户。网络中存在以下ARP威胁:

  • 攻击者向Switch发送伪造的ARP报文、伪造的免费ARP报文进行ARP欺骗攻击,恶意修改Switch的ARP表项,造成其他用户无法正常接收数据报文。
  • 攻击者发出大量目的IP地址不可达的IP报文进行ARP泛洪攻击,造成Switch的CPU负荷过重。
  • 用户User1构造大量源IP地址变化MAC地址固定的ARP报文进行ARP泛洪攻击,造成Switch的ARP表资源被耗尽以及CPU进程繁忙,影响到正常业务的处理。
  • 用户User3构造大量源IP地址固定的ARP报文进行ARP泛洪攻击,造成Switch的CPU进程繁忙,影响到正常业务的处理。

管理员希望能够防止上述ARP攻击行为,为用户提供更安全的网络环境和更稳定的网络服务。

配置思路

采用如下思路在Switch上进行配置:

  1. 配置ARP表项严格学习功能以及ARP表项固化功能,实现防止伪造的ARP报文错误地更新Switch的ARP表项。
  2. 配置根据源IP地址进行ARP Miss消息限速,实现防止用户侧存在攻击者发出大量目的IP地址不可达的IP报文触发大量ARP Miss消息,形成ARP泛洪攻击。同时需要保证Switch可以正常处理服务器发出的大量此类报文,避免因丢弃服务器发出的大量此类报文而造成网络无法正常通信。
  3. 配置基于接口的ARP表项限制以及根据源MAC地址进行ARP限速,实现防止User1发送的大量源IP地址变化MAC地址固定的ARP报文形成的ARP泛洪攻击,避免Switch的ARP表资源被耗尽,并避免CPU进程繁忙。
  4. 配置根据源IP地址进行ARP限速,实现防止User3发送的大量源IP地址固定的ARP报文形成的ARP泛洪攻击,避免Switch的CPU进程繁忙。

操作步骤

  • 创建VLAN,将接口加入到VLAN中,并配置VLANIF接口

创建VLAN10、VLAN20和VLAN30,并将接口GE0/0/1加入VLAN10中,接口GE0/0/2加入VLAN20中,接口GE0/0/3加入VLAN30中。

cpp 复制代码
<Huawei>system-view 
[Huawei]sysname Switch
[Switch]vlan batch 10 20 30
[Switch]interface GigabitEthernet 0/0/1
[Switch-GigabitEthernet0/0/1]port link-type trunk 
[Switch-GigabitEthernet0/0/1]port trunk allow-pass vlan 10
[Switch-GigabitEthernet0/0/1]quit
[Switch]interface GigabitEthernet 0/0/2
[Switch-GigabitEthernet0/0/2]port link-type trunk 
[Switch-GigabitEthernet0/0/2]port trunk allow-pass vlan 20
[Switch-GigabitEthernet0/0/2]quit
[Switch]interface GigabitEthernet 0/0/3
[Switch-GigabitEthernet0/0/3]port link-type trunk 
[Switch-GigabitEthernet0/0/3]port trunk allow-pass vlan 30
[Switch-GigabitEthernet0/0/3]quit

创建接口VLANIF10、VLANIF20、VLANIF30,配置各VLANIF接口的IP地址。

cpp 复制代码
[Switch]interface Vlanif 10
[Switch-Vlanif10]ip address 10.8.8.4 24
[Switch-Vlanif10]quit	
[Switch]interface Vlanif 20
[Switch-Vlanif20]ip address 10.9.9.4 24
[Switch-Vlanif20]quit
[Switch]interface Vlanif 30
[Switch-Vlanif30]ip address 10.10.10.3 24
[Switch-Vlanif30]quit
  • 配置ARP表项严格学习功能
cpp 复制代码
[Switch]arp learning strict
  • 配置ARP表项固化功能

配置ARP表项固化模式为fixed-mac方式。

cpp 复制代码
[Switch]arp anti-attack entry-check fixed-mac enable
  • 配置根据源IP地址进行ARP Miss消息限速

配置对Server(IP地址为10.10.10.2)的ARP Miss消息进行限速,允许Switch每秒最多处理该IP地址触发的40个ARP Miss消息;对于其他用户,允许Switch每秒最多处理同一个源IP地址触发的20个ARP Miss消息。

cpp 复制代码
[Switch]arp-miss speed-limit source-ip maximum 20
[Switch]arp-miss speed-limit source-ip 10.10.10.2 maximum 20
  • 配置基于接口的ARP表项限制

配置接口GE0/0/1最多可以学习到20个动态ARP表项。

cpp 复制代码
[Switch]interface GigabitEthernet 0/0/1
[Switch-GigabitEthernet0/0/1]arp-limit vlan 10 maximum 20
[Switch-GigabitEthernet0/0/1]quit
  • 配置根据源MAC地址进行ARP限速

配置对用户User1(MAC地址为1-1-1)进行ARP报文限速,每秒最多只允许10个该MAC地址的ARP报文通过。

cpp 复制代码
[Switch]arp speed-limit source-mac 1-1-1 maximum 10
  • 配置根据源IP地址进行ARP限速

配置对用户User3(IP地址为10.9.9.2)进行ARP报文限速,每秒最多只允许10个该IP地址的ARP报文通过。

cpp 复制代码
[Switch]arp speed-limit source-ip 10.9.9.2 maximum 10
  • 验证配置结果

执行命令display arp learning strict,可以看到全局已经配置ARP表项严格学习功能。

cpp 复制代码
[Switch]display arp learning strict 
 The global configuration:arp learning strict 

 Interface                           LearningStrictState 
------------------------------------------------------------
------------------------------------------------------------
 Total:0
 Force-enable:0
 Force-disable:0

执行命令display arp-limit,查看接口可以学习到的动态ARP表项数目的最大值。

cpp 复制代码
[Switch]display arp-limit interface GigabitEthernet 0/0/1
 Interface                      LimitNum   VlanID     LearnedNum(Mainboard) 
---------------------------------------------------------------------------
 GigabitEthernet0/0/1           20         10         0         
---------------------------------------------------------------------------
 Total:1

执行命令display arp anti-attack configuration all,查看当前ARP防攻击配置情况。

cpp 复制代码
[Switch]display arp anti-attack configuration all
ARP anti-attack packet-check function: disable 

ARP gateway-duplicate anti-attack function: disabled 
 
ARP anti-attack log-trap-timer: 0 second(s) 
(The log and trap timer of speed-limit, default is 0 and means disabled.)
 
ARP anti-attack entry-check mode: 
 Vlanif      Mode    
-------------------------------------------------------------------------------
 All         fixed-mac
-------------------------------------------------------------------------------

ARP rate-limit configuration:
-------------------------------------------------------------------------------
Global configuration:
Interface configuration:
Vlan configuration:
-------------------------------------------------------------------------------

ARP miss rate-limit configuration:
-------------------------------------------------------------------------------
Global configuration:
Interface configuration:
Vlan configuration:
-------------------------------------------------------------------------------

ARP speed-limit for source-MAC configuration:
MAC-address         suppress-rate(pps)(rate=0 means function disabled)
-------------------------------------------------------------------------------
0001-0001-0001      10
Others              0
-------------------------------------------------------------------------------
The number of configured specified MAC address(es) is 1, spec is 512.

ARP speed-limit for source-IP configuration:
IP-address          suppress-rate(pps)(rate=0 means function disabled)
-------------------------------------------------------------------------------
10.9.9.2            10
Others              0
-------------------------------------------------------------------------------
The number of configured specified IP address(es) is 1, spec is 512.

ARP miss speed-limit for source-IP configuration:
IP-address          suppress-rate(pps)(rate=0 means function disabled)
-------------------------------------------------------------------------------
10.10.10.2/32       20
Others              20
-------------------------------------------------------------------------------
The number of configured specified IP address(es) is 1, spec is 512.

执行命令display arp packet statistics,查看ARP处理的报文统计数据。

cpp 复制代码
[Switch]display arp packet statistics 
ARP Pkt Received:   sum      0 
ARP-Miss Msg Received:   sum      0 
ARP Learnt Count:   sum      0 
ARP Pkt Discard For Limit:   sum      0 
ARP Pkt Discard For SpeedLimit:   sum      0 
ARP Pkt Discard For Proxy Suppress:   sum      0 
ARP Pkt Discard For Other:   sum      0 
ARP-Miss Msg Discard For SpeedLimit:   sum      0 
ARP-Miss Msg Discard For Other:   sum      0 

由显示信息可知,Switch上产生了ARP报文和ARP Miss消息丢弃计数,表明ARP安全功能已经生效。

配置文件

cpp 复制代码
#
sysname Switch
#
vlan batch 10 20 30
#
arp learning strict
#
arp-miss speed-limit source-ip 10.10.10.2 maximum 20
arp speed-limit source-ip 10.9.9.2 maximum 10
arp speed-limit source-mac 0001-0001-0001 maximum 10
arp anti-attack entry-check fixed-mac enable
#
arp-miss speed-limit source-ip maximum 20
#
interface Vlanif10
 ip address 10.8.8.4 255.255.255.0
#
interface Vlanif20
 ip address 10.9.9.4 255.255.255.0
#
interface Vlanif30
 ip address 10.10.10.3 255.255.255.0
#
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 10
 arp-limit vlan 10 maximum 20
#
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 20
#
interface GigabitEthernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 30
#
return
相关推荐
A懿轩A9 分钟前
鸿蒙4.0(HarmonyOS 4.0)与鸿蒙Next(HarmonyOS Next)区别
华为·harmonyos·鸿蒙·dev
只吹45°风28 分钟前
HTTPS是如何保证安全传输的
网络协议·安全·https
麦克尔.马1 小时前
一个安卓鸿蒙化工具
android·华为·harmonyos
xiaojiesec1 小时前
第160天:安全开发-Python-蓝队项目&流量攻击分析&文件动态监控&Webshell检测
安全
.Net Core 爱好者1 小时前
ASP .NET CORE 6 项目实现WebSocket通信实践
网络·websocket·网络协议·c#·.net·.netcore·visual studio
Android技术栈1 小时前
鸿蒙开发(NEXT/API 12)【跨设备互通特性简介】协同服务
网络·harmonyos·鸿蒙·鸿蒙系统·openharmony·协同·跨设备
Lisce9603101 小时前
利士策分享,江西新余悲剧背后的深思:安全与责任的重构
安全·重构
青瓷看世界2 小时前
华为HarmonyOS地图服务 6 - 侦听事件来实现地图交互
数码相机·华为·交互·harmonyos
楚歌again2 小时前
【如何在 Windows 10 主机上通过 VMware 安装 Windows 11 虚拟机,并共享主机网络】
网络·windows