0


ARP安全

ARP安全简介
ARP(Address Resolution Protocol)安全是针对ARP攻击的一种安全特性,它通过一系列对ARP表项学习和ARP报文处理的限制、检查等措施来保证网络设备的安全性。ARP安全特性不仅能够防范针对ARP协议的攻击,还可以防范网段扫描攻击等基于ARP协议的攻击。
常见的ARP攻击如下:
1、用户主机直接接入网关,攻击者将伪造网关的ARP报文发送给用户主机,使用户主机误以为攻击者即为网关。用户主机的ARP表中会记录错误的网关地址映射关系,这样就会把发往网关的流量均发送给了攻击者,攻击者可轻易窃听到用户主机发送的数据内容。
2、网络中有用户向设备发送大量目的IP地址不能解析的IP报文(即路由表中存在该IP报文的目的IP对应的路由表项,但设备上没有该路由表项中下一跳对应的ARP表项),将导致设备触发大量的ARP Miss消息。这种触发ARP Miss消息的IP报文(即ARP Miss报文)会被上送到CPU进行处理,设备会根据ARP Miss消息生成和下发大量临时ARP表项并向目的网络发送大量ARP请求报文,这样就增加了设备CPU的负担,同时严重消耗目的网络的带宽资源
3、设备收到大量ARP攻击报文,并需要对所有ARP攻击报文全部进行处理,可能导致CPU负荷过重而无法处理其他业务
针对以上攻击,ARP安全提供如下措施保证网络设备的安全性:
1、针对第一种攻击,可配置ARP防网关冲突,防止攻击者冒充网关窃听用户主机信息。
2、针对第二种攻击,可配置ARP Miss消息限速,减小CPU的负担,保护目的网络的带宽资源。
3、针对第三种攻击,可配置ARP报文限速,以保护CPU资源。


配置ARP安全综合功能示例

如图3-246所示,Switch作为网关通过接口GE1/0/3连接一台服务器,通过接口GE1/0/1、GE1/0/2连接VLAN10和VLAN20下的四个用户。网络中可能存在以下ARP威胁:
1、攻击者向Switch发送伪造的网关的ARP报文,使用户误以为攻击者即为网关。这样用户就会把发往网关的流量均发送给了攻击者,攻击者可轻易窃听到用户发送的数据内容。
2、攻击者发出大量目的IP地址不可达的IP报文进行ARP泛洪攻击,造成Switch的CPU负荷过重。
3、用户User1构造大量源IP地址变化MAC地址固定的ARP报文进行ARP泛洪攻击,造成Switch的CPU进程繁忙,影响到正常业务的处理。
4、用户User3构造大量源IP地址固定的ARP报文进行ARP泛洪攻击,造成Switch的CPU进程繁忙,影响到正常业务的处理。

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

配置思路
采用如下思路在Switch上进行配置:
1、配置ARP防网关冲突,防止攻击者冒充网关窃听用户主机信息。
2、配置根据源IP地址进行ARP Miss消息限速,实现防止用户侧存在攻击者发出大量目的IP地址不可达的IP报文触发大量ARP Miss消息,形成ARP泛洪攻击。同时需要保证Switch可以正常处理服务器发出的大量此类报文,避免因丢弃服务器发出的大量此类报文而造成网络无法正常通信。
3、配置根据源MAC地址进行ARP限速,实现防止User1发送的大量源IP地址变化MAC地址固定的ARP报文形成的ARP泛洪攻击,避免Switch的CPU进程繁忙。
4、配置根据源IP地址进行ARP限速,实现防止User3发送的大量源IP地址固定的ARP报文形成的ARP泛洪攻击,避免Switch的CPU进程繁忙。

操作步骤
1、创建VLAN,将接口加入到VLAN中,并配置VLANIF接口

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

<HUAWEI> system-view
[HUAWEI] sysname Switch
[Switch] vlan batch 10 20 30
[Switch] interface gigabitethernet 1/0/1
[Switch-GigabitEthernet1/0/1] port link-type trunk
[Switch-GigabitEthernet1/0/1] port trunk allow-pass vlan 10
[Switch-GigabitEthernet1/0/1] quit
[Switch] interface gigabitethernet 1/0/2
[Switch-GigabitEthernet1/0/2] port link-type trunk
[Switch-GigabitEthernet1/0/2] port trunk allow-pass vlan 20
[Switch-GigabitEthernet1/0/2] quit
[Switch] interface gigabitethernet 1/0/3
[Switch-GigabitEthernet1/0/3] port link-type trunk
[Switch-GigabitEthernet1/0/3] port trunk allow-pass vlan 30
[Switch-GigabitEthernet1/0/3] quit

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

