二层交换机实现仿冒网关的ARP防
攻击 :
一、组网需求:
1. 二层交换机阻止
网络
用户仿冒网关
IP 的ARP攻击
二、组网图:
图1二层交换机防ARP攻击组网
S3552P是三层
设备,其中IP:100.1.1.1是所有PC的网 关,S3552P上的网关MAC
地址为000f-e200-3999。PC-B上装有 ARP攻击
软件。现在需要对S3026C_A进行一些特殊配置,目 的是过滤掉仿冒网关IP的ARP报文。
三、配置步骤 对于二层交换机如S3026C等支持用户自定义 ACL(number为5000到5999)的交换机,可以配置ACL来进行ARP报文过滤。
全局配置ACL禁止所有源IP是网关的ARP报文 acl num 5000 rule 0 deny 0806 ffff 24 64010101 ffffffff 40 rule 1 permit 0806 ffff 24 000fe2003999 ffffffffffff 34 其中rule0把整个S3026C_A的端口冒充网关的ARP报文禁掉,其中斜体部分64010101是网关IP地址100.1.1.1的16进 制表示形式。Rule1允许通过网关发送的ARP报文,斜体部分为网关的mac地址000f-e200-3999。
注意:配置Rule时的配置顺序,上述配置为先下发后生效的情况。
在S3026C-A
系统视图下发acl规则:
[S3026C-A]
packet -
filter user-group 5000 这样只有S3026C_A上连网关设备才能够发送网关的ARP报文,其它主机都不能发送假冒网关的arp响应报文。
三层交换机实现仿冒网关的ARP防攻击
一、组网需求: 1. 三层交换机实现防止同网段的用户仿冒网关IP的ARP攻击
二、组网图
图2 三层交换机防ARP攻击组网
三、配置步骤
1. 对于三层设备,需要配置过滤源IP是网关的ARP报文的ACL规则,配置如下ACL规则: acl number 5000 rule 0 deny 0806 ffff 24 64010105 ffffffff 40 rule0禁止S3526E的所有端口接收冒充网关的ARP报文,其中斜体部分64010105是网关IP地址100.1.1.5的16进制表示 形式。
2. 下发ACL到全局 [S3526E] packet-filter user-group 5000
仿冒他人IP的ARP防攻击
一、组网需求: 作为网关的设备有可能会出现错误ARP的表项,因此在网 关设备上还需对用户仿冒他人IP的ARP攻击报文进行过滤。
二、组网图: 参见图1和图2
三、配置步骤: 1. 如图1所示,当PC-B发送源IP地址为PC-D的arp reply攻击报文,源mac是PC-B的mac (000d-88f8-09fa),源ip是PC-D的ip(100.1.1.3),目的ip和mac是网关(3552P)的,这样3552上就会
学习到错误的arp,如下所示:
--------------------- 错误 arp 表项 -------------------------------- IP Address MAC Address VLAN ID Port Name Aging Type 100.1.1.4 000d-88f8-09fa 1 Ethernet0/2 20 Dynamic 100.1.1.3 000f-3d81-45b4 1 Ethernet0/2 20 Dynamic |
从网络连接可以知道PC-D的arp表项应该学习到端口E0/8上,而不应该学习到E0/2端口上。但实际上交换机上学习到该ARP表项在E0/2。上 述现象可以在S3552上配置静态ARP实现防攻击:
arp static 100.1.1.3 000f-3d81-45b4 1 e0/8 |
2. 在图2 S3526C上也可以配置静态ARP来防止设备学习到错误的ARP表项。
3. 对于二层设备(S3050C和S3026E系列),除了可以配置静态ARP外,还可以配置IP+MAC+port绑定,比如在S3026C端口E0/4上 做如下操作: am user-
bind ip-addr 100.1.1.4 mac-addr 000d-88f8-09fa
int e0/4 则IP为100.1.1.4并且MAC为000d-88f8-09fa的ARP报文可以通过E0/4端口,仿冒其它设备的ARP报文则无法通 过,从而不会出现错误ARP表项。
四、配置关键点: 此处仅仅列举了部分Quidway S系列以太网交换机的
应用。在实际的网络应用中,请根据配置
手册确认该产品是否支持用户自定义ACL和地址绑定。仅 仅具有上述
功能的交换机才能防止ARP欺骗。实际配置时注意偏移量 的值,如不清楚请咨询华为售后工程师。6503交换机配置实例:acl number 5000
rule 0 deny 0806 ffff 24 0a4e0401 ffffffff 40
rule 1 permit 0806 ffff 24 000fe218ded7 ffffffffffff 34interface GigabitEthernet1/0/9
description Connect-to-Vlan4_S3928TP_1_G1/1/1
duplex full
speed 1000
port link-type trunk
port trunk permit vlan all
qos
packet-filter inbound user-group 5000 rule 0 system-index 1
packet-filter inbound user-group 5000 rule 1 system-index 2 3900系列交换机配置实例:acl number 5000
rule 0 deny 0806 ffff 16 0a4e0401 ffffffff 32
rule 1 permit 0806 ffff 16 000fe218ded7 ffffffffffff 32
rule 2 deny 0806 ffff 16 00142a6cf8f4 ffffffffffff 32
rule 3 deny 0806 ffff 16 0a4e04ba ffffffffffff 32 86中交换机配置:<Build4-2_S3928TP>display current-configuration
#
local-server nas-ip 127.0.0.1 key huawei
#
domain default enable system
#
queue-scheduler wrr 1 2 3 4 5 9 13 15
#
radius scheme system
#
domain system
#
local-user panda
password simple pingafan
service-type telnet
level 3
#
acl number 5000
rule 0 deny 0806 ffff 24 0a4e0401 ffffffff 40
rule 1 permit 0806 ffff 24 000fe218ded7 ffffffffffff 34
#
vlan 1
#
vlan 10
#
vlan 40
#
interface Vlan-interface1
ip address 10.78.1.42 255.255.255.0
#
interface Vlan-interface40
#
interface Aux1/0/0
#
interface Ethernet1/0/1
port access vlan 40
packet-filter inbound user-group 5000 rule 0
packet-filter inbound user-group 5000 rule 1
#
interface Ethernet1/0/2
port access vlan 40
packet-filter inbound user-group 5000 rule 0
packet-filter inbound user-group 5000 rule 1
#
interface Ethernet1/0/3
port access vlan 40
packet-filter inbound user-group 5000 rule 0
packet-filter inbound user-group 5000 rule 1
#
interface Ethernet1/0/4
port access vlan 40
packet-filter inbound user-group 5000 rule 0
packet-filter inbound user-group 5000 rule 1
#
interface Ethernet1/0/5
port access vlan 40
packet-filter inbound user-group 5000 rule 0
packet-filter inbound user-group 5000 rule 1
#
interface Ethernet1/0/6
port access vlan 40
packet-filter inbound user-group 5000 rule 0
packet-filter inbound user-group 5000 rule 1
#
interface Ethernet1/0/7
port access vlan 40
packet-filter inbound user-group 5000 rule 0
packet-filter inbound user-group 5000 rule 1
#
interface Ethernet1/0/8
port access vlan 40
packet-filter inbound user-group 5000 rule 0
packet-filter inbound user-group 5000 rule 1
#
interface Ethernet1/0/9
port access vlan 40
packet-filter inbound user-group 5000 rule 0
packet-filter inbound user-group 5000 rule 1
#
interface Ethernet1/0/10
port access vlan 40
packet-filter inbound user-group 5000 rule 0
packet-filter inbound user-group 5000 rule 1
#
interface Ethernet1/0/11
port access vlan 40
packet-filter inbound user-group 5000 rule 0
packet-filter inbound user-group 5000 rule 1
#
interface Ethernet1/0/12
port access vlan 40
packet-filter inbound user-group 5000 rule 0
packet-filter inbound user-group 5000 rule 1
#
interface Ethernet1/0/13
port access vlan 40
packet-filter inbound user-group 5000 rule 0
packet-filter inbound user-group 5000 rule 1
#
interface Ethernet1/0/14
port access vlan 40
packet-filter inbound user-group 5000 rule 0
packet-filter inbound user-group 5000 rule 1
#
interface Ethernet1/0/15
port access vlan 40
packet-filter inbound user-group 5000 rule 0
packet-filter inbound user-group 5000 rule 1
#
interface Ethernet1/0/16
port access vlan 40
packet-filter inbound user-group 5000 rule 0
packet-filter inbound user-group 5000 rule 1
#
interface Ethernet1/0/17
port access vlan 40
packet-filter inbound user-group 5000 rule 0
packet-filter inbound user-group 5000 rule 1
#
interface Ethernet1/0/18
port access vlan 40
packet-filter inbound user-group 5000 rule 0
packet-filter inbound user-group 5000 rule 1
#
interface Ethernet1/0/19
port access vlan 40
packet-filter inbound user-group 5000 rule 0
packet-filter inbound user-group 5000 rule 1
#
interface Ethernet1/0/20
port access vlan 40
packet-filter inbound user-group 5000 rule 0
packet-filter inbound user-group 5000 rule 1
#
interface Ethernet1/0/21
port access vlan 40
packet-filter inbound user-group 5000 rule 0
packet-filter inbound user-group 5000 rule 1
#
interface Ethernet1/0/22
port access vlan 40
packet-filter inbound user-group 5000 rule 0
packet-filter inbound user-group 5000 rule 1
#
interface Ethernet1/0/23
port access vlan 40
packet-filter inbound user-group 5000 rule 0
packet-filter inbound user-group 5000 rule 1
#
interface Ethernet1/0/24
port access vlan 40
packet-filter inbound user-group 5000 rule 0
packet-filter inbound user-group 5000 rule 1
#
interface GigabitEthernet1/1/1
description Connect-to-S6503_G1/0/9
duplex full
speed 1000
port link-type trunk
port trunk permit vlan all
#
interface GigabitEthernet1/1/2
description Connect-to-S6503_G1/0/8
duplex full
speed 1000
port link-type trunk
port trunk permit vlan all
#
interface GigabitEthernet1/1/3
#
interface GigabitEthernet1/1/4
port link-type trunk
port trunk permit vlan all
packet-filter inbound user-group 5000 rule 0
packet-filter inbound user-group 5000 rule 1
#
sysname Build4-2_S3928TP
undo irf-fabric authentication-mode
#
interface NULL0
#
ip route-static 0.0.0.0 0.0.0.0 10.78.1.1 preference 60
#
snmp-agent
snmp-agent local-engineid 800007