如何使用三层交换实现不同VLAN互相访问,ENSP实验实测通过
时间:2022-12-19 06:45:19
上一节讲说到VLAN可以隔离广播域,但是我们有时需要不同的VLAN之间可以互相访问,怎么办呢?
不同网段的主机通信,必须经过三层设备的转发,可以是三层交换机、也可以是路由器、也可以是多网卡主机,除此之外绝无可能。
使用SVI实现VLAN互通的思想跟使用路由器单臂路由技术,或者纯粹用多个路由器的以太网接口直接连多个网段是一个目的,就是为了实现跨网段的数据转发。
其实本质上,SVI和单臂路由,三层交换机要到达的目的都是一样的,都是为了实现多个VLAN之间的通信。
SVI的目的就是在交换机上实现跨网段交换数据的一个技术。本质上跟单臂路由是一样的,都是通过802.1q的标签来实现不同网段的识别的。
使用三层交换机(三层交换机 = 二层交换机 + 路由器),通过SVI接口 (Software Virtual Interface)实现VLAN之间的互访。
下面通过华为ENSP实验,配置使用三层交换技术,实现VLAN 10与VLAN 20之间的通讯。
首先在SW1、SW2创建VLAN,并将相应的端口加入到VLAN中,配置好Trunk口。
SW1交换机配置
[Huawei]sysname sw1
[sw1]undo info-center enable
[sw1]interface GigabitEthernet 0/0/1
[sw1-GigabitEthernet0/0/10]port link-type access
[sw1-GigabitEthernet0/0/10]port default vlan 10
[sw1-GigabitEthernet0/0/10]q
[sw1]interface GigabitEthernet 0/0/2
[sw1-GigabitEthernet0/0/10]port link-type access
[sw1-GigabitEthernet0/0/10]port default vlan 10
[sw1-GigabitEthernet0/0/10]q
[sw1]interface GigabitEthernet 0/0/3
[sw1-GigabitEthernet0/0/10]port link-type access
[sw1-GigabitEthernet0/0/10]port default vlan 10
[sw1-GigabitEthernet0/0/10]q
[sw1]interface GigabitEthernet 0/0/24
[sw1-GigabitEthernet0/0/24]port link-type trunk ;设置主干链路;
[sw1-GigabitEthernet0/0/24]port trunk allow-pass vlan 10 20
[sw1-GigabitEthernet0/0/24]q
SW2交换机配置
[Huawei]sysname sw2
[sw2]undo info-center enable
[sw2]interface GigabitEthernet 0/0/10
[sw2-GigabitEthernet0/0/10]port link-type access
[sw2-GigabitEthernet0/0/10]port default vlan 20
[sw2-GigabitEthernet0/0/10]q
[sw2]interface GigabitEthernet 0/0/11
[sw2-GigabitEthernet0/0/10]port link-type access
[sw2-GigabitEthernet0/0/10]port default vlan 20
[sw2-GigabitEthernet0/0/10]q
[sw2]interface GigabitEthernet 0/0/24
[sw2-GigabitEthernet0/0/24]port link-type trunk ;设置主干链路;
[sw2-GigabitEthernet0/0/24]port trunk allow-pass vlan 10 20
[sw2-GigabitEthernet0/0/24]q
SW3交换机配置
[Huawei]undo info-center enable
[Huawei]sysname sw3
[sw3]vlan batch 10 20
[sw3]interface Vlanif 10
[sw3-Vlanif10]ip address 192.168.10.254 24
[sw3-Vlanif10]q
[sw3]
[sw3]interface vlan 20;创建SVI接口
[sw3-Vlanif20]ip address 192.168.20.254 24
[sw3-Vlanif20]q
[sw3]interface GigabitEthernet 0/0/1
[sw3-GigabitEthernet0/0/1]port link-type trunk
[sw3-GigabitEthernet0/0/1]port trunk allow-pass vlan 10
[sw3]interface GigabitEthernet 0/0/2
[sw3-GigabitEthernet0/0/2]port link-type trunk ;设置主干链路;
[sw3-GigabitEthernet0/0/2]port trunk allow-pass vlan 20
测试不同VLAN的联通性
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Win10重装系统失败无法开机怎么解决?
![](https://img.aspxhome.com/file/2023/26/a222760_0s.jpg)
华硕玩家国度Z170 原生多彩RGB LED插针
![](https://img.aspxhome.com/file/2023/4/a303088_0s.jpg)
PPT简约设计原则
Win10如何打开系统属性窗口有哪些方法
![](https://img.aspxhome.com/file/2023/29/a251276_0s.jpg)
对新版WPS 2019的一个用户体验 对不起,我再也不黑WPS了
![](https://img.aspxhome.com/file/2023/6/a186946_0s.jpg)
Excel分析工具库的使用视频教程
Win10系统打不开计算器calc.exe怎么办?
![](https://img.aspxhome.com/file/2023/26/a223211_0s.jpg)
WPS文字怎么设置纸张大小
excel如何将数组公式中的TRUE或FALSE转化为1或0
WPS文字中怎么绘制田字格操作方法教学
![](https://img.aspxhome.com/file/2023/6/a182596_0s.png)
如何在Mac上给Word文档加密?
![](https://img.aspxhome.com/file/2023/9/a205139_0s.jpeg)
Win10系统网上邻居所在位置介绍
![](https://img.aspxhome.com/file/2023/5/a315057_0s.jpg)
Win11系统快捷键设置在哪里 Win11系统快捷键设置详细介绍
![](https://img.aspxhome.com/file/2023/27/a236021_0s.png)
如何将多个 AirPods 连接到一台 Mac?
![](https://img.aspxhome.com/file/2023/4/a203624_0s.jpeg)
word2013打不开doc提示已被另一用户锁定该怎么办?
![](https://img.aspxhome.com/file/2023/6/28846_0s.jpg)
win10系统怎么快速打开控制面板?win10快速打开控制面板的方法?
![](https://img.aspxhome.com/file/2023/9/47259_0s.jpg)
Illustrator 教程「14」,如何在 Illustrator 中创建色板?
![](https://img.aspxhome.com/file/2023/1/a203301_0s.jpeg)
中琅条码标签打印软件怎么连接MySQL数据库?
![](https://img.aspxhome.com/file/2023/7/a330997_0s.jpg)
如何在手机wps表格中设置自动换行
新版PS如何导入旧版图像中的形状?
![](https://img.aspxhome.com/file/2023/9/a341787_0s.png)