华为交换机静态ARP与动态ARP结合使用配置示例
1、组网需求
图1 动态ARP与静态ARP组网示例图
如上图1所示,Switch的接口GE1/0/1通过LAN Switch(即LSW)连接主机,接口GE1/0/2连接Server。要求:
GE1/0/1属于VLAN2,GE1/0/2属于VLAN3。 为了适应网络的快速变化,保证报文的正确转发,在Switch的接口VLANIF2上配置动态ARP的参数。
为了保证Server的安全性,防止其他设备仿冒Server发送非法ARP报文,在Switch的接口GE1/0/2上增加一个静态ARP表项,表项的IP地址为10.2.2.3,对应的MAC地址为00e0-fc01-0000。
2、配置思路
2.1、创建VLAN,并将接口加入到VLAN中。
2.2、配置用户侧VLANIF接口的动态ARP的参数。 2.3、配置静态ARP表项。
3、操作步骤
3.1、创建VLAN,并将接口加入到VLAN中。 # 创建VLAN2和VLAN3。
# 将接口GE1/0/1加入VLAN2中,接口GE1/0/2加入VLAN3中。 [HUAWEI] interface gigabitethernet 1/0/1
[HUAWEI-GigabitEthernet1/0/1] port link-type trunk
[HUAWEI-GigabitEthernet1/0/1] port trunk allow-pass vlan 2 [HUAWEI-GigabitEthernet1/0/1] quit
[HUAWEI] interface gigabitethernet 1/0/2
[HUAWEI-GigabitEthernet1/0/2] port link-type access [HUAWEI-GigabitEthernet1/0/2] port default vlan 3 [HUAWEI-GigabitEthernet1/0/2] quit
3.2、配置VLANIF接口的动态ARP的参数。 # 创建接口VLANIF2。
[HUAWEI] interface vlanif 2
# 配置接口VLANIF2的IP地址。
[HUAWEI-Vlanif2] ip address 2.2.2.2 255.255.255.0
# 配置ARP表项老化时间为60秒。 [HUAWEI-Vlanif2] arp expire-time 60
# 配置ARP表项老化探测次数为2次。 [HUAWEI-Vlanif2] arp detect-times 2 [HUAWEI-Vlanif2] quit
# 创建接口VLANIF3。
[HUAWEI] interface vlanif 3
# 配置接口VLANIF3的IP地址。
[HUAWEI-Vlanif3] ip address 10.2.2.2 255.255.255.0 [HUAWEI-Vlanif3] quit
3.4、配置静态ARP表项。
# 配置一条静态ARP表项:IP地址为10.2.2.3,对应的MAC地址为00e0-fc01-0000,VLAN编号为3,出接口为GE1/0/2。
[HUAWEI] arp static 10.2.2.3 00e0-fc01-0000 vid 3 interface gigabitethernet 1/0/2 [HUAWEI] quit
4、检查配置结果
# 执行命令display current-configuration,查看表项老化时间、老化探测次数和ARP映射表信息。
arp static 10.2.2.3 00e0-fc01-0000 vid 3 interface GigabitEthernet1/0/2
5、配置文件
以下仅给出Switch的配置文件。 #
sysname HUAWEI #
vlan batch 2 to 3 #
interface Vlanif2 arp detect-times 2 arp expire-time 60
ip address 2.2.2.2 255.255.255.0 #
interface Vlanif3
ip address 10.2.2.2 255.255.255.0 #
interface GigabitEthernet1/0/1 port link-type
trunk port trunk allow-pass vlan 2 #
interface GigabitEthernet1/0/2 port link-type
access port default vlan 3 #
arp static 10.2.2.3 00e0-fc01-0000 vid 3 interface GigabitEthernet1/0/2 #
return
相关推荐: