• 产品与解决方案
  • 行业解决方案
  • 服务
  • 支持
  • 合作伙伴
  • 新华三人才研学中心
  • 关于我们

H3C SOHO交换机 典型配置举例(Comware V5)-6W102

31-ARP攻击防御典型配置举例

本章节下载 31-ARP攻击防御典型配置举例  (198.01 KB)

docurl=/cn/Service/Document_Software/Document_Center/Switches/Catalog/S5110/S5110/Configure/Typical_Configuration_Example/H3C_SOHO_CE(Comware_V5)-6W102/201809/1107306_30005_0.htm

31-ARP攻击防御典型配置举例


1  ARP攻击防御典型配置举例

1.1  简介

本章介绍ARP攻击防御技术的典型配置举例,关于ARP攻击报文的特点以及ARP攻击类型的详细介绍,请参见“ARP攻击防范技术白皮书”

1.2  源MAC地址固定的ARP攻击检测功能典型配置举例

1.2.1  组网需求

图1所示,某局域网内四个客户端通过两台接入交换机连接网关和内部服务器,内部服务器的MAC地址为0001-0002-0003。

现要求通过源MAC地址固定的ARP攻击检测功能实现:

·     网关收到同一源MAC地址的ARP报文超过一定的阈值,能够将攻击MAC地址添加到攻击检测表项中。

·     攻击检测表项老化之前,打印Log信息并且将该源MAC地址发送的ARP报文过滤掉。

·     内部服务器MAC地址0001-0002-0003即使存在攻击也不会被检测、过滤。

图1 源MAC地址固定的ARP攻击检测功能典型配置组网图

 

1.2.2  配置步骤

(1)     配置网关

# 开启源MAC固定ARP攻击检测功能,并选择filter检查模式。

<Gateway> system-view

[Gateway] arp anti-attack source-mac filter

# 配置源MAC固定ARP报文攻击检测阈值为30个。

[Gateway] arp anti-attack source-mac threshold 30

# 配置源MAC地址固定的ARP攻击检测表项的老化时间为60秒。

[Gateway] arp anti-attack source-mac aging-time 60

# 配置源MAC固定攻击检查的保护MAC地址为0001-0002-0003。

[Gateway] arp anti-attack source-mac exclude-mac 0001-0002-0003

1.2.3  验证配置

# 显示检测到的源MAC地址固定的ARP攻击检测表项。

<Sysname> display arp anti-attack source-mac slot 1

Source-MAC          VLAN ID           Interface             Aging-time

23f3-1122-3344      4094              GE2/0/1               10

23f3-1122-3355      4094              GE2/0/2               30

23f3-1122-33ff      4094              GE2/0/3               25

23f3-1122-33ad      4094              GE2/0/4               30

23f3-1122-33ce      4094              GE2/0/5               2

1.2.4  配置文件

#

 arp anti-attack source-mac filter

 arp anti-attack source-mac exclude-mac 0001-0002-0003

 arp anti-attack source-mac aging-time 60

 arp anti-attack source-mac threshold 30

#

1.3  ARP Detection功能(使用DHCP Snooping安全表项)典型配置举例

1.3.1  组网需求

图2所示,Host A、Host B、Host C和Host D在同一VLAN1内,并且通过Switch A和Switch B连接网关和DHCP服务器,Host A、Host B和Host C为DHCP客户端,Host D为静态配置IP地址的客户端。

现要求通过ARP Detection功能(使用DHCP Snooping安全表项)实现Host A、Host B和Host C发送的ARP报文能够正常转发,Host D发送的ARP报文为攻击报文并被丢弃。

图2 ARP Detection功能(使用DHCP Snooping安全表项)典型配置组网图

 

1.3.2  配置思路

·     为防止仿冒用户、欺骗网关,可以在接入交换机上配置ARP Detection功能,对ARP报文的有效性和用户合法性进行检查。

·     为了使客户端能够获取动态IP地址,需要在交换机上配置DHCP Snooping功能。

1.3.3  配置注意事项

如果既配置了报文有效性检查功能,又配置了用户合法性检查功能,那么先进行报文有效性检查,然后进行用户合法性检查。

1.3.4  配置步骤

(1)     配置Switch A

# 配置DHCP Snooping功能。

<SwitchA> system-view

[SwitchA] dhcp-snooping

[SwitchA] interface gigabitethernet 1/0/1

[SwitchA-GigabitEthernet1/0/1] dhcp-snooping trust

[SwitchA-GigabitEthernet1/0/1] quit

# 开启ARP Detection功能,对用户合法性进行检查。

[SwitchA] vlan 1

[SwitchA-vlan1] arp detection enable

[SwitchA-vlan1] quit

# 端口状态缺省为非信任状态,上行端口配置为信任状态,下行端口按缺省配置。

[SwitchA] interface gigabitethernet 1/0/1

[SwitchA-GigabitEthernet1/0/1] arp detection trust

[SwitchA-GigabitEthernet1/0/1] quit

# 配置进行ARP报文有效性检查。

[SwitchA] arp detection validate dst-mac ip src-mac

(2)     配置Switch B

Switch B的配置与Switch A相似,配置过程略。

1.3.5  验证配置

配置完成后,使用display dhcp-snooping命令进行查看,如果用户侧主机的ARP报文中携带的发送者信息和DHCP Snooping安全表项信息一致,则报文可进行正常转发,否则报文将被认定为攻击报文并被丢弃。

1.3.6  配置文件

#

 dhcp-snooping

#

vlan 1

 arp detection enable

#

interface GigabitEthernet1/0/1

 dhcp-snooping trust

 arp detection trust

#

 arp detection validate dst-mac ip src-mac

#

1.4  ARP Detection功能(使用802.1X安全表项)典型配置举例

1.4.1  组网需求

