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

phxc8 3月前 107

配置思路
采用如下思路在SwitchA上进行配置:
使能动态ARP检测功能,使SwitchA对收到的ARP报文对应的源IP、源MAC、VLAN以及接口信息进行DHCP Snooping绑定表匹配检查,实现防止ARP中间人攻击。
使能动态ARP检测丢弃报文告警功能,使SwitchA开始统计丢弃的不匹配DHCP Snooping绑定表的ARP报文数量,并在丢弃数量超过告警阈值时能以告警的方式提醒管理员,这样可以使管理员根据告警信息以及报文丢弃计数来了解当前ARP中间人攻击的频率和范围。
配置DHCP Snooping功能,并配置静态绑定表,使动态ARP检测功能生效。
操作步骤
创建VLAN,将接口加入到VLAN中
# 创建VLAN10,并将接口GE0/0/1、GE0/0/2、GE0/0/3、GE0/0/4加入VLAN10中。

<HUAWEI> system-view
[HUAWEI] sysname SwitchA
[SwitchA] vlan batch 10
[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] port link-type access
[SwitchA-GigabitEthernet0/0/1] port default vlan 10
[SwitchA-GigabitEthernet0/0/1] quit
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] port link-type access
[SwitchA-GigabitEthernet0/0/2] port default vlan 10
[SwitchA-GigabitEthernet0/0/2] quit
[SwitchA] interface gigabitethernet 0/0/3
[SwitchA-GigabitEthernet0/0/3] port link-type access
[SwitchA-GigabitEthernet0/0/3] port default vlan 10
[SwitchA-GigabitEthernet0/0/3] quit
[SwitchA] interface gigabitethernet 0/0/4
[SwitchA-GigabitEthernet0/0/4] port link-type trunk
[SwitchA-GigabitEthernet0/0/4] port trunk allow-pass vlan 10
[SwitchA-GigabitEthernet0/0/4] quit
使能动态ARP检测功能和动态ARP检测丢弃报文告警功能
# 在接口GE0/0/1、GE0/0/2、GE0/0/3下使能动态ARP检测功能和动态ARP检测丢弃报文告警功能。以GE0/0/1为例,GE0/0/2、GE0/0/3的配置与GE0/0/1接口类似,不再赘述。

[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] arp anti-attack check user-bind enable
[SwitchA-GigabitEthernet0/0/1] arp anti-attack check user-bind alarm enable
[SwitchA-GigabitEthernet0/0/1] quit
配置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
# 配置接口GE0/0/4为DHCP Snooping信任接口。

[SwitchA] interface gigabitethernet 0/0/4
[SwitchA-GigabitEthernet0/0/4] dhcp snooping trusted
[SwitchA-GigabitEthernet0/0/4] quit
# 配置静态绑定表。

[SwitchA] user-bind static ip-address 10.0.0.2 mac-address 0001-0001-0001 interface gigabitethernet 0/0/3 vlan 10
验证配置结果
# 执行命令display arp anti-attack configuration check user-bind interface,查看各接口下动态ARP检测的配置信息,以GE0/0/1为例。

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

[SwitchA] display arp anti-attack statistics check user-bind interface gigabitethernet 0/0/1
 Dropped ARP packet number is 966                                                 
 Dropped ARP packet number since the latest warning is 605
由显示信息可知,接口GE0/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 0001-0001-0001 interface GigabitEthernet0/0/3 vlan 10
#                                                                               
vlan 10                                                                          
 dhcp snooping enable                                              
#                                                                               
interface GigabitEthernet0/0/1
 port link-type access
 port default vlan 10
 arp anti-attack check user-bind enable
 arp anti-attack check user-bind alarm enable
#   
interface GigabitEthernet0/0/2
 port link-type access
 port default vlan 10
 arp anti-attack check user-bind enable
 arp anti-attack check user-bind alarm enable
#
interface GigabitEthernet0/0/3
 port link-type access
 port default vlan 10
 arp anti-attack check user-bind enable
 arp anti-attack check user-bind alarm enable
#   
interface GigabitEthernet0/0/4
 port link-type trunk                                                           
 port trunk allow-pass vlan 10                                                   
 dhcp snooping trusted                                                            
#   
return
最新回复 (0)
返回
发新帖