当前位置: 首页 > article >正文

交换机关于环路、接口绑定、链路聚合的相关知识

文章目录

      • 1、对交换机SW-1进行配置,仅允许Host-1通过Ethernet0/0/1接口与Host-3和Host-4通信,Host-2无法与其他主机通信。
      • 2、关闭生成树协议,验证环路造成的影响
      • 3、关闭生成树协议通过链路聚合实现两条链路正常通信并提高链路可靠性。

内容包括生成树协议解决网络环路,mac地址与接口绑定实现设备接入,通过链路聚合提高网络可靠性。

新建相关拓扑
在这里插入图片描述

1、对交换机SW-1进行配置,仅允许Host-1通过Ethernet0/0/1接口与Host-3和Host-4通信,Host-2无法与其他主机通信。

在绑定前先进行测试当前拓扑的连通性
在这里插入图片描述
查看交换机的mac表
在这里插入图片描述
重启交换机SW-1,消除mac地址表动态项。
关闭交换机SW-1指定接口的mac地址学习功能

<Huawei>sys	
<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]undo	
[Huawei]undo info	
[Huawei]undo info-center ena	
[Huawei]undo info-center enable 
Info: Information center is disabled.
[Huawei]sysnam	
[Huawei]sysname SW-1
[SW-1]inte	
[SW-1]interface Eth	
[SW-1]interface Ethernet 0/0/1
[SW-1-Ethernet0/0/1]mac-add	
[SW-1-Ethernet0/0/1]mac-address learn	
[SW-1-Ethernet0/0/1]mac-address learning disab	
[SW-1-Ethernet0/0/1]mac-address learning disable acti	
[SW-1-Ethernet0/0/1]mac-address learning disable action disca	
[SW-1-Ethernet0/0/1]mac-address learning disable action discard 
[SW-1-Ethernet0/0/1]quit
[SW-1]inte	
[SW-1]interface Eth	
[SW-1]interface Ethernet 0/0/2
[SW-1-Ethernet0/0/2]mac-address learning disable action discard
[SW-1-Ethernet0/0/2]quit
[SW-1]interface Ethernet 0/0/3
[SW-1-Ethernet0/0/3]mac-address learning disable action discard
[SW-1-Ethernet0/0/3]quit
[SW-1]interface Ethernet 0/0/4
[SW-1-Ethernet0/0/4]mac-address learning disable action discard
[SW-1-Ethernet0/0/4]quit
[SW-1]interface Ethernet 0/0/5
[SW-1-Ethernet0/0/5]mac-address learning disable action discard
[SW-1-Ethernet0/0/5]quit
[SW-1]interface Ethernet 0/0/6
[SW-1-Ethernet0/0/6]mac-address learning disable action discard
[SW-1-Ethernet0/0/6]quit
[SW-1]interface Ethernet 0/0/7
[SW-1-Ethernet0/0/7]mac-address learning disable action discard
[SW-1-Ethernet0/0/7]quit
[SW-1]interface Ethernet 0/0/8
[SW-1-Ethernet0/0/8]mac-address learning disable action discard
[SW-1-Ethernet0/0/8]quit
[SW-1]interface Ethernet 0/0/9
[SW-1-Ethernet0/0/9]mac-address learning disable action discard
[SW-1-Ethernet0/0/9]quit
[SW-1]interface Ethernet 0/0/10
[SW-1-Ethernet0/0/10]mac-address learning disable action discard
[SW-1-Ethernet0/0/10]quit
[SW-1]interface Ethernet 0/0/11
[SW-1-Ethernet0/0/11]mac-address learning disable action discard
[SW-1-Ethernet0/0/11]quit
[SW-1]interface Ethernet 0/0/12
[SW-1-Ethernet0/0/12]mac-address learning disable action discard
[SW-1-Ethernet0/0/12]quit
[SW-1]interface Ethernet 0/0/13
[SW-1-Ethernet0/0/13]mac-address learning disable action discard
[SW-1-Ethernet0/0/13]quit
[SW-1]interface Ethernet 0/0/14
[SW-1-Ethernet0/0/14]mac-address learning disable action discard
[SW-1-Ethernet0/0/14]quit
[SW-1]interface Ethernet 0/0/15
[SW-1-Ethernet0/0/15]mac-address learning disable action discard
[SW-1-Ethernet0/0/15]quit
[SW-1]interface Ethernet 0/0/16
[SW-1-Ethernet0/0/16]mac-address learning disable action discard
[SW-1-Ethernet0/0/16]quit
[SW-1]interface Ethernet 0/0/17
[SW-1-Ethernet0/0/17]mac-address learning disable action discard
[SW-1-Ethernet0/0/17]quit
[SW-1]interface Ethernet 0/0/18
[SW-1-Ethernet0/0/18]mac-address learning disable action discard
[SW-1-Ethernet0/0/18]quit
[SW-1]interface Ethernet 0/0/19
[SW-1-Ethernet0/0/19]mac-address learning disable action discard
[SW-1-Ethernet0/0/19]quit
[SW-1]interface Ethernet 0/0/20
[SW-1-Ethernet0/0/20]mac-address learning disable action discard
[SW-1-Ethernet0/0/20]quit
[SW-1]interface Ethernet 0/0/21
[SW-1-Ethernet0/0/21]mac-address learning disable action discard
[SW-1-Ethernet0/0/21]quit
[SW-1]interface Ethernet 0/0/22
[SW-1-Ethernet0/0/22]mac-address learning disable action discard
[SW-1-Ethernet0/0/22]quit
[SW-1]

测试当前网络连通性。
Host-1和Host-2都不能和Host-3和Host-4通信。
在这里插入图片描述
在这里插入图片描述
关闭交换机接口的mac地址自动学习功能后,无法自动学习主机的mac地址,对于不在mac地址表的数据包采取了丢弃的动作。

将Host-1的mac地址与Ethernet 0/0/1接口绑定。

[SW-1]mac-address static 5489-985d-731b Ethernet 0/0/1 vlan 1

在这里插入图片描述
之后就可以和Host-1主机通信了,Host-2没有进行绑定,测试不通。
在这里插入图片描述
在这里插入图片描述
当更改Host-1的接入位置时,可以发现也是测试不通的。

2、关闭生成树协议,验证环路造成的影响

相关拓扑

在这里插入图片描述

恢复SW-1初始配置,重启。要检查第一步操作的mac地址是否清除。

<SW-1>res	
<SW-1>reset sav	
<SW-1>reset saved-configuration 
Warning: The action will delete the saved configuration in the device.
The configuration will be erased to reconfigure. Continue? [Y/N]:y
Warning: Now clearing the configuration in the device.
Error: The config file does not exist.
<SW-1>reboot
Info: The system is now comparing the configuration, please wait.
Warning: All the configuration will be saved to the configuration file for the n
ext startup:, Continue?[Y/N]:y
Now saving the current configuration to the slot 0.
Save the configuration successfully.
Info: If want to reboot with saving diagnostic information, input 'N' and then e
xecute 'reboot save diagnostic-information'.
System will reboot! Continue?[Y/N]:y
<SW-1>

分别关闭SW-1和SW-2的生成树协议。

<SW-1>sys	
<SW-1>system-view 
Enter system view, return user view with Ctrl+Z.
[SW-1]st	
[SW-1]stp dis	
[SW-1]stp disable 
Warning: The global STP state will be changed. Continue? [Y/N]y
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW-1]
<Huawei>sys	
<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]undo	
[Huawei]undo info	
[Huawei]undo info-center ena	
[Huawei]undo info-center enable 
Info: Information center is disabled.
[Huawei]
[Huawei]sysna	
[Huawei]sysname SW-2
[SW-2]stp disa	
[SW-2]stp disable 
Warning: The global STP state will be changed. Continue? [Y/N]y
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW-2]

测试Host-1不能和2、3、4进行通信
在这里插入图片描述
此时接口出现了大量数据流,在SW-1交换机验证过程中会出现卡顿。
在这里插入图片描述
进行对GE 0/0/1接口抓包,出现大量ARP广播报文。
在这里插入图片描述
因此采用双链路通信时,关闭了生成树协议会造成广播包环路,导致网络瘫痪。重新开启生成树协议后等待一段时间,通信恢复正常。

