实验描述:
Switch 1(2950) 划分两个Vlan,分别连PC1和PC2,通过Router1(2621)要使两台PC相通.
步骤:
Router1:
Router>en
Router#conf t
Router(config)#interface fa 0/0
Router(config-if)#no shutdown
Router(config-if)#interface fa 0/0.1
Router(config-subif)#ip add 192.168.0.1 255.255.255.0
Router(config-subif)#encapsulation dot1q 1
Router(config-subif)#inter fa 0/0.2
Router(config-subif)#ip add 192.168.1.1 255.255.255.0
Router(config-subif)#encapsulation dot1q 2
Switch 1:
Switch>en
Switch#vlan data
Switch(vlan)#vlan 2 name v2
Switch(vlan)#end
Switch#conf t
Switch(config)#interface fastethernet 0/1
Switch(config-if)#switchport mode trunk
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#no shutdown
Switch(config-if)#inter range fa 0/6 – 12
Switch(config-if)#switchport access vlan 2
PC1
Ip: 192.168.0.2/24 dg:192.168.0.1
PC2
Ip: 192.168.1.2/24 dg:192.168.1.1