Eth-trunk :LACP模式链路聚合实战

简介: Eth-trunk :LACP模式链路聚合实战

Eth-trunk :LACP模式链路聚合实战


需求描述


  • PC1和PC3数据vlan10 ,网段为192.168.10.0 /24
  • PC2和PC4数据vlan20 ,网段为192.168.20.0 /24
  • 确保设备之间互联互通,使用最大互联带宽并没有环路
  • 确保相同网段的PC可以互通
  • 判断交换机之间的每个端口的角色和状态

拓扑图

配置思路

  • 配置终端设备
  • 配置PC机的IP地址参数
  • 配置网络设备
  • 先初始化
  • 创建vlan
  • 将接口加入vlan并设置端口模式access
  • eth-trunk
  • 创建eth-trunk的端口
  • 设置eth-trunk模式
  • 添加接口成员
  • 设备端口trunk并允许所有vlan通过

配置命令

二层交换机配置 s3 s4 s5 s6

  • s3
1. S3交换机的初始配置
    <Huawei>u  t  m       \\关闭信息干扰
    <Huawei>system-view   \\进入系统视图
    [Huawei]sysname  S3     \\设置交换机的名字为S3
2. S3创建vlan 10 20
    [S3]vlan  batch  10  20    \\创建vlan 10  20
