我们知道不同的vlan之间要相互的通行必须要借用第三层,也就是
网络层,可以路由器也可以是三层的交换机。三层拓扑图
Switch(vlan)#vlan 2 name vlan2
Switch(vlan)#vlan 3 name vlan3
Switch(vlan)#vtp dom
ain lcl
Enter configurat
ion commands, one per line. End with CNTL/Z.
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport mode trunk
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#ip routing
Switch(config)#int vlan 2
Switch(config-if)#ip address 192.168.2.1 255.255.255.0
Switch(config-if)#no shut
Switch(config)#int vlan 3
Switch(config-if)#ip address 192.168.3.1 255.255.255.0
Switch(config-if)#no shut
Switch(vlan)#vtp domain lcl
Changing VTP domain from NULL to lcl
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport mode trunk
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 3
0