目录
一、新建拓扑
二、配置LSW5
三、配置LSW6
一、新建拓扑
![](https://img-blog.csdnimg.cn/01e4897baa24408f98790e239c09aa56.png)
实现效果:PC10可以ping通PC12,ping不通PC11、PC13
二、配置LSW5
1)系统视图开启VLAN100
![](https://img-blog.csdnimg.cn/7319c733c9c744869837dcf9e40a47d1.png)
2)进入接口G0/0/1配置VLAN
access模式:默认只允许通过一个VLAN标签
trunk模式:可以允许多个VLAN标签通过
interface g0/0/1 #进入接口
port link-type access #设置access接口模式
port default vlan 100 #设置VLAN 100
![](https://img-blog.csdnimg.cn/b8c63ef1dae54899b9e9259c734d251c.png)
3)进入接口G0/0/2配置VLAN
vlan 200 #开启vlan200
interface g0/0/2 #进入接口
port link-type access #设置access接口模式
port default vlan 200 #设置VLAN 200
![](https://img-blog.csdnimg.cn/b0e10a60c8d54c0b8d929e5d0539c8f4.png)
4)进入接口G0/0/3配置VLAN
int g0/0/3 #进入接口
port link-type trunk #设置trunk模式
port trunk allow-pass vlan 100 200 #将vlan100 200 同时加入接口
![](https://img-blog.csdnimg.cn/61bace68f0da41c8a94b608a5d2ac9b4.png)
三、配置LSW6
注:交换机互联的端口模式必须一样。【即LSW5的G0/0/3和LSW6的G0/0/3的接口模式必须一样】
1)进入接口G0/0/3配置VLAN
int g0/0/3 #进入接口
port link-type trunk #设置trunk模式
port trunk allow-pass vlan 100 200 #将vlan100 200 同时加入接口
![](https://img-blog.csdnimg.cn/1c2416f37b554e838689b975a982fd11.png)
2)进入接口G0/0/2配置VLAN
interface g0/0/2 #进入接口
port link-type access #设置access接口模式
port default vlan 200 #设置VLAN 200
![](https://img-blog.csdnimg.cn/f3d2624cb85447f380ddef60a17336e1.png)
3)进入接口G0/0/1配置VLAN
interface g0/0/1 #进入接口
port link-type access #设置access接口模式
port default vlan 100 #设置VLAN 100
![](https://img-blog.csdnimg.cn/9942887a2eda48dbbc33f7c94f45127b.png)
最终实现效果
![](https://img-blog.csdnimg.cn/54b1f51654e54950aca079ec10d33614.png)