实验工具 cisco packet tracer 5.3


Sw1:
 
En
Conf t
Int fa0/1
Swi mo acc
Int fa0/12
Swi mo tr
Vlan 2
Int fa0/13
Swi mo acc
Swi acc vlan 2
 
 
R1:
En
Conf t
Int f0/0
No shut
Ex
Int fa 0/0.1
Enc dot 1
Ip add 192.168.1.254 255.255.255.0
Int fa 0/0.2
Enc dot 2
Ip add 192.168.2.254 255.255.255.0
 
测试pc1 ping 192.168.2.1 ping
由于fa0/12默认属于vlan1,不知将fa0/12native vlan划到vlan2还是否能通
Int fa0/12
Swi tr native vlan 2
 
测试pc1 ping 192.168.2.1 不通
难道与单臂路由连接的端口应该属于vlan1才能起作用,继续测试将sw1fa0/1R1fa0/0.1都划到vlan3试试
先将fa0/12native vlan改回vlan1
sw1(config-if)#int fa0/12
sw1(config-if)#switchport trunk native vlan 1
 
Sw1
sw1(config)#vlan 3
sw1(config)#int fa 0/1
sw1(config-if)#swi mo acc
sw1(config-if)#swi acc vlan 3
R1:
R1(config)#int fa0/0.1
R1(config-subif)#enc dot 3
 
再测试pc1pc2ping
 
再更改先将fa0/12native vlan改回vlan2
sw1(config-if)#int fa0/12
sw1(config-if)#switchport trunk native vlan 2
 
测试pc1不能pingpc2
说明单臂路由中与路由连接的交换机端口的本地vlan应该使用默认设置划到vlan1
 
 
交换机的网管ip(每个vlan可以配置一个)
 
再更改先将fa0/12native vlan改回vlan1
sw1(config-if)#int fa0/12
sw1(config-if)#switchport trunk native vlan 1
 
配置vlan3网管ip
sw1(config)#int vlan 3
sw1(config-if)#ip add 192.168.1.100 255.255.255.0
 
测试pc1ping192.168.1.100
 
配置vlan2网管ip
sw1(config)#int vlan 2
sw1(config-if)#ip add 192.168.2.100 255.255.255.0
 
测试pc2ping192.168.2.100,也能ping192. 168.1.100
Pc1Ping192.168.2.100
 
尝试将将fa0/12native vlan改为vlan2
sw1(config-if)#int fa0/12
sw1(config-if)#switchport trunk native vlan 2
测试vlan2的网管ip 192.168.2.100能被pc1pc2 ping通,而vlan3的网管ip192.168.1.100只能被pc1 ping通,不能被pc2 ping