3、关闭生成树协议通过链路聚合实现两条链路正常通信并提高链路可靠性。

[SW-1]interface Eth-Trunk 1
[SW-1-Eth-Trunk1]quit
[SW-1]inter	
[SW-1]interface Giga	
[SW-1]interface GigabitEthernet 0/0/1
[SW-1-GigabitEthernet0/0/1]eth-T	
[SW-1-GigabitEthernet0/0/1]eth-trunk 1
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW-1-GigabitEthernet0/0/1]quit
[SW-1]inter	
[SW-1]interface Giga	
[SW-1]interface GigabitEthernet 0/0/2
[SW-1-GigabitEthernet0/0/2]eth-t	
[SW-1-GigabitEthernet0/0/2]eth-trunk 1
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW-1-GigabitEthernet0/0/2]quit
[SW-1]quit
<SW-1>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]:
flash:/vrpcfg.zip exists, overwrite?[Y/N]:y
Now saving the current configuration to the slot 0.
Save the configuration successfully.
<SW-1>
[SW-2]interface Eth-Trunk 1
[SW-2-Eth-Trunk1]quit
[SW-2]inter	
[SW-2]interface Giga	
[SW-2]interface GigabitEthernet 0/0/1
[SW-2-GigabitEthernet0/0/1]eth	
[SW-2-GigabitEthernet0/0/1]eth-trunk 1
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW-2-GigabitEthernet0/0/1]quit
[SW-2]inter	
[SW-2]interface Giga	
[SW-2]interface GigabitEthernet 0/0/2
[SW-2-GigabitEthernet0/0/2]eth-t	
[SW-2-GigabitEthernet0/0/2]eth-trunk 1
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW-2-GigabitEthernet0/0/2]quit
[SW-2]quit
<SW-2>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]:
Now saving the current configuration to the slot 0.
Save the configuration successfully.
<SW-2>

分别关闭生成树协议。

<SW-1>sys	
<SW-1>system-view 
Enter system view, return user view with Ctrl+Z.
[SW-1]stp dis	
[SW-1]stp disable 
Warning: The global STP state will be changed. Continue? [Y/N]y
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW-1]

原理是将两个交换机的两台链路捆绑成Eth-Trunk进行通信,如果一条链路断了也可以完成通信。

测试可以通信。
在这里插入图片描述
将其中一条链路删除后测试也可以通信。
在这里插入图片描述
在这里插入图片描述


http://www.kler.cn/a/466787.html

相关文章:

  • 数据挖掘——集成学习
  • Nginx——静态资源部署(二/五)
  • 基于氢氧燃料电池的分布式三相电力系统Simulink建模与仿真
  • OpenGL材质系统和贴图纹理
  • Python 中常见的数据结构之二推导式
  • 周末总结(2024/01/04)
  • 游戏引擎学习第72天
  • [paddle] 非线性拟合问题的训练
  • React 性能优化
  • 数仓建模(二) 从关系型数据库到数据仓库的演变
  • 淘宝商品详情API返回值说明:Python爬虫代码示例
  • perf:对hutool的BeanUtil工具类做补充
  • 【51单片机零基础-chapter3:按键:独立按键|||附带常见C语句.逻辑运算符】
  • 中国科技产业化促进会深入深圳企业调研
  • gesp(C++一级)(17)洛谷:B4062:[GESP202412 一级] 温度转换
  • 在Linux系统中使用字符图案和VNC运行Qt Widgets程序
  • IDEA Plugins中搜索不到插件解决办法
  • 自动化测试常考的面试题+答案汇总(持续更新)
  • React 网络请求优化
  • CVSS漏洞评分系统曝出严重缺陷
  • 【源码+文档+调试讲解】“健康早知道”微信小程序
  • 生成对抗网络 (Generative Adversarial Network, GAN) 算法MNIST图像生成任务及CelebA图像超分辨率任务
  • 深入理解 Android 中的 ComponentInfo
  • Hive集群安装部署
  • Markdown中流程图的用法
  • 解决 HTML 表单输入框与按钮对齐问题