先规划VLAN,如图,PC1 3划分VLAN 2,PC2划分VLAN 3,PC4 5划分VLAN 4,PC6划分VLAN 5
在连接PC2 4 5 6的交换机接口配置混杂类,PC1 3接口为access。
PC2
[SW1-Ethernet0/0/2]port link-type hybrid
[SW1-Ethernet0/0/2]port hybrid untagged vlan 2 to 5
[SW1-Ethernet0/0/2]port hybrid pvid vlan 3
PC4
[SW2-Ethernet0/0/3]port link-type hybrid
[SW2-Ethernet0/0/3]port hybrid untagged vlan 2 to 4
[SW2-Ethernet0/0/3]port hybrid pvid vlan 4
PC5
[SW3-Ethernet0/0/2]port link-type hybrid
[SW3-Ethernet0/0/2]port hybrid untagged vlan 2 to 4
[SW3-Ethernet0/0/2]port hybrid pvid vlan 4
PC6
[SW3-Ethernet0/0/3]port link-type hybrid
[SW3-Ethernet0/0/3]port hybrid untagged vlan 2 to 3 5
[SW3-Ethernet0/0/3]port hybrid pvid vlan 5
骨干用trunk允许所有
在SW1中
[SW1-GigabitEthernet0/0/1]port hybrid untagged vlan 3 to 5
r1中
[r1]dhcp enable
[r1]ip pool 1
[r1-ip-pool-1]network 192.168.1.0 mask 255.255.255.0
[r1-ip-pool-1]gateway-list 192.168.1.254
[r1-ip-pool-1]dns-list 114.114.114.114 8.8.8.8
[r1-ip-pool-1]quit
[r1]ip pool 2
[r1-ip-pool-2]network 192.168.2.0 mask 255.255.255.0
[r1-ip-pool-2]gateway-list 192.168.2.254
[r1-ip-pool-2]dns-list 114.114.114.114 8.8.8.8
[r1-GigabitEthernet0/0/0]dhcp select global
[r1-GigabitEthernet0/0/0]interface GigabitEthernet 0/0/0.1
[r1-GigabitEthernet0/0/0.1]dhcp select global
[r1-GigabitEthernet0/0/0.1]ip address 192.168.1.254 24
[r1-GigabitEthernet0/0/0.1]interface GigabitEthernet 0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.2.254 24
[r1-GigabitEthernet0/0/0.1]dot1q termination vid 2
结果
若有错误请指出