配置交换机
SW1:
[SW1]vlan batch 2 to 6
[SW1]int g0/0/1
[SW1-GigabitEthernet0/0/1]port link-type access
[SW1-GigabitEthernet0/0/1]port default vlan 2
[SW1-GigabitEthernet0/0/2]port hybrid pvid vlan 3
[SW1-GigabitEthernet0/0/3]port link-type trunk
[SW1-GigabitEthernet0/0/3]port trunk allow-pass vlan 2 to 6
[SW1-GigabitEthernet0/0/4]port hybrid untagged vlan 3 to 6
[SW1-GigabitEthernet0/0/4]port hybrid tagged vlan 2
SW2:
[SW2]VLAN batch 2 TO 6
[SW2-GigabitEthernet0/0/3]port link-type trunk
[SW2-GigabitEthernet0/0/3]port trunk allow-pass vlan 2 to 6
[SW2-GigabitEthernet0/0/4]port link-type trunk
[SW2-GigabitEthernet0/0/4]port trunk allow-pass vlan 2 to 6
[SW2-GigabitEthernet0/0/1]port link-type access
[SW2-GigabitEthernet0/0/1]port default vlan 2
[SW2-GigabitEthernet0/0/2]port hybrid pvid vlan 4
[SW2-GigabitEthernet0/0/2]port hybrid untagged vlan 3 to 6
SW3:
[SW3-GigabitEthernet0/0/3]port link-type trunk
[SW3-GigabitEthernet0/0/3]port trunk allow-pass vlan 2 to 6
[SW3-GigabitEthernet0/0/1]port hybrid pvid vlan 5
[SW3-GigabitEthernet0/0/1]port hybrid untagged vlan 3 to 5
[SW3-GigabitEthernet0/0/2]port hybrid pvid vlan 6
[SW3-GigabitEthernet0/0/2]port hybrid untagged vlan 3 4 6
配置路由器
[r1]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[r1]ip pool aa
Info: It's successful to create an IP address pool.
[r1-ip-pool-aa]network 192.168.1.0 mask 24
[r1-ip-pool-aa]gateway-list 192.168.1.1
[r1-ip-pool-aa]dns-list 114.114.114.114 8.8.8.8
[r1-GigabitEthernet0/0/0]dhcp select global
[r1]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[r1]ip pool bb
Info: It's successful to create an IP address pool.
[r1-ip-pool-bb]network 192.168.2.0 mask 24
[r1-ip-pool-bb]gateway-list 192.168.2.1
[r1-ip-pool-bb]dns-list 114.114.114.114 8.8.8.8
[r1-GigabitEthernet0/0/0.1]dhcp select global
测试: