华为---端口隔离简介和示例配置

目录

[1. 端口隔离概念](#1. 端口隔离概念)

[2. 端口隔离作用](#2. 端口隔离作用)

[3. 端口隔离优点](#3. 端口隔离优点)

[4. 端口隔离缺点](#4. 端口隔离缺点)

[5. 端口隔离的方法和应用场景](#5. 端口隔离的方法和应用场景)

[6. 端口隔离配置](#6. 端口隔离配置)

[6.1 端口隔离相关配置命令](#6.1 端口隔离相关配置命令)

[6.2 端口隔离配置思路](#6.2 端口隔离配置思路)

[7. 示例配置](#7. 示例配置)

[7.1 示例场景](#7.1 示例场景)

[7.2 网络拓扑图](#7.2 网络拓扑图)

[7.3 基本配置](#7.3 基本配置)

7.4端口隔离配置与验证

[7.4.1 双向隔离配置与验证](#7.4.1 双向隔离配置与验证)

[7.4.2 双向隔离配置与验证](#7.4.2 双向隔离配置与验证)


1. 端口隔离概念

端口隔离是一种网络安全技术,用于在交换机或路由器中对不同网络端口之间的流量进行隔离和控制。它通过限制不同端口之间的通信,防止未经授权的数据流进入或离开特定的网络区域。

2. 端口隔离作用

  1. **实现用户隔离:**端口隔离技术可以实现对网络进行详细隔离和控制。比如居民区网络各住户之间不能相互访问。配置端口隔离后,无论端口在哪个vlan,二层都不能相互通信。
  2. **提升网络安全性:**端口隔离可以防止未经授权的访问和攻击,将网络流量隔离,限制了攻击者对敏感数据和网络资源访问,减少攻击面,增强网络安全性。比如一个感染病毒的设备连接到一个隔离端口上,攻击者将难以访问其他网络资源。
  3. **防止网络中的数据泄露:**将不同类型的数据流隔离到不同的端口上,可以避免敏感数据与其他非敏感数据混合传输,降低数据泄露风险。比如金融机构中,可以将交易数据和客户个人信息隔离不同的网络区域中。
  4. **提高网络性能和可靠性:**端口隔离可以限制不同端口之间的流量竞争,避免网络拥塞和性能下降。

3. 端口隔离优点

为了实现报文之间的二层隔离,用户可以将不同的端口加入不同的VLAN,但这样会浪费有限的VLAN资源;使用ACL控制策略实现特定源IP地址访问目标IP地址,但这样很不灵活。

采用端口隔离功能,可以实现同一VLAN内端口之间的隔离。用户只需要将端口加入到隔离组中,就可以实现隔离组内端口之间二层数据的隔离。端口隔离功能为用户提供了更安全、更灵活的组网方案。

4. 端口隔离缺点

  1. 计算机之间共享不能实现;
  2. 隔离只能在一台交换机上实现,不能在堆叠交换机之间实现,如果是堆叠环境,只能改成交换机之间级连。

5. 端口隔离的方法和应用场景

端口隔离的方法 应用场景
配置接口单向隔离 * 接入同一个设备不同接口的多台主机,若某台主机存在安全隐患,往其他主机发送大量的广播报文,可以通过配置接口间的单向隔离来实现其他主机对该主机报文的隔离。 * 同一端口隔离组的接口之间互相隔离,不同端口隔离组的接口之间不隔离。为了实现不同端口隔离组的接口之间的隔离,可以通过配置接口之间的单向隔离来实现。
配置端口隔离组 为了实现接口之间的二层隔离,可以将不同的接口加入不同的VLAN,但这样会浪费有限的VLAN资源。采用端口隔离特性,可以实现同一VLAN内接口之间的隔离。用户只需要将接口加入到隔离组中,就可以实现隔离组内接口之间二层数据的隔离。端口隔离功能为用户提供了更安全、更灵活的组网方案。

6. 端口隔离配置

6.1 端口隔离相关配置命令

Switch-GigabitEthernet0/0/1\] port-isolate enable \[ **group** *group-id* \],使能端口隔离功能。 \[Switch-GigabitEthernet0/0/1\] am isolate { interface-type interface-number }\&\<1-8\>,配置端口单向隔离。 #### 6.2 端口隔离配置思路 **双向隔离配置思路:** 1. 基础配置(终端IP、VLAN划分等配置); 2. 配置端口加入到隔离组中,实现隔离组内接口之间二层数据的隔离。 缺省情况下,未使能端口隔离功能。 **单向隔离配置思路:** 1. 基础配置(终端IP、VLAN划分等配置); 2. 配置端口单向隔离。 缺省情况下,未配置端口单向隔离。 ### 7. 示例配置 #### 7.1 示例场景 某企业研发办公室员工分为本公司员工、A合作方公司员工和B合作方公司员工。PC4和PC5分别代表A、B合作方员工,PC2和PC3代表本公司研发员工,PC1代表本公司网管员工。公司希望在节省VLAN资源的前提下,实现本公司员工和A、B两个合作方公司之间可以相互通信,但是A、B两个合作方公司员工之间无法通信。假设PC2主机发送大量的广播报文,通过配置接口间单向隔离,实现其他主机对该主机报文的隔离。 #### 7.2 网络拓扑图 ![](https://i-blog.csdnimg.cn/direct/aeebfa439f314c11a17aaf89269456ed.png) #### 7.3 基本配置 **SW接入交换机基本配置:** system-view sysname SW vlan batch 3 10 interface GigabitEthernet 0/0/1 port link-type trunk port trunk allow-pass vlan 3 10 interface vlan 3 ip address 192.168.3.254 24 interface vlan 10 ip address 192.168.10.254 24 system-view sysname SW1 vlan batch 3 10 interface Ethernet0/0/1 port link-type trunk port trunk allow-pass vlan 3 10 interface Ethernet0/0/2 port link-type access port default vlan 3 interface Ethernet0/0/3 port link-type access port default vlan 3 interface Ethernet0/0/4 port link-type access port default vlan 3 interface Ethernet0/0/5 port link-type access port default vlan 3 interface Ethernet0/0/6 port link-type access port default vlan 10 quit interface Vlanif 10 ip address 192.168.10.253 24 \system-view \[Huawei\]sysname SW \[SW\]vlan batch 3 10 \[SW\]interface GigabitEthernet 0/0/1 \[SW-GigabitEthernet0/0/1\]port link-type trunk \[SW-GigabitEthernet0/0/1\]port trunk allow-pass vlan 3 10 \[SW-GigabitEthernet0/0/1\]interface vlan 3 \[SW-Vlanif3\]ip address 192.168.3.254 24 \[SW-Vlanif3\]interface vlan 10 \[SW-Vlanif10\]ip address 192.168.10.254 24 **SW1接入交换机基本配置:** \system-view \[Huawei\]sysname SW1 \[SW1\]vlan batch 3 10 \[SW1\]interface Ethernet0/0/1 \[SW1-Ethernet0/0/1\]port link-type trunk \[SW1-Ethernet0/0/1\]port trunk allow-pass vlan 3 10 \[SW1-Ethernet0/0/1\]interface Ethernet0/0/2 \[SW1-Ethernet0/0/2\]port link-type access \[SW1-Ethernet0/0/2\]port default vlan 3 \[SW1-Ethernet0/0/2\]interface Ethernet0/0/3 \[SW1-Ethernet0/0/3\]port link-type access \[SW1-Ethernet0/0/3\]port default vlan 3 \[SW1-Ethernet0/0/3\]interface Ethernet0/0/4 \[SW1-Ethernet0/0/4\]port link-type access \[SW1-Ethernet0/0/4\]port default vlan 3 \[SW1-Ethernet0/0/4\]interface Ethernet0/0/5 \[SW1-Ethernet0/0/5\]port link-type access \[SW1-Ethernet0/0/5\]port default vlan 3 \[SW1-Ethernet0/0/5\]interface Ethernet0/0/6 \[SW1-Ethernet0/0/6\]port link-type access \[SW1-Ethernet0/0/6\]port default vlan 10 \[SW1-Ethernet0/0/6\]quit \[SW1\]interface Vlanif 10 \[SW1-Vlanif10\]ip address 192.168.10.253 24 **PC配置:** ![](https://i-blog.csdnimg.cn/direct/dd263c2bdee2491b8a673c12668e72d3.png)![](https://i-blog.csdnimg.cn/direct/3d8663bd7f3d400ca131910003499b93.png) 其他PC与上图类似,不再赘述。 #### 7.4端口隔离配置与验证 ##### 7.4.1 双向隔离配置与验证 【1】在未连接网关设备(SW交换机)情况下(即,二层通信),实现本公司员工和A、B两个合作方公司之间可以相互通信,但是A、B两个合作方公司员工之间无法通信。 ![](https://i-blog.csdnimg.cn/direct/64e01f5852f24fc6813c78a3aa1ca549.png) **相关配置如下:** \[SW-GigabitEthernet0/0/1\] shutdown \[SW1\]interface Ethernet0/0/3 \[SW1-Ethernet0/0/3\]port-isolate enable group 3 \[SW1-Ethernet0/0/3\]interface Ethernet0/0/4 \[SW1-Ethernet0/0/4\]port-isolate enable group 3 **测试验证:** ![](https://i-blog.csdnimg.cn/direct/2d2ea8326e3948d18d916b269a98fe6e.png)![](https://i-blog.csdnimg.cn/direct/5d2db3626e0042d284e8cf357bde111d.png) A、B两个合作方公司员工之间无法通信,但和本公司员工可以正常通信。 【2】连接网关设备后,再次测试A、B两个合作方公司员工之间是否可以正常通信? \[SW-GigabitEthernet0/0/1\]undo shutdown ![](https://i-blog.csdnimg.cn/direct/28b041e5c94f4685884e3153b9366dc0.png)![](https://i-blog.csdnimg.cn/direct/b6501eddf4724eb9b7eac4949b672e8b.png) A、B两个合作方公司员工之间无法通信。 【3】假设实现本公司员工1和2之间可以相互通信,但是不能和财务进行通信。 ![](https://i-blog.csdnimg.cn/direct/a52023b41536483687cd58b3a4bd2b0a.png) 在目前配置下,PC1和PC2、PC3不在同一网段,之间是三层通信。 **相关配置如下:** \[SW1\]interface Ethernet0/0/2 \[SW1-Ethernet0/0/2\]port-isolate enable group 4 \[SW1-Ethernet0/0/2\]interface Ethernet0/0/6 \[SW1-Ethernet0/0/6\]port-isolate enable group 4 \[SW1-Ethernet0/0/6\]port-isolate enable group 5 \[SW1-Ethernet0/0/6\]interface Ethernet0/0/5 \[SW1-Ethernet0/0/5\]port-isolate enable group 5 **测试验证:** ![](https://i-blog.csdnimg.cn/direct/283c944219bc4c07b7789c7b47542b0b.png) 在此配置下,端口隔离无法隔离三层通信。 【4】设置PC1和PC2、PC3都在同一网段,看能否实现本公司员工1和2之间可以相互通信,但是不能和财务进行通信。 **相关配置如下:** ![](https://i-blog.csdnimg.cn/direct/ab059e05859b4e388ccdf343c78cb6aa.png) \[SW1\]interface eth0/0/6 \[SW1-Ethernet0/0/6\]port default vlan 3 \[SW1\]interface Ethernet0/0/2 \[SW1-Ethernet0/0/2\]port-isolate enable group 4 \[SW1-Ethernet0/0/2\]interface Ethernet0/0/6 \[SW1-Ethernet0/0/6\]port-isolate enable group 4 \[SW1-Ethernet0/0/6\]port-isolate enable group 5 \[SW1-Ethernet0/0/6\]interface Ethernet0/0/5 \[SW1-Ethernet0/0/5\]port-isolate enable group 5 **测试验证:** ![](https://i-blog.csdnimg.cn/direct/e941be8a0ab54cabad9e7dd3cc05d5fe.png)![](https://i-blog.csdnimg.cn/direct/b0670308050d48828a63b6c7ccb8828d.png) 在此配置下,端口隔离实现了二层隔离,PC21和PC3之间可以相互通信,但是不能和财务PC1进行通信。 ##### 7.4.2 双向隔离配置与验证 假设PC2主机发送大量的广播报文,通过配置接口间单向隔离,实现其他主机对该主机报文的隔离。 ![](https://i-blog.csdnimg.cn/direct/41d0ea79d09545e5943dc10ec25e1a35.png) **相关配置如下:** \[SW1-Ethernet0/0/5\]am isolate Ethernet 0/0/2 to 0/0/4 //SW1-Ethernet0/0/5到SW1-Ethernet0/0/2 to 0/0/4方向数据隔离 **测试验证:** ![](https://i-blog.csdnimg.cn/direct/5666e13aef4c4690b3023f0f3585d97d.png) PC2和不在同一隔离组的端口进行通信。 ![](https://i-blog.csdnimg.cn/direct/f65cedb2647947cc9744018dc919c3cb.png)![](https://i-blog.csdnimg.cn/direct/c898e14e61ed46d99a08e75dec6c86df.png)![](https://i-blog.csdnimg.cn/direct/6e4e474ff4d3437a9e99262177a2c22b.png)![](https://i-blog.csdnimg.cn/direct/3280c5d51099416bb8509a1f83983f4b.png)![](https://i-blog.csdnimg.cn/direct/2bbf45b696904420a8acc36ad34d7aef.png) 如上图所示,通过ping测试和抓包可以看出,PC2到PC5的数据被阻断,PC2 ping PC5发出的ARP广播被SW1-Ethernet0/0/5阻断,得不到PC5的回复;PC5 ping PC2,PC2收到了PC5的广播,但PC2的回复被SW1-Ethernet0/0/5阻断; PC2到PC3和PC4与PC2到PC5相似,不再测试验证。 **参考链接:** [https://support.huawei.com/enterprise/zh/doc/EDOC1000141427/4c8ff006](https://support.huawei.com/enterprise/zh/doc/EDOC1000141427/4c8ff006 "https://support.huawei.com/enterprise/zh/doc/EDOC1000141427/4c8ff006") [https://support.huawei.com/enterprise/zh/doc/EDOC1100203235/8fb91d07](https://support.huawei.com/enterprise/zh/doc/EDOC1100203235/8fb91d07 "https://support.huawei.com/enterprise/zh/doc/EDOC1100203235/8fb91d07") [https://support.huawei.com/enterprise/zh/doc/EDOC1100203235/8fb91d0](https://support.huawei.com/enterprise/zh/doc/EDOC1100203235/8fb91d0 "https://support.huawei.com/enterprise/zh/doc/EDOC1100203235/8fb91d0")

相关推荐
珊珊而川2 小时前
ChatPromptTemplate创建方式比较
服务器·langchain
tyn1882 小时前
记录一次conda虚拟环境pip安装报错[WinError 32] 另一个程序正在使用此文件,进程无法访问
windows·conda·pip·虚拟环境·虚环境
SuperHeroWu73 小时前
【HarmonyOS 5】鸿蒙碰一碰分享功能开发指南
华为·harmonyos·应用·分享·碰一碰
欧先生^_^3 小时前
Linux内核可配置的参数
linux·服务器·数据库
若风的雨3 小时前
【deekseek】P2P通信路由过程
服务器·网络协议·p2p
Python私教4 小时前
征服Rust:从零到独立开发的实战进阶
服务器·开发语言·rust
大神的风范5 小时前
从0开始学linux韦东山教程第三章问题小结(4)
linux·服务器
大蚂蚁2号6 小时前
windows文件共享另一台电脑资源管理器网络文件夹无法找到机器
运维·服务器·网络
lqj_本人6 小时前
鸿蒙OS&UniApp制作一个小巧的图片浏览器#三方框架 #Uniapp
华为·uni-app·harmonyos
影龙帝皖7 小时前
Linux服务之lvs集群与dr模式部署
linux·服务器·lvs