[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
2、配置ARP防网关冲突
[Switch] arp anti-attack gateway-duplicate enable //配置ARP防网关冲突
3、配置根据源IP地址进行ARP Miss消息限速
#配置对Server(IP地址为10.10.10.2)的ARP Miss消息进行限速,允许Switch每秒最多处理该IP地址触发的40个ARP Miss消息;对于其他用户,允许Switch每秒最多处理同一个源IP地址触发的20个ARP Miss消息。
[Switch] arp-miss speed-limit source-ip maximum 20 //配置根据源IP地址进行ARP Miss消息限速
[Switch] arp-miss speed-limit source-ip 10.10.10.2 maximum 40 //配置根据源IP地址进行ARP Miss消息限速
4、配置根据MAC地址进行ARP限速

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

[Switch] arp speed-limit source-mac 0001-0001-0001 maximum 10 //配置根据源MAC地址进行ARP限速
5、配置根据IP地址进行ARP限速

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

[Switch] arp speed-limit source-ip 10.9.9.2 maximum 10 //配置根据源IP地址进行ARP限速
6、验证配置结果

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

[Switch] display arp anti-attack configuration all
......
ARP anti-attack entry-check mode:
Vlanif Mode


All disabled

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 1024.

ARP speed-limit for source-IP configuration:
IP-address suppress-rate(pps)(rate=0 means function disabled)


10.9.9.2 10
Others 30


The number of configured specified IP address(es) is 1, spec is 1024.

ARP miss speed-limit for source-IP configuration:
IP-address suppress-rate(pps)(rate=0 means function disabled)


10.10.10.2/32 40
Others 20


The number of configured specified IP address(es) is 1, spec is 1024.

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

[Switch] display arp packet statistics
ARP Pkt Received: sum 8678904
ARP-Miss Msg Received: sum 183
ARP Learnt Count: sum 37
ARP Pkt Discard For Limit: sum 146
ARP Pkt Discard For SpeedLimit: sum 40529
ARP Pkt Discard For Proxy Suppress: sum 0
ARP Pkt Discard For Other: sum 8367601
ARP-Miss Msg Discard For SpeedLimit: sum 20
ARP-Miss Msg Discard For Other: sum 104
由显示信息可知,Switch上产生了ARP报文和ARP Miss消息丢弃计数,表明ARP安全功能已经生效。

配置文件
#** Switch的配置文件**
#
sysname Switch
#
vlan batch 10 20 30
#
arp-miss speed-limit source-ip 10.10.10.2 maximum 40
arp speed-limit source-ip 10.9.9.2 maximum 10
arp speed-limit source-mac 0001-0001-0001 maximum 10
arp anti-attack gateway-duplicate 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 GigabitEthernet1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
interface GigabitEthernet1/0/2
port link-type trunk
port trunk allow-pass vlan 20
#
interface GigabitEthernet1/0/3
port link-type trunk
port trunk allow-pass vlan 30
#
return


动态ARP检测简介
ARP(Address Resolution Protocol)安全是针对ARP攻击的一种安全特性,它通过一系列对ARP表项学习和ARP报文处理的限制、检查等措施来保证网络设备的安全性。ARP安全特性不仅能够防范针对ARP协议的攻击,还可以防范网段扫描攻击等基于ARP协议的攻击。
网络中针对ARP的攻击层出不穷,中间人攻击是常见的一种ARP欺骗攻击方式。通过中间人攻击窃取合法用户的数据。
为了防御中间人攻击,可以在设备上部署动态ARP检测DAI(Dynamic ARP Inspection)功能。
动态ARP检测是利用绑定表来防御中间人攻击的。当设备收到ARP报文时,将此ARP报文对应的源IP、源MAC、VLAN以及接口信息和绑定表的信息进行比较,如果信息匹配,说明发送该ARP报文的用户是合法用户,允许此用户的ARP报文通过,否则就认为是攻击,丢弃该ARP报文。

说明:设备使能DHCP Snooping功能后,当DHCP用户上线时,设备会自动生成DHCP Snooping绑定表;对于静态配置IP地址的用户,设备不会生成DHCP Snooping绑定表,所以需要手动添加静态绑定表。


配置防止ARP中间人攻击示例

组网需求
如图3-247所示,SwitchA通过接口GE2/0/1连接DHCP Server,通过接口GE1/0/1、GE1/0/2连接DHCP客户端UserA和UserB,通过接口GE1/0/3连接静态配置IP地址的用户UserC。SwitchA的接口GE1/0/1、GE1/0/2、GE1/0/3、GE2/0/1都属于VLAN10。管理员希望能够防止ARP中间人攻击,避免合法用户的数据被中间人窃取,同时希望能够了解当前ARP中间人攻击的频率和范围。

配置思路
采用如下思路在SwitchA上进行配置:
1、配置DHCP Snooping功能,并配置静态绑定表。
2、使能动态ARP检测功能,使SwitchA对收到的ARP报文对应的源IP、源MAC、VLAN以及接口信息进行绑定表匹配检查,实现防止ARP中间人攻击。

操作步骤
1、创建VLAN,将接口加入到VLAN中

创建VLAN10,并将接口GE1/0/1、GE1/0/2、GE1/0/3、GE2/0/1加入VLAN10中。

<HUAWEI> system-view
[HUAWEI] sysname SwitchA
[SwitchA] vlan batch 10
[SwitchA] interface gigabitethernet 1/0/1
[SwitchA-GigabitEthernet1/0/1] port link-type access
[SwitchA-GigabitEthernet1/0/1] port default vlan 10
[SwitchA-GigabitEthernet1/0/1] quit
[SwitchA] interface gigabitethernet 1/0/2
[SwitchA-GigabitEthernet1/0/2] port link-type access
[SwitchA-GigabitEthernet1/0/2] port default vlan 10
[SwitchA-GigabitEthernet1/0/2] quit
[SwitchA] interface gigabitethernet 1/0/3
[SwitchA-GigabitEthernet1/0/3] port link-type access
[SwitchA-GigabitEthernet1/0/3] port default vlan 10
[SwitchA-GigabitEthernet1/0/3] quit
[SwitchA] interface gigabitethernet 2/0/1
[SwitchA-GigabitEthernet2/0/1] port link-type trunk
[SwitchA-GigabitEthernet2/0/1] port trunk allow-pass vlan 10
[SwitchA-GigabitEthernet2/0/1] quit
2、配置DHCP Snooping功能

全局使能DHCP Snooping功能。

[SwitchA] dhcp enable
[SwitchA] dhcp snooping enable

在VLAN10内使能DHCP Snooping功能。

[SwitchA] vlan 10
[SwitchA-vlan10] dhcp snooping enable
[SwitchA-vlan10] quit

配置接口GE2/0/1为DHCP Snooping信任接口。

[SwitchA] interface gigabitethernet 2/0/1
[SwitchA-GigabitEthernet2/0/1] dhcp snooping trusted
[SwitchA-GigabitEthernet2/0/1] quit

配置静态绑定表。

[SwitchA] user-bind static ip-address 10.0.0.2 mac-address 00e0-fc12-3456 interface gigabitethernet 1/0/3 vlan 10
3、使能动态ARP检测功能

在接口GE1/0/1、GE1/0/2、GE1/0/3下使能动态ARP检测功能。以GE1/0/1为例,GE1/0/2和GE1/0/3的配置与GE1/0/1接口类似,不再赘述。

[SwitchA] interface gigabitethernet 1/0/1
[SwitchA-GigabitEthernet1/0/1] arp anti-attack check user-bind enable //使能动态ARP检测功能(即对ARP报文进行绑定表匹配检查功能)
[SwitchA-GigabitEthernet1/0/1] quit
4、验证配置结果

执行命令display arp anti-attack configuration check user-bind interface,查看各接口下动态ARP检测的配置信息,以GE1/0/1为例

[SwitchA] display arp anti-attack configuration check user-bind interface gigabitethernet 1/0/1
arp anti-attack check user-bind enable

执行命令display arp anti-attack statistics check user-bind interface,查看各接口下动态ARP检测的ARP报文丢弃计数,以GE1/0/1为例。

[SwitchA] display arp anti-attack statistics check user-bind interface gigabitethernet 1/0/1
Dropped ARP packet number is 966
Dropped ARP packet number since the latest warning is 605
由显示信息可知,接口GE1/0/1下产生了ARP报文丢弃计数,表明防ARP中间人攻击功能已经生效。

当在各接口下多次执行命令display arp anti-attack statistics check user-bind interface时,管理员可根据显示信息中“Dropped ARP packet number is”字段值的变化来了解ARP中间人攻击频率和范围。

配置文件
# SwitchA的配置文件
#
sysname SwitchA
#
vlan batch 10
#
dhcp enable
#
dhcp snooping enable
user-bind static ip-address 10.0.0.2 mac-address 00e0-fc12-3456 interface GigabitEthernet1/0/3 vlan 10

vlan 10
dhcp snooping enable

interface GigabitEthernet1/0/1
port link-type access
port default vlan 10
arp anti-attack check user-bind enable

interface GigabitEthernet1/0/2
port link-type access
port default vlan 10
arp anti-attack check user-bind enable
#
interface GigabitEthernet1/0/3
port link-type access
port default vlan 10
arp anti-attack check user-bind enable

interface GigabitEthernet2/0/1
port link-type trunk
port trunk allow-pass vlan 10
dhcp snooping trusted

return

标签: 安全 网络

本文转载自: https://blog.csdn.net/weixin_46041124/article/details/136254328
版权归原作者 叶落 无痕 所有, 如有侵权,请联系我们删除。

“ARP安全”的评论:

还没有评论