华为DHCP实验拓扑
1、配置核心交换
sysname core S
vlan batch 100 to 101
dhcp enable
ip pool vlan100
gateway-list 192.168.100.1
network 192.168.100.0 mask 255.255.255.0
lease day 2 hour 0 minute 0
dns-list 192.168.100.1
ip pool vlan101
gateway-list 192.168.101.1
network 192.168.101.0 mask 255.255.255.0
lease day 2 hour 0 minute 0
dns-list 192.168.101.1
interface Vlanif100
ip address 192.168.100.1 255.255.255.0
dhcp select global
interface Vlanif101
ip address 192.168.101.1 255.255.255.0
dhcp select global
interface MEth0/0/1
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
2、配置二层交换
sysname S2
vlan batch 100
interface Ethernet0/0/1
port link-type access
port default vlan 100
interface Ethernet0/0/2
port link-type access
port default vlan 100
interface Ethernet0/0/3
port link-type access
port default vlan 100
interface Ethernet0/0/4
port link-type trunk
port trunk allow-pass vlan 2 to 4094
配置第二台
sysname S3
vlan batch 101
interface Ethernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
interface Ethernet0/0/2
port link-type access
port default vlan 101
interface Ethernet0/0/3
port link-type access
port default vlan 101
interface Ethernet0/0/4
port link-type access
port default vlan 101
检查可以ping通vlan101,实验成功