一、实验环境
华为ENSP模拟器、VMware Workstation 15.5、Centos 7.6
二、实验步骤
2、分别配置二层交换机SW1与三层交换机RSW1
配置二层交换机SW1
[Huawei] sysname SW1
[SW1] vlan batch 10 20 100
[SW1]interface Ethernet 0/0/4
[SW1-Ethernet0/0/4] port link-type access
[SW1-Ethernet0/0/4] port default vlan 100
[SW1] interface Ethernet 0/0/3
[SW1-Ethernet0/0/3] port link-type access
[SW1-Ethernet0/0/3] port default vlan 20
[SW1-Ethernet0/0/3] interface Ethernet 0/0/2
[SW1-Ethernet0/0/2] port link-type access
[SW1-Ethernet0/0/2] port default vlan 10
[SW1-Ethernet0/0/2] interface Ethernet 0/0/1
[SW1-Ethernet0/0/1] port link-type trunk
[SW1-Ethernet0/0/1] port trunk allow-pass vlan all
配置三层交换机LSW1
[Huawei] sysname RSW1
[RSW1] interface GigabitEthernet 0/0/1
[RSW1-GigabitEthernet0/0/1] port link-type trunk
[RSW1-GigabitEthernet0/0/1] port trunk allow-pass vlan all
[RSW1] vlan batch 10 20 100
[RSW1] dhcp enable
[RSW1] interface vlanif 10
[RSW1-Vlanif10] ip add 192.168.10.1 24
[RSW1-Vlanif10] dhcp select relay
[RSW1-Vlanif10] dhcp relay server-ip 192.168.100.100
[RSW1-Vlanif10] interface vlanif 20
[RSW1-Vlanif20] ip add 192.168.20.1 24
[RSW1-Vlanif20] dhcp select relay
[RSW1-Vlanif20] dhcp relay server-ip 192.