VLAN第一天实验
搭建拓扑
VLAN划分如上图。
PC1、3划到192.168.1.0 24网段
PC2、4、5、6划到192.168.2.0 24网段
配置演示
创建VLAN
[SW1]vlan batch 2 to 6
[SW1-Vlanif2]int g0/0/1
[SW1-GigabitEthernet0/0/1]port link-type hybrid
[SW1-GigabitEthernet0/0/1]port hybrid pvid vlan 2
[SW1-GigabitEthernet0/0/1]port hybrid untagged vlan
DHCP服务
[SW2]dhcp enable
[SW2]ip pool b
[SW2-ip-pool-b]network 192.168.1.0 mask 24
[SW2-ip-pool-b]gateway-list 192.168.1.2
[SW2-ip-pool-b]int vlanif 2
[SW2-Vlanif2]dhcp select global
trunk干道
[SW1-port-group-link-fla]port link-type trunk
[SW1-port-group-link-fla]port trunk allow-pass vlan 2 3 4 5 6