题目:
交换机上接口配置:
SW1
[SW1]vlan batch 2 to 6
[SW1]port-group group-member Ethernet 0/0/2 Ethernet 0/0/4
[SW1-port-group]port link-type access
[SW1-port-group]port default vlan 2
[SW1]int e 0/0/3
[SW1-Ethernet0/0/3]port hybrid pvid vlan 3
[SW1-Ethernet0/0/3]port hybrid untagged vlan 3 to 6
[SW1]int e 0/0/5
[SW1-Ethernet0/0/5]port hybrid pvid vlan 4
[SW1-Ethernet0/0/5]port hybrid untagged vlan 3 to 4
[SW1]int e 0/0/6
[SW1-Ethernet0/0/6]port link-type trunk
[SW1-Ethernet0/0/6]port trunk allow-pass vlan 2 to 6
[SW1]int e 0/0/1
[SW1-Ethernet0/0/1]port hybrid tagged vlan 2
[SW1-Ethernet0/0/1]port hybrid untagged vlan 3 to 6
SW2
[SW2]vlan batch 2 to 6
[SW2]int e 0/0/2
[SW2-Ethernet0/0/2]port hybrid pvid vlan 5
[SW2-Ethernet0/0/2]port hybrid untagged vlan 3 5
[SW2-Ethernet0/0/2]int e 0/0/3
[SW2-Ethernet0/0/3]port hybrid pvid vlan 6
[SW2-Ethernet0/0/3]port hybrid untagged vlan 3 6
[SW2]int e 0/0/1
[SW2-Ethernet0/0/1]port link-type trunk
[SW2-Ethernet0/0/1]port trunk allow-pass vlan 2 to 6
网段192.168.1.0DHCP
地址池配置:
ip pool v2
gateway-list 192.168.1.1
network 192.168.1.0 mask 255.255.255.0interface GigabitEthernet0/0/1.1
dot1q termination vid 2
ip address 192.168.1.1 255.255.255.0
arp broadcast enable
dhcp select global
网段192.168.2.0DHCP
地址池配置:
ip pool vvv
gateway-list 192.168.2.1
network 192.168.2.0 mask 255.255.255.0interface GigabitEthernet0/0/1
ip address 192.168.2.1 255.255.255.0
dhcp select global
结果:
PC1
pc2
PC3
PC4
PC5
PC6
ping
pc1
pc2
pc4
pc5