赞
踩
组网图形
静态ARP表项是指网络管理员手工建立IP地址和MAC地址之间固定的映射关系。
正常情况下网络中设备可以通过ARP协议进行ARP表项的动态学习,生成的动态ARP表项可以被老化,可以被更新。但是当网络中存在ARP攻击时,设备中动态ARP表项可能会被更新成错误的ARP表项,或者被老化,造成合法用户通信异常。静态ARP表项不会被老化,也不会被动态ARP表项覆盖,可以保证网络通信的安全性。静态ARP表项可以限制本端设备和指定IP地址的对端设备通信时只使用指定的MAC地址,此时攻击报文无法修改本端设备的ARP表中IP地址和MAC地址的映射关系,从而保护了本端设备和对端设备间的正常通信。一般在网关设备上配置静态ARP表项。
对于以下场景,用户可以配置静态ARP表项。
本举例适用于S系列交换机所有产品的所有版本。
如需了解交换机软件配套详细信息,请点击Info-Finder,在选择产品系列或产品型号后,在“硬件中心”进行查询。
S5731-L和S5731S-L属于远端模块,不支持Web管理、YANG和命令行,仅支持通过中心交换机对其下发配置,相关操作请参见《S300, S500, S2700, S5700, S6700 V200R022C00 配置指南-设备管理》中的“智能极简园区网络配置(小行星方案)”。
如图1所示,企业通过Switch实现各个部门之间的互连,且各个部门加入不同的VLAN。总裁办公室和文件备份服务器采取手工方式分配已经获取到固定IP地址,市场部和研发部主机通过DHCP方式已经获取到动态IP地址。由于市场部拥有访问外网的权利,主机经常会感染ARP病毒,攻击Switch并修改Switch上的动态ARP表项,造成总裁办公室与外界的通信中断以及各个部门不能正常访问文件备份服务器。公司希望在Switch上配置静态ARP表项,以保证总裁办公室与外界的通信安全,并保证各个部门能正常访问文件备份服务器。
静态ARP的配置思路如下:
- # 创建VLAN10,将接口加入VLAN10,并配置接口VLANIF10的IP地址。
-
- <HUAWEI> system-view
- [HUAWEI] sysname Switch
- [Switch] vlan batch 10
- [Switch] interface gigabitethernet 1/0/1
- [Switch-GigabitEthernet1/0/1] port link-type access
- [Switch-GigabitEthernet1/0/1] port default vlan 10
- [Switch-GigabitEthernet1/0/1] quit
- [Switch] interface vlanif 10
- [Switch-Vlanif10] ip address 10.164.1.20 24
- [Switch-Vlanif10] quit
- # 配置接口GE1/0/2为主接口,并配置接口的IP地址。
-
- [Switch] interface gigabitethernet 1/0/2
- [Switch-GigabitEthernet1/0/2] undo portswitch
- [Switch-GigabitEthernet1/0/2] ip address 10.164.10.10 24
- [Switch-GigabitEthernet1/0/2] quit
- # 配置接口GE1/0/3为主接口,并配置接口的IP地址。
-
- [Switch] interface gigabitethernet 1/0/3
- [Switch-GigabitEthernet1/0/3] undo portswitch
- [Switch-GigabitEthernet1/0/3] ip address 10.164.20.1 24
- [Switch-GigabitEthernet1/0/3] quit
- 如果设备不支持通过undo portswitch命令将接口转换为主接口后配置IP地址,可以通过配置VLANIF接口后配置IP地址。

- [Switch] arp static 10.164.1.1 00e0-fc01-0001 vid 10 interface gigabitethernet 1/0/1 //为总裁办公室主机配置静态ARP表项
- [Switch] arp static 10.164.10.1 00e0-fc02-1234 interface gigabitethernet 1/0/2 //为文件备份服务器配置静态ARP表项
- # 执行命令display arp static,查看已配置的静态ARP表项。
-
- [Switch] display arp static
- IP ADDRESS MAC ADDRESS EXPIRE(M) TYPE INTERFACE VPN-INSTANCE
- VLAN/CEVLAN
- ------------------------------------------------------------------------------
- 10.164.1.1 00e0-fc01-0001 S-- GE1/0/1
- 10/-
- 10.164.10.1 00e0-fc02-1234 S-- GE1/0/2
- 40/-
- ------------------------------------------------------------------------------
- Total:2 Dynamic:0 Static:2 Interface:0
- # 在总裁办公室的主机(IP地址为10.164.1.1/24,操作系统以Windows 7为例)上Ping路由器上与Switch相连的接口IP地址10.164.20.2/24,可以Ping通。
-
- C:\Documents and Settings\Administrator> ping 10.164.20.2
- Pinging 10.164.20.2 with 32 bytes of data:
- Reply from 10.164.20.2: bytes=32 time=1ms TTL=128
- Reply from 10.164.20.2: bytes=32 time=1ms TTL=128
- Reply from 10.164.20.2: bytes=32 time=1ms TTL=128
- Reply from 10.164.20.2: bytes=32 time=1ms TTL=128
-
- Ping statistics for 10.164.20.2:
- Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
- Approximate round trip times in milli-seconds:
- Minimum = 1ms, Maximum = 1ms, Average = 1ms
- # 在市场部的某主机(IP地址为10.164.2.100/24,操作系统以Windows 7为例)上Ping文件备份服务器的IP地址10.164.10.1/24,可以Ping通。
-
- C:\Documents and Settings\Administrator> ping 10.164.10.1
- Pinging 10.164.10.1 with 32 bytes of data:
- Reply from 10.164.10.1: bytes=32 time=1ms TTL=125
- Reply from 10.164.10.1: bytes=32 time=1ms TTL=125
- Reply from 10.164.10.1: bytes=32 time=1ms TTL=125
- Reply from 10.164.10.1: bytes=32 time=1ms TTL=125
-
- Ping statistics for 10.164.10.1:
- Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
- Approximate round trip times in milli-seconds:
- Minimum = 1ms, Maximum = 1ms, Average = 1ms
- # 在研发部的某主机(IP地址为10.164.3.100/24,操作系统以Windows 7为例)上Ping文件备份服务器的IP地址10.164.10.1/24,可以Ping通。
-
- C:\Documents and Settings\Administrator> ping 10.164.10.1
- Pinging 10.164.10.1 with 32 bytes of data:
- Reply from 10.164.10.1: bytes=32 time=1ms TTL=125
- Reply from 10.164.10.1: bytes=32 time=1ms TTL=125
- Reply from 10.164.10.1: bytes=32 time=1ms TTL=125
- Reply from 10.164.10.1: bytes=32 time=1ms TTL=125
-
- Ping statistics for 10.164.10.1:
- Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
- Approximate round trip times in milli-seconds:
- Minimum = 1ms, Maximum = 1ms, Average = 1ms

- Switch的配置文件。
-
- #
- sysname Switch
- #
- vlan batch 10
- #
- interface Vlanif10
- ip address 10.164.1.20 255.255.255.0
- #
- interface GigabitEthernet1/0/1
- port link-type access
- port default vlan 10
- #
- interface GigabitEthernet1/0/2
- undo portswitch
- ip address 10.164.10.10 255.255.255.0
- #
- interface GigabitEthernet1/0/3
- undo portswitch
- ip address 10.164.20.1 255.255.255.0
- #
- arp static 10.164.1.1 00e0-fc01-0001 vid 10 interface GigabitEthernet1/0/1
- arp static 10.164.10.1 00e0-fc02-1234 interface GigabitEthernet1/0/2
- #
- return

Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。