
R621#configure terminal 注:进入交换机全局配置模式 R621(config)# vlan 10 注:创建vlan 10 R621(config-vlan)# name test10 注:将Vlan 10命名为test10 R621(config)# vlan 20 注:创建vlan 20 R621(config-vlan)# name test20 注:将Vlan 20命名为test20 R621(config-if)# interface fastethernet 0/1 注:进入fastethernet 0/1的接口配置模式 R621(config-if)# encapsulation dot1q 10 R621(config-if)# interface fastethernet 0/2 R621(config-if)# encapsulation dot1q 10 R621(config-if)# interface fastethernet 0/3 注:进入fastethernet 0/1的接口配置模式 R621(config-if)# encapsulation dot1q 20 R621(config-if)# interface fastethernet 0/4 R621(config-if)# encapsulation dot1q 20 这样,两子网不互可通讯。
想希望能相互通讯,就把每个VLAN的其中一个端口设上IP地址作为该VLAN中主机的网关即可相互通讯.