3. S3将e0/0/1加入vlan10 并设置链路是access链路
    [S3]int e0/0/1   [\\进入接口0/0](file:///\\\\进入接口0/0)/1
    [S3-Ethernet0/0/1]port link-type access    \\设置链路为接入链路(access链路)
    [S3-Ethernet0/0/1]port default  vlan  10   [\\将接口加入vlan10](\\\\将接口加入vlan10)
4. 创建链路聚合接口eth-trunk 1 并将设置模式为lacp、加入成员并设置链路为tunk并允许所有vlan通过
    [S3]interface  Eth-Trunk 1        \\[创建链路聚合的端口1](file:///\\\\创建链路聚合的端口1)
    [S3-Eth-Trunk1]mode lacp-static    \\设置链路为动态lacp
    [S3-Eth-Trunk1]trunkport e0/0/3    \\将接口加入到负载模式
    [S3-Eth-Trunk1]trunkport e0/0/4     [\\将接口加入到负载模式](file:///\\\\将接口加入到负载模式)
    [S3-Eth-Trunk1]port link-type trunk  \\设置为trunk链路
    [S3-Eth-Trunk1] port  trunk allow-pass vlan all  \\并允许所有vlan通过
    [S3-Eth-Trunk1]display eth-trunk 1      \\查看 eth-trunk

s4

1. S4交换机的初始配置
    <Huawei>u  t  m       \\关闭信息干扰
    <Huawei>system-view   \\进入系统视图
    [Huawei]sysname  S4     \\设置交换机的名字为S4
2. S4创建vlan 10 20
    [S4]vlan  batch  10  20    \\创建vlan 10  20
3. S4将e0/0/1加入vlan10 并设置链路是access链路
    [S4]int e0/0/1   [\\进入接口0/0](file:///\\\\进入接口0/0)/1
    [S4-Ethernet0/0/1]port link-type access    \\设置链路为接入链路(access链路)
    [S4-Ethernet0/0/1]port default  vlan  20   \\将接口加入vlan20
4. 创建链路聚合接口eth-trunk 1 并将设置模式为lacp、加入成员并设置链路为tunk并允许所有vlan通过
    [S4]interface  Eth-Trunk 2        \\[创建链路聚合的端口2](file:///\\\\创建链路聚合的端口1)
    [S4-Eth-Trunk2]mode lacp-static    \\设置链路为动态lacp
    [S4-Eth-Trunk2]trunkport e0/0/5    \\将接口加入到负载模式
    [S4-Eth-Trunk2]trunkport e0/0/6     [\\将接口加入到负载模式](file:///\\\\将接口加入到负载模式)
    [S4-Eth-Trunk2]port link-type trunk  \\设置为trunk链路
    [S4-Eth-Trunk2] port  trunk allow-pass vlan all  \\并允许所有vlan通过
    [S4-Eth-Trunk2]display eth-trunk 1      \\查看 eth-trunk

s5

1. S5交换机的初始配置
    <Huawei>u  t  m       \\关闭信息干扰
    <Huawei>system-view   \\进入系统视图
    [Huawei]sysname  S5     \\设置交换机的名字为S5
2. S5创建vlan 10 20
    [S5]vlan  batch  10  20    \\创建vlan 10  20
3. S5将e0/0/1加入vlan10 并设置链路是access链路
    [S5]int e0/0/1   [\\进入接口0/0](file:///\\\\进入接口0/0)/1
    [S5-Ethernet0/0/1]port link-type access    \\设置链路为接入链路(access链路)
    [S5-Ethernet0/0/1]port default  vlan  10   [\\将接口加入vlan10](\\\\将接口加入vlan10)
4. 创建链路聚合接口eth-trunk 1 并将设置模式为lacp、加入成员并设置链路为tunk并允许所有vlan通过
    [S5]interface  Eth-Trunk 1        \\[创建链路聚合的端口1](file:///\\\\创建链路聚合的端口1)
    [S5-Eth-Trunk1]mode lacp-static    \\设置链路为动态lacp
    [S5-Eth-Trunk1]trunkport e0/0/3    \\将接口加入到负载模式
    [S5-Eth-Trunk1]trunkport e0/0/4     [\\将接口加入到负载模式](file:///\\\\将接口加入到负载模式)
    [S5-Eth-Trunk1]port link-type trunk  \\设置为trunk链路
    [S5-Eth-Trunk1] port  trunk allow-pass vlan all  \\并允许所有vlan通过
    [S5-Eth-Trunk1]display eth-trunk 1      \\查看 eth-trunk

s6

1. S6交换机的初始配置
    <Huawei>u  t  m       \\关闭信息干扰
    <Huawei>system-view   \\进入系统视图
    [Huawei]sysname  S6     \\设置交换机的名字为S6
2. S6创建vlan 10 20
    [S6]vlan  batch  10  20    \\创建vlan 10  20
3. S6将e0/0/1加入vlan10 并设置链路是access链路
    [S6]int e0/0/1   [\\进入接口0/0](file:///\\\\进入接口0/0)/1
    [S6-Ethernet0/0/1]port link-type access    \\设置链路为接入链路(access链路)
    [S6-Ethernet0/0/1]port default  vlan  20   \\将接口加入vlan20
4. 创建链路聚合接口eth-trunk 1 并将设置模式为lacp、加入成员并设置链路为tunk并允许所有vlan通过
    [S6]interface  Eth-Trunk 2        \\[创建链路聚合的端口2](file:///\\\\创建链路聚合的端口1)
    [S6-Eth-Trunk2]mode lacp-static    \\设置链路为动态lacp
    [S6-Eth-Trunk2]trunkport e0/0/5    \\将接口加入到负载模式
    [S6-Eth-Trunk2]trunkport e0/0/6     [\\将接口加入到负载模式](file:///\\\\将接口加入到负载模式)
    [S6-Eth-Trunk2]port link-type trunk  \\设置为trunk链路
    [S6-Eth-Trunk2] port  trunk allow-pass vlan all  \\并允许所有vlan通过
    [S6-Eth-Trunk2]display eth-trunk 1      \\查看 eth-trunk

三层交换机配置 s1 s2

  • s1
 S1交换机的初始配置
  <Huawei>u  t  m    \\关闭信息干扰
  <Huawei>system-view   \\进入系统视图
  [Huawei]sysname  S1     \\设置交换机的名字为S1
S1创建vlan 10 20
  [S1]vlan  batch  10  20         \\创建vlan 10  20
3.创建链路聚合接口eth-trunk 1 、2并将设置模式为lacp、加入成员并设置链路为tunk并允许所有vlan通过
  [S1]interface  Eth-Trunk 1        \\[创建链路聚合的端口1](file:///\\\\创建链路聚合的端口1)
  [S1-Eth-Trunk1]mode lacp-static    \\设置链路为动态lacp
  [S1-Eth-Trunk1]trunkport g0/0/3    \\将接口加入到负载模式
  [S1-Eth-Trunk1]trunkport g0/0/4     [\\将接口加入到负载模式](file:///\\\\将接口加入到负载模式)
  [S1-Eth-Trunk1]port link-type trunk  \\设置为trunk链路
  [S1-Eth-Trunk1] port  trunk allow-pass vlan all  \\并允许所有vlan通过
  [S1]interface  Eth-Trunk 2        \\[创建链路聚合的端口2](file:///\\\\创建链路聚合的端口1)
  [S1-Eth-Trunk2]mode lacp-static    \\设置链路为动态lacp
  [S1-Eth-Trunk2]trunkport g0/0/5    \\将接口加入到负载模式
  [S1-Eth-Trunk2]trunkport g0/0/6     [\\将接口加入到负载模式](file:///\\\\将接口加入到负载模式)
  [S1-Eth-Trunk2]port link-type trunk  \\设置为trunk链路
  [S1-Eth-Trunk2] port  trunk allow-pass vlan all  \\并允许所有vlan通过
  [S1]interface  Eth-Trunk 3        \\[创建链路聚合的端口3](file:///\\\\创建链路聚合的端口1)
  [S1-Eth-Trunk3]mode lacp-static    \\设置链路为动态lacp
  [S1-Eth-Trunk3]trunkport g0/0/7    \\将接口加入到负载模式
  [S1-Eth-Trunk3]trunkport g0/0/8    
  [S1-Eth-Trunk3]trunkport g0/0/9    
  [S1-Eth-Trunk3]port link-type trunk  \\设置为trunk链路
  [S1-Eth-Trunk3] port  trunk allow-pass vlan all  \\并允许所有vlan通过
  [S1]display eth-trunk 1     \\查看 eth-trunk
  [S1]display eth-trunk 2     \\查看 eth-trunk
  [S1]display eth-trunk 3     \\查看 eth-trunk

[S1]display eth-trunk 1 \查看 eth-trunk

[S1]display eth-trunk 2 \查看 eth-trunk

  • s2
<Huawei>u  t  m    \\关闭信息干扰
<Huawei>system-view   \\进入系统视图
[Huawei]sysname  S2     \\设置交换机的名字为S2
S2创建vlan 10 20
[S2]vlan  batch  10  20         \\创建vlan 10  20
创建链路聚合接口eth-trunk 1 、2并将设置模式为lacp、加入成员并设置链路为tunk并允许所有vlan通过
  [S2]interface  Eth-Trunk 1        \\[创建链路聚合的端口1](file:///\\\\创建链路聚合的端口1)
  [S2-Eth-Trunk1]mode lacp-static    \\设置链路为动态lacp
  [S2-Eth-Trunk1]trunkport g0/0/3    \\将接口加入到负载模式
  [S2-Eth-Trunk1]trunkport g0/0/4     [\\将接口加入到负载模式](file:///\\\\将接口加入到负载模式)
  [S2-Eth-Trunk1]port link-type trunk  \\设置为trunk链路
  [S2-Eth-Trunk1] port  trunk allow-pass vlan all  \\并允许所有vlan通过
  [S2-Eth-Trunk1]display eth-trunk 1      \\查看 eth-trunk
  [S2]interface  Eth-Trunk2        \\[创建链路聚合的端口2](file:///\\\\创建链路聚合的端口1)
  [S2-Eth-Trunk2]mode lacp-static    \\设置链路为动态lacp
  [S2-Eth-Trunk2]trunkport g0/0/5    \\将接口加入到负载模式
  [S2-Eth-Trunk2]trunkport g0/0/6     [\\将接口加入到负载模式](file:///\\\\将接口加入到负载模式)
  [S2-Eth-Trunk2]port link-type trunk  \\设置为trunk链路
  [S2-Eth-Trunk2] port  trunk allow-pass vlan all  [\\并允许所有vlan通过](\\\\并允许所有vlan通过)
  [S2-Eth-Trunk2]display eth-trunk 2      \\查看 eth-trunk
  [S2]interface  Eth-Trunk3        \\[创建链路聚合的端口3](file:///\\\\创建链路聚合的端口1)
  [S2-Eth-Trunk3]mode lacp-static    \\设置链路为动态lacp
  [S2-Eth-Trunk3]trunkport g0/0/7    \\将接口加入到负载模式
  [S2-Eth-Trunk3]trunkport g0/0/8    
  [S1-Eth-Trunk3]trunkport g0/0/9 
  [S2-Eth-Trunk3]port link-type trunk  \\设置为trunk链路
  [S2-Eth-Trunk3] port  trunk allow-pass vlan all  \\并允许所有vlan通过
  [S2-Eth-Trunk3]display eth-trunk 3      \\查看 eth-trunk

[S2-Eth-Trunk2]display eth-trunk 2 \查看 eth-trunk

[S2-Eth-Trunk3]display eth-trunk 3 \查看 eth-trunk

设置最大 链路数,及开启抢占功能

Local:本地信息 Partner:对端信息

Svstem Prioritv:32768 系统的优先级

System ID:4clf-cc4e-5 系统的mac地址

MAX Active-linknumber:8 最大的活动链路数是8条

链路数是可以进行调整的我们可以调整为2条

Number of Up Port In Trunk:0 目前有几条

S2设置他的链路为2:
[S2]display eth-trunk 1   \\查看 eth-trunk
[S2]int  eth-trunk 1        \\进入eth-trunk1
[S2-Eth-Trunk1]max active-linknumber 2    [\\设置为2](file:///\\\\设置为2)条链路
修改sw2为主设备,默认值是32768 我们可以设置为100
[S2]lacp priority 100        \\设置默认值为100
[S2]display eth-trunk  1    \\查看 eth-trunk
配置启用抢占模式 S1  S2都需要开启
[S2]display eth-trunk 3               \\查看 eth-trunk
[S2-Eth-Trunk1]lacp preempt enable    [\\配置抢占模式](file:///\\\\配置抢占模式)
[S1]display eth-trunk 3              \\查看 eth-trunk
[S1-Eth-Trunk1]lacp preempt enable     [\\配置抢占模式](file:///\\\\配置抢占模式)

[S2]display eth-trunk \查看 eth-trunk

总结:

1、进入eth-trunk 视图
    interface eth-trunk 1 
  设置模式
    mode lacp-static
  添加链路
    trunkport g0/0/1
  设置端口模式
    port link-type trunk 
    port trunk allow-pass vlan all
  设置最大链路数
    max-active-linknumber 2 
  开启抢占模式
     lacp preempt enable 
 设置主设备的优先级
  默认值是32768 我们可以设置为100
  [S2]lacp priority 100
目录
相关文章
|
4月前
|
缓存 Linux 数据安全/隐私保护
Linux环境下如何通过手动调用drop_caches命令释放内存
总的来说,记录住“drop_caches” 命令并理解其含义,可以让你在日常使用Linux的过程中更加娴熟和自如。
848 23
|
负载均衡 监控 数据中心
IT知识百科:什么是链路聚合?
【5月更文挑战第1天】
673 1
IT知识百科:什么是链路聚合?
|
机器学习/深度学习 编解码 数据挖掘
Sentieon 应用教程 | 使用CNVscope进行CNV检测分析
CNVscope是Sentieon推出的一款基于机器学习的全基因组CNV分析检测模块。该模块主要用于检测大于5kb的拷贝数增加或缺失,方法是通过分析reads的深度信息,并结合断点检测等其他特征进行拷贝数判断。
127 1
|
SQL 缓存 关系型数据库
API 接口性能优化管理
本文探讨了国内项目中常见的接口性能问题及其优化策略。面对紧张的工期与多样的编码习惯,文章系统地分析了性能需求、确立了性能标准,并详细列举了常见的性能瓶颈,如循环调用数据库、不当的SQL编写及数据处理方式等。针对这些问题,提出了包括配置调整、代码改进、数据库优化、引入缓存机制、利用异步处理等在内的多种解决方案,并强调了可观测性工具的重要性。通过这些方法,能有效提升接口性能和用户体验。
|
容器
C++17新特性之try_emplace与insert_or_assign
由于std::map中,元素的key是唯一的,我们经常遇到这样的场景,向map中插入元素时,先检测map指定的key是否存在,不存在时才做插入操作,如果存在,直接取出来使用,或者key不存在时,做插入操作,存在时做更新操作。
256 0
|
机器学习/深度学习 人工智能 编解码
AI生成壁纸的工作原理
AI生成壁纸基于深度学习和生成对抗网络(GANs),通过生成器与判别器的对抗学习,以及条件生成对抗网络(CGANs)来创造特定风格的壁纸。技术还包括风格迁移、深度卷积生成对抗网络(DCGAN)、潜在空间扩展和自注意力机制。审美评价机制的引入确保了生成的壁纸既符合技术标准又有艺术价值。CGANs能根据用户条件生成个性化壁纸,而风格迁移技术通过多种方法实现图像风格转换。DCGAN和其他GAN变体在处理图像数据时有优势,如高质量样本生成和特征学习,但也存在图像质量、训练效率和模式崩溃等问题。通过构建审美评估模型和使用XAI技术,AI在生成壁纸时能更好地平衡技术与艺术标准。
|
Java 关系型数据库 MySQL
Eclipse中出现javax.servlet.ServletException: javax.servlet.jsp.JspTagException: ...500问题
Eclipse中出现javax.servlet.ServletException: javax.servlet.jsp.JspTagException: ...500问题
977 0
Eclipse中出现javax.servlet.ServletException: javax.servlet.jsp.JspTagException: ...500问题
|
安全 测试技术 Python
零操作,高效下载:利用Playwright和Python完成文件下载
Playwright是Microsoft开发的跨浏览器自动化测试工具,能模拟用户操作,包括文件下载。在Python中,它提供`expect_download()`来处理文件下载,无需额外工具。下载开始时触发事件,完成后可通过`download.path()`获取路径。下载相关操作包括取消、删除、获取错误信息、所属页面、文件名、URL等。示例代码展示了如何下载pytest的压缩文件,简化了web自动化测试中的文件下载场景。
|
Ubuntu 机器人 定位技术
ros_gazebo/turtlebot3 室内仿真导航,提取camera/image和pose位姿真值,并将topic 时间同步对齐,最后制作成kitti 格式的数据集。
ros_gazebo/turtlebot3 室内仿真导航,提取camera/image和pose位姿真值,并将topic 时间同步对齐,最后制作成kitti 格式的数据集。
747 0
|
容器 应用服务中间件 nginx