ENSP配置 实例八 三层交换机dhcp配置加vlan划分实验
LW1配置
[SW1]vlan batch 10 20
[SW1-GigabitEthernet0/0/1]port link-type trunk
[SW1-GigabitEthernet0/0/1]p t a vlan 10 20
[SW1]int Vlanif 10
[SW1-Vlanif10]ip add 192.168.1.254 24
[SW1-Vlanif10]int vlanif 20
[SW1-Vlanif20]ip add 192.168.2.254 24
[SW1]dhcp enable
[SW1]ip pool 1
[SW1-ip-pool-1]network 192.168.1.0 mask 24
[SW1-ip-pool-1]gateway-list 192.168.1.254
[SW1-ip-pool-1]dns-list 1.1.1.1
[SW1]ip pool 2
[SW1-ip-pool-2]network 192.168.2.0 mask 24
[SW1-ip-pool-2]gateway-list 192.168.2.254
[SW1-ip-pool-2]dns-list 1.1.1.1
[SW1]int vlan 1
[SW1-Vlanif10]dhcp select global
[SW1-Vlanif10]int vlan 20
[SW1-Vlanif20]dhcp select global
LW2配置 LW3配置
[SW2]vlan batch 10 20 [SW3]vlan batch 10 20
[SW2]int e0/0/2 [SW3]int e0/0/1
[SW2-Ethernet0/0/2]port link-type access [SW3-Ethernet0/0/1]p l t
[SW2-Ethernet0/0/2]p d v 10 [SW3-Ethernet0/0/1]p t a v 10 20
[SW2-Ethernet0/0/2]int e0/0/3 [SW3-Ethernet0/0/1]int e0/0/2
[SW2-Ethernet0/0/3]port link-type access [SW3-Ethernet0/0/2]p l a
[SW2-Ethernet0/0/3]p d v 20 [SW3-Ethernet0/0/2]p d v 10
[SW2-Ethernet0/0/3]int e0/0/4 [SW3-Ethernet0/0/2]int e0/0/3
[SW2-Ethernet0/0/4]port link-type t [SW3-Ethernet0/0/3]p l t a
[SW2-Ethernet0/0/4]port trunk allow-pass vlan 10 20 [SW3-Ethernet0/0/2]p d v 10
[SW2-Ethernet0/0/4]int e0/0/1
[SW2-Ethernet0/0/1]port link-type trunk
[SW2-Ethernet0/0/1]port trunk allow-pass vlan 10 20