根据题干将PC1 3划为VLAN 2,PC2划为VLAN3,PC4划为VLAN4 ,PC5划为VLAN5 ,PC6划为VLAN6按条件1将PC1 PC3所在接口配置为access,PVID为vlan 2,PC2所在接口通过VLAN 3 to 6,PC4通过 VLAN 1 to 4,PC5通过VLAN 3 to 5,PC6通过VLAN 3、6
配置交换机
[SW1]vlan batch 2 to 6
[SW1]int eth 0/0/2
[SW1-Ethernet0/0/2]port link-type access
[SW1-Ethernet0/0/2]port default vlan 2
[SW1-Ethernet0/0/2]int eth 0/0/4
[SW1-Ethernet0/0/4]port link-type access
[SW1-Ethernet0/0/4]port default vlan 2
[SW1]int eth0/0/3
[SW1-Ethernet0/0/3]port hybrid untagged vlan 3 to 6
[SW1-Ethernet0/0/3]port hybrid pvid vlan 3
[SW1-Ethernet0/0/3]int eth0/0/5
[SW1-Ethernet0/0/5]port hybrid pvid vlan 4
[SW1-Ethernet0/0/5]port hybrid untagged vlan 1 to 4
[SW1]int eth0/0/6
[SW1-Ethernet0/0/6]port link-type trunk
[SW1-Ethernet0/0/6]port trunk allow-pass vlan 2 to 6
[SW1-Ethernet0/0/6]int eth0/0/1
[SW1-Ethernet0/0/1]port hybrid tagged vlan 2
[SW1-Ethernet0/0/1]port hybrid untagged vlan 3 to 6
[SW2]vlan batch 2 to 6
[SW2]int eth0/0/1
[SW2-Ethernet0/0/1]port hybrid pvid vlan 5
[SW2-Ethernet0/0/1]port hybrid untagged vlan 3 to 5
[SW2-Ethernet0/0/1]int eth0/0/2
[SW2-Ethernet0/0/2]port hybrid pvid vlan 6
[SW2-Ethernet0/0/2]port hybrid untagged vlan 3 6
[SW2]int eth0/0/3
[SW2-Ethernet0/0/3]port link-type trunk
[SW2-Ethernet0/0/3]port trunk allow-pass vlan 2 to 6
配置路由器
[r1]int g0/0/1
[r1-GigabitEthernet0/0/1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.2.1 24
[r1-GigabitEthernet0/0/0]int g0/0/0.1
[r1-GigabitEthernet0/0/0.1]dot1q termination vid 2
[r1-GigabitEthernet0/0/0.1]ip add 192.168.1.1 24
6.在R1上开启DHCP服务建立池塘配置
[r1]ip pool v2
[r1-ip-pool-v2]network 192.168.1.0 mask 24
[r1-ip-pool-v2]gateway-list 192.168.1.1
[r1-ip-pool-v2]q
[r1]ip pool v3-6
[r1-ip-pool-v3-6]network 192.168.2.0 mask 24
[r1-ip-pool-v3-6]gateway-list 192.168.2.1
[r1]dhcp enlab
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]dhcp select global
[r1-GigabitEthernet0/0/0]int g0/0/0.1
[r1-GigabitEthernet0/0/0.1]dhcp select global
验证