1.实验要求:
2.拓扑搭建:
3.配置
3.1交换机配置:
sysname SW1
#
vlan batch 2 to 6
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 2
#
interface GigabitEthernet0/0/2
port hybrid pvid vlan 3
port hybrid untagged vlan 2 to 6
#
interface GigabitEthernet0/0/23
port link-type trunk
port trunk allow-pass vlan 2 to 6
sysname SW2
#
vlan batch 2 to 6
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 2
#
interface GigabitEthernet0/0/2
port hybrid pvid vlan 4
port hybrid untagged vlan 2 to 5
#
interface GigabitEthernet0/0/23
port link-type trunk
port trunk allow-pass vlan 2 to 6
#
interface GigabitEthernet0/0/24
port hybrid tagged vlan 2 to 6
sysname SW3
#
vlan batch 2 to 6
#
interface GigabitEthernet0/0/1
port hybrid pvid vlan 5
port hybrid untagged vlan 2 to 5
#
interface GigabitEthernet0/0/2
port hybrid pvid vlan 6
port hybrid untagged vlan 2 to 3 6
#
interface GigabitEthernet0/0/23
port hybrid tagged vlan 2 to 6
3.2路由部分的配置
sysname R1
#
interface GigabitEthernet0/0/0
ip address 192.168.1.1 255.255.255.0
dhcp select interface
#
interface GigabitEthernet0/0/0.1
dot1q termination vid 2
ip address 192.168.2.1 255.255.255.0
arp broadcast enable
dhcp select interface
SW1:
interface GigabitEthernet0/0/24
port hybrid tagged vlan 2 VLAN 2 打标记
port hybrid untagged vlan 3 to 6 VLAN 3to6 剥离标记
4.测试
由上图可知我们已经达到实验要求!
总结:次实验中和路由器连接的那个接口还只能用hybrid接口来完成,本实验中的要求是PC1/3是一个网段,PC2/4/5/6是一个网段,本实验用的hybrid特性实现物理的隔离,还有一条查看命令:display port vlan active 此命令用来查看VLAN中包含的接口信息