交换机间相同vlan通信

2025-11-14 04:51:58

1、要求:

1.配置好PC计算机IP和子网掩码。

2.把Fa0/1端口划分给valn10,Fa0/2端口划分给vlan20。

3.pc1能ping通pc3。

交换机间相同vlan通信

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

交换机间相同vlan通信

交换机间相同vlan通信

交换机间相同vlan通信

交换机间相同vlan通信

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)#

交换机间相同vlan通信

4、验证配置:

Switch#show vlan

查看接口加入到的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)#

交换机间相同vlan通信

6、验证配置:

Switch#show vlan

查看接口加入到的vlan

交换机间相同vlan通信

7、测试网络的连通性,在pc4上pingPC1和PC2网络是不通的。

说明跨交换机的相同VLAN的计算机无法互相通信,主要原因是没有配置Trunk。

交换机间相同vlan通信

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模式

交换机间相同vlan通信

交换机间相同vlan通信

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模式

交换机间相同vlan通信

交换机间相同vlan通信

10、验证结果:

交换机间相同vlan通信

交换机间相同vlan通信

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