图3所示,Host A和Host B通过Switch A连接网关和两台RADIUS服务器,两台RADIUS服务器IP地址分别为10.1.1.1和10.1.1.2,使用前者作为主认证/备份计费服务器,使用后者作为备份认证/主计费服务器,Host A和Host B均为静态配置IP地址的客户端。

现要求通过ARP Detection功能(使用802.1X安全表项)实现Host A和Host B输入正确的用户名和密码通过RADIUS服务器认证后,发送的ARP报文能够进行正常转发。

图3 ARP Detection功能(使用802.1X安全表项)典型配置组网图

 

1.4.2  配置思路

·     接入交换机上需开启802.1X和AAA相关配置。

·     为防止仿冒用户、欺骗网关,可以在接入交换机上配置ARP Detection功能,对ARP报文的用户合法性进行检查。

1.4.3  配置注意事项

802.1X客户端必须支持上传IP地址的功能。

1.4.4  配置步骤

·     配置Switch A

# 添加本地接入用户,用户名为localuser,密码为明文输入的localpass。启动闲置切断功能并设置相关参数。

<SwitchA> system-view

[SwitchA] local-user localuser

[SwitchA-luser-localuser] service-type lan-access

[SwitchA-luser-localuser] password simple localpass

[SwitchA-luser-localuser] authorization-attribute idle-cut 20

[SwitchA-luser-localuser] quit

# 创建RADIUS方案radius1并进入其视图。

[SwitchA] radius scheme radius1

# 设置主认证/计费RADIUS服务器的IP地址。

[SwitchA-radius-radius1] primary authentication 10.1.1.1

[SwitchA-radius-radius1] primary accounting 10.1.1.2

# 设置备份认证/计费RADIUS服务器的IP地址。

[SwitchA-radius-radius1] secondary authentication 10.1.1.2

[SwitchA-radius-radius1] secondary accounting 10.1.1.1

# 设置系统与认证RADIUS服务器交互报文时的共享密钥。

[SwitchA-radius-radius1] key authentication name

# 设置系统与计费RADIUS服务器交互报文时的共享密钥。

[SwitchA-radius-radius1] key accounting money

# 设置系统向RADIUS服务器重发报文的时间间隔与次数。

[SwitchA-radius-radius1] timer response-timeout 5

[SwitchA-radius-radius1] retry 5

# 设置系统向RADIUS服务器发送实时计费报文的时间间隔。

[SwitchA-radius-radius1] timer realtime-accounting 15

# 指示系统从用户名中去除用户域名后再将之传给RADIUS服务器。

[SwitchA-radius-radius1] user-name-format without-domain

[SwitchA-radius-radius1] quit

# 创建域example.com并进入其视图。

[SwitchA] domain example.com

# 指定radius1为该域用户的RADIUS方案,并采用local作为备选方案。

[SwitchA-isp-example.com] authentication default radius-scheme radius1 local

[SwitchA-isp-example.com] authorization default radius-scheme radius1 local

[SwitchA-isp-example.com] accounting default radius-scheme radius1 local

# 设置该域最多可容纳30个用户。

[SwitchA-isp-example.com] access-limit enable 30

# 启动闲置切断功能并设置相关参数。

[SwitchA-isp-example.com] idle-cut enable 20

[SwitchA-isp-example.com] quit

# 配置域example.com为缺省用户域。

[SwitchA] domain default enable example.com

# 配置802.1x功能。

[SwitchA] dot1x

[SwitchA] interface gigabitethernet 1/0/2

[SwitchA-GigabitEthernet1/0/2] dot1x

[SwitchA-GigabitEthernet1/0/2] quit

[SwitchA] interface gigabitethernet 1/0/3

[SwitchA-GigabitEthernet1/0/3] dot1x

[SwitchA-GigabitEthernet1/0/3] quit

# 开启ARP Detection功能,对用户合法性进行检查。

[SwitchA] vlan 1

[SwitchA-vlan1] arp detection enable

# 端口状态缺省为非信任状态,上行端口配置为信任状态,下行端口按缺省配置。

[SwitchA-vlan1] interface gigabitethernet 1/0/1

[SwitchA-GigabitEthernet1/0/1] arp detection trust

[SwitchA-GigabitEthernet1/0/1] quit

1.4.5  验证配置

配置完成后,如果用户侧主机的ARP报文中携带的发送者信息和802.1X安全表项信息一致,则报文可进行正常转发,否则报文将被认定为攻击报文并被丢弃。

1.4.6  配置文件

#

 domain default enable example.com

#

 dot1x

#

vlan 1

 arp detection enable

#

radius scheme radius1

 primary authentication 10.1.1.1

 primary accounting 10.1.1.2

 secondary authentication 10.1.1.2

 secondary accounting 10.1.1.1

 key authentication cipher $c$3$DdOHTCT8yNBZxYvle7XkD2Ls5i+A8To=

 key accounting cipher $c$3$2lMkqUQ+POWiHNKtd0a3fwYxlvWvuRp+

 timer realtime-accounting 15

 timer response-timeout 5

 user-name-format without-domain

 retry 5

#

domain example.com

 authentication default radius-scheme radius1 local

 authorization default radius-scheme radius1 local

 accounting default radius-scheme radius1 local

 access-limit enable 30

 state active

 idle-cut enable 20 10240

 self-service-url disable

#

local-user localuser

 password cipher $c$3$QF9jpm2ZxRQA8YS5+qedkwIPkWXuIc8FHb+qyQ==

 authorization-attribute idle-cut 20

 service-type lan-access

#

interface GigabitEthernet1/0/1

 arp detection trust

#

interface GigabitEthernet1/0/2

 dot1x

#

interface GigabitEthernet1/0/3

 dot1x

#

不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!

新华三官网
联系我们