实验描述:
在switch1上划分2个Vlan,PC1和PC2分别属于Vlan1和Vlan2.同样在switch2上划分2个Vlan,PC3和PC4分别属于Vlan1和Vlan2.两个交换机相连,封装TRUNK,使pc1和pc3能通信, pc2和pc4能通信.
步骤:
Switch1:
Switch>en
Switch#vlan database
Switch(vlan)#vlan 2 name v2
Switch(vlan)#end
Switch#conf t
Switch(config)#inter fa 0/1
Switch(config-if)#switchport mode trunk
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#no shut
Switch(config-if)#inter range fa 0/7 – 12
Switch(config-if)#switchport access vlan 2
Switch2:
Switch>en
Switch#vlan database
Switch(vlan)#vlan 2 name v2
Switch(vlan)#end
Switch#conf t
Switch(config)#inter fa 0/1
Switch(config-if)#switchport mode trunk
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#no shut
Switch(config-if)#inter range fa 0/7 – 12
Switch(config-if)#switchport access vlan 2
PC1
Ip: 192.168.0.1/24
PC2
Ip: 192.168.0.2/24
PC3
Ip: 192.168.0.3/24
PC4
Ip: 192.168.0.4/24