交换机间相同vlan通信
1、要求:
1.配置好PC计算机IP和子网掩码。
2.把Fa0/1端口划分给valn10,Fa0/2端口划分给vlan20。
3.pc1能ping通pc3。

2、配置好PC计算机IP和子网掩码。




3、把Fa0/1端口划分给valn10,Fa0/2端口划分给vlan20。
Switch-A(左)
Switch>enab 进入特权模式
Switch#conf t 进入全局模式
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 10 创建vlan10
Switch(config-vlan)#exit 返回上一级
Switch(config)#vlan 20 创建vlan20
Switch(config-vlan)#exit
Switch(config)#int f0/1 进入f0/1端口
Switch(config-if)#swit acc vlan 10 把f0/1端口加入vlan10
Switch(config-if)#exit
Switch(config)#int f0/2 进入f0/2端口
Switch(config-if)#switchport acc vlan 20 把f0/2端口加入vlan20
Switch(config-if)#

4、验证配置:
Switch#show vlan
查看接口加入到的vlan

5、Switch-B(右)
Switch>enab 进入特权模式
Switch#conf t 进入全局模式
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 10 创建vlan10
Switch(config-vlan)#exit 返回上一级
Switch(config)#vlan 20 创建vlan20
Switch(config-vlan)#exit
Switch(config)#int f0/1 进入f0/1端口
Switch(config-if)#swit acc vlan 10 把f0/1端口加入vlan10
Switch(config-if)#exit
Switch(config)#int f0/2 进入f0/2端口
Switch(config-if)#switchport acc vlan 20 把f0/2端口加入vlan20
Switch(config-if)#

6、验证配置:
Switch#show vlan
查看接口加入到的vlan

7、测试网络的连通性,在pc4上pingPC1和PC2网络是不通的。
说明跨交换机的相同VLAN的计算机无法互相通信,主要原因是没有配置Trunk。

8、pc1能ping通pc3。
Switch-A(左)
Switch>enab
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#int g0/1
Switch(config-if)#swit mode trunk 把g0/1端口设置为:trunk模式


9、Switch-B(右)
Switch>enab
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#int g0/1
Switch(config-if)#swit mode trunk 把g0/1端口设置为:trunk模式


10、验证结果:

