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

【思科】链路聚合实验配置和背景

【思科】链路聚合实验配置和背景

  • 背景
  • 链路聚合基本概念
    • 链路聚合
    • 聚合接口
  • 思科链路聚合协议
    • 01.PAgP协议
    • 02.LACP协议
  • 思科链路聚合模式
    • LACP协议模式
    • PAgP协议模式
    • ON模式
  • 实验准备
  • 配置
    • 二层链路聚合
      • LACP协议模式
        • SW1
        • SW2
        • PC1
        • PC2
        • 查看LACP聚合组建立情况
        • 查看LACP聚合端口情况
        • 查看逻辑聚合端口带宽
        • PC1和PC2互Ping
      • PAgP协议模式
        • SW1
        • SW2
        • PC1
        • PC2
        • 查看LACP聚合组建立情况
        • 查看LACP聚合端口情况
        • 查看逻辑聚合端口带宽
        • PC1和PC2互Ping
      • ON模式
        • SW1
        • SW2
        • PC1
        • PC2
        • 查看LACP聚合组建立情况
        • 查看LACP聚合端口情况
        • 查看逻辑聚合端口带宽
        • PC1和PC2互Ping
    • 三层链路聚合
      • ON模式
        • SW1
        • SW2
        • 查看LACP聚合组建立情况
        • 查看LACP聚合端口情况
        • SW1和SW2互Ping
      • LACP模式
        • SW1
        • SW2
        • SW1和SW2互Ping
      • LACP模式
        • SW1
        • SW2
        • SW1和SW2互Ping

在这里插入图片描述

背景

思科的EtherChannel技术是一种链路聚合方法,它允许将多个物理以太网链路捆绑在一起,作为一个逻辑链路来增加带宽和提高冗余性。
在这里插入图片描述

随着网络规模不断扩大,用户对骨干链路的带宽和可靠性提出越来越高的要求。在传统技术中,常用更换高速率的单板或更换支持高速率单板的设备的方式来增加带宽,但这种方案需要付出高额的费用,而且不够灵活。

EtherChannel采用链路聚合技术,可以在不进行硬件升级的条件下,通过将多个物理接口捆绑为一个逻辑接口,达到增加链路带宽的目的。在实现增大带宽目的的同时,EtherChannel采用备份链路的机制,可以有效的提高设备之间链路的可靠性。

如果只是单纯的在交换机上添加多条链路,而不启用链路聚合,那其实和一条链路没区别,因为交换机有STP进行防环操作,多条链路会被逻辑阻塞,就留下一条链路进行业务传输而已,所以就有了链路聚合技术。将多条链路逻辑成一条逻辑链路,STP也就只能看到一条逻辑链路而已。
在这里插入图片描述

链路聚合基本概念

链路聚合

链路聚合是通过将多个以太网端口捆绑在一起形成的,形成一个聚合组(Channel-Group),聚合组内的所有物理链路作为一条逻辑链路来传送数据,逻辑链路的带宽就等于所有成员链路带宽之和。多个端口汇聚成的逻辑接口称为聚合接口(Port-Channel),一个聚合组和一个聚合接口形成一条聚合链路(Etherchannel)。

聚合接口

聚合组将物理端口绑定在一个逻辑接口下,每个聚合组唯一对应一个逻辑接口,称为聚合接口(Port-Channel),每个聚合接口用一个用户自定义的聚合接口ID(Group-ID)唯一标识,这个聚合接口的ID是本地有效的。

思科链路聚合协议

01.PAgP协议

PAgP协议(Port Aggregation Protocol,端口汇聚)是思科私有的动态链路汇聚协议,通过启用PAgP协议,两端端口通过交换PAgP数据包获取对端端口参数,根据这些信息自动形成聚合链路,并指定哪些端口发送PAgP包,哪些端口只接收PAgP包。这种协议只能在思科设备上运行。

02.LACP协议

LACP(Link Aggregation Control Protocol,链路汇聚控制协议)是基于IEEE 802.3ad标准的实现链路动态汇聚与解汇聚的协议,是一种国际标准的链路汇聚协议,大部分厂商设备都兼容,公有协议。LACP协议通过LACPDU(Link Aggregation Control Protocol Data Unit,链路汇聚控制协议数据单元)与对端交互端口信息,进行协商,实现对汇聚的自动化控制。

思科链路聚合模式

思科交换机的链路聚合根据使用的协议可以分为三种工作模式LACP模式、PAgP模式和On模式。

具体这三种工作模式下共有5种不同的端口模式active、passive、auto、desirable、on。如下图

其中active和passive使用LACP协议进行工作;auto和desirable使用PAgP协议进行工作;on则是强制启用链路聚合,手工链路聚合

在这里插入图片描述

LACP协议模式

LACP协议模式是使用LACP协议进行链路协商以形成聚合链路。这种模式下有两种端口模式可选,即active和passive。

active模式下不管对端设备是否支持LACP协议,本端都会无条件启用LACP协议,这种模式下端口处于主动协商状态;而passive模式下只有检测到对端设备支持LACP协议,本端才会启用LACP协议,这种模式下端口处于被动协商状态。

所以需要一端是active模式,另一端是passive模式;或者两端都是active模式

PAgP协议模式

这种链路聚合模式使用思科私有的PAgP协议进行链路协商以形成聚合链路。这种模式系也有两种端口模式可选,即auto和desirable。

跟LACP模式下的两种端口模式相似,desirable模式下不管对端是否支持PAgP协议,本端都会启用PAgP协议,就是主动协商状态;auto模式下只有检测到对端设备支持PAgP协议,本端才会启用LACP协议也就是被动协商状态。

所以需要一端是desirable模式,另一端是auto模式;或者两端都是desirable模式

ON模式

ON模式:静态持久性模式
使用On模式不经过协商(不使用任何链路聚合协议),直接进行强制链路聚合,只要两端端口二层配置一致(端口速率和所属VLAN一致),就可以直接将端口加入聚合接口,建立聚合链路。

这种情况下,链路另一端聚合链路也必须使用On模式,否则会发生数据丢包。这种模式在两端设备都不支持PAgP协议或LACP协议的情况下使用,兼容性强,配置起来也比较方便,在实际中用的也比较多。

实验准备

实验环境:EVE-Community
实验设备镜像
路由器:
i86bi LinuxL3-AdvEnterpriseK9-M2 157 3 May 2018.bin
交换机:

i86bi linuxl2-adventerprisek9-ms.SSA.high iron 20190423.bin
PC:用路由器来模拟
6bi LinuxL3-AdvEnterpriseK9-M2 157 3 May 2018.bin

实验目的
让交换机实现链路聚合,提高带宽

配置

二层链路聚合

在这里插入图片描述

LACP协议模式

SW1
Switch>enable
Switch#conf t
Switch(config)#hostname SW1## 进入需要聚合的接口,先设置为Trunk模式
SW1(config)#int range e0/0-2
SW1(config-if-range)#switchport trunk encapsulation dot1q 
SW1(config-if-range)#switchport mode trunk ## 创建聚合组“1”,用LACP的active模式
## 思科会自动建一个聚合接口“1”,ID和聚合组一致
SW1(config-if-range)#channel-group 1 mode active 
Creating a port-channel interface Port-channel 1
SW1(config-if-range)#exit## access端口(连接PC)
SW1(config)#vlan 10
SW1(config-vlan)#exitSW1(config)#int e0/3
SW1(config-if)#switchport mode access 
SW1(config-if)#switchport access vlan 10
SW1(config-if)#exit
SW2
Switch>enable 
Switch#conf t
Switch(config)#hostname SW2SW2(config)#int range e0/0-2
SW2(config-if-range)#switchport trunk encapsulation dot1q
SW2(config-if-range)#switchport mode trunk 
SW2(config-if-range)#channel-group 1 mode passive 
Creating a port-channel interface Port-channel 1
SW2(config-if-range)#exitSW2(config)#vlan 10
SW2(config-vlan)#exitSW2(config)#int e0/3
SW2(config-if)#switchport mode access 
SW2(config-if)#switchport access vlan 10
SW2(config-if)#exit
PC1

Router>enable 
Router#conf t
Router(config)#hostname PC1## 关闭路由功能,把它变成PC使用
PC1(config)#no ip routing## 进入端口,配置IP地址
PC1(config)#int e0/0       
PC1(config-if)#no shutdown 
PC1(config-if)#ip address 192.168.10.1 255.255.255.0
PC1(config-if)#exit## 保存配置
PC1(config)#do write 
Building configuration...
[OK]
PC2
Router>enable
Router#conf t
Router(config)#hostname PC2## 关闭路由功能,把它变成PC使用
PC2(config)#no ip routing## 进入端口,配置IP地址
PC2(config)#int e0/0
PC2(config-if)#no shutdown 
PC2(config-if)#ip address 192.168.10.2 255.255.255.0
PC2(config-if)#exit## 保存配置
PC2(config)#do write 
Building configuration...
[OK]
查看LACP聚合组建立情况

SW1#show etherchannel summary

可以看到聚合组“1”的成员有e0/0、e0/1、e0/2
聚合组“1”它的聚合端口状态是正在使用二层接口

在这里插入图片描述

查看LACP聚合端口情况

SW1#show ip int brief
在这里插入图片描述

查看逻辑聚合端口带宽

在这里插入图片描述

PC1和PC2互Ping

在这里插入图片描述

PAgP协议模式

SW1
Switch>enable
Switch#conf t
Switch(config)#hostname SW1## 进入需要聚合的接口,先设置为Trunk模式
SW1(config)#int range e0/0-2
SW1(config-if-range)#switchport trunk encapsulation dot1q 
SW1(config-if-range)#switchport mode trunk ## 创建聚合组“1”,用PAgP的desirable 模式
## 思科会自动建一个聚合接口“1”,ID和聚合组一致
SW1(config-if-range)#channel-group 1 mode desirable 
Creating a port-channel interface Port-channel 1
SW1(config-if-range)#exit## access端口(连接PC)
SW1(config)#vlan 10
SW1(config-vlan)#exitSW1(config)#int e0/3
SW1(config-if)#switchport mode access 
SW1(config-if)#switchport access vlan 10
SW1(config-if)#exit
SW2
Switch>enable 
Switch#conf t
Switch(config)#hostname SW2SW2(config)#int range e0/0-2
SW2(config-if-range)#switchport trunk encapsulation dot1q 
SW2(config-if-range)#switchport mode trunk 
SW2(config-if-range)#channel-group 1 mode auto 
Creating a port-channel interface Port-channel 1
SW2(config-if-range)#exitSW2(config)#vlan 10
SW2(config-vlan)#exitSW2(config)#int e0/3
SW2(config-if)#switchport mode access 
SW2(config-if)#switchport access vlan 10
SW2(config-if)#exit
PC1

Router>enable 
Router#conf t
Router(config)#hostname PC1## 关闭路由功能,把它变成PC使用
PC1(config)#no ip routing## 进入端口,配置IP地址
PC1(config)#int e0/0       
PC1(config-if)#no shutdown 
PC1(config-if)#ip address 192.168.10.1 255.255.255.0
PC1(config-if)#exit## 保存配置
PC1(config)#do write 
Building configuration...
[OK]
PC2
Router>enable
Router#conf t
Router(config)#hostname PC2## 关闭路由功能,把它变成PC使用
PC2(config)#no ip routing## 进入端口,配置IP地址
PC2(config)#int e0/0
PC2(config-if)#no shutdown 
PC2(config-if)#ip address 192.168.10.2 255.255.255.0
PC2(config-if)#exit## 保存配置
PC2(config)#do write 
Building configuration...
[OK]
查看LACP聚合组建立情况

SW1#show etherchannel summary

可以看到聚合组“1”的成员有e0/0、e0/1、e0/2
聚合组“1”它的聚合端口状态是正在使用二层接口

在这里插入图片描述

查看LACP聚合端口情况

SW1#show ip int brief
在这里插入图片描述

查看逻辑聚合端口带宽

在这里插入图片描述

PC1和PC2互Ping

在这里插入图片描述

ON模式

SW1

Switch>enable
Switch#conf t
Switch(config)#hostname SW1## 进入需要聚合的接口,先设置为Trunk模式
SW1(config)#int range e0/0-2
SW1(config-if-range)#switchport trunk encapsulation dot1q 
SW1(config-if-range)#switchport mode trunk ## 创建聚合组“1”,用PAgP的desirable 模式
## 思科会自动建一个聚合接口“1”,ID和聚合组一致
SW1(config-if-range)#channel-group 1 mode on
Creating a port-channel interface Port-channel 1
SW1(config-if-range)#exit## access端口(连接PC)
SW1(config)#vlan 10
SW1(config-vlan)#exitSW1(config)#int e0/3
SW1(config-if)#switchport mode access 
SW1(config-if)#switchport access vlan 10
SW1(config-if)#exit
SW2

Switch>enable 
Switch#conf t
Switch(config)#hostname SW2SW2(config)#int range e0/0-2
SW2(config-if-range)#switchport trunk encapsulation dot1q 
SW2(config-if-range)#switchport mode trunk 
SW1(config-if-range)#channel-group 1 mode on
Creating a port-channel interface Port-channel 1
SW2(config-if-range)#exitSW2(config)#vlan 10
SW2(config-vlan)#exitSW2(config)#int e0/3
SW2(config-if)#switchport mode access 
SW2(config-if)#switchport access vlan 10
SW2(config-if)#exit
PC1

Router>enable 
Router#conf t
Router(config)#hostname PC1## 关闭路由功能,把它变成PC使用
PC1(config)#no ip routing## 进入端口,配置IP地址
PC1(config)#int e0/0       
PC1(config-if)#no shutdown 
PC1(config-if)#ip address 192.168.10.1 255.255.255.0
PC1(config-if)#exit## 保存配置
PC1(config)#do write 
Building configuration...
[OK]
PC2
Router>enable
Router#conf t
Router(config)#hostname PC2## 关闭路由功能,把它变成PC使用
PC2(config)#no ip routing## 进入端口,配置IP地址
PC2(config)#int e0/0
PC2(config-if)#no shutdown 
PC2(config-if)#ip address 192.168.10.2 255.255.255.0
PC2(config-if)#exit## 保存配置
PC2(config)#do write 
Building configuration...
[OK]
查看LACP聚合组建立情况

SW1#show etherchannel summary

可以看到聚合组“1”的成员有e0/0、e0/1、e0/2
聚合组“1”它的聚合端口状态是正在使用二层接口

在这里插入图片描述

查看LACP聚合端口情况

SW1#show ip int brief
在这里插入图片描述

查看逻辑聚合端口带宽

在这里插入图片描述

PC1和PC2互Ping

在这里插入图片描述

三层链路聚合

在这里插入图片描述

ON模式

SW1

Switch>enable
Switch#conf t
Switch(config)#hostname SW1## 进入需要聚合的接口,需要关闭交换功能
SW1(config)#int range e0/0-2
SW1(config-if-range)#no switchport ## 创建聚合组“10”,用ON聚合模式
## 思科会自动建一个聚合接口“10”,ID和聚合组一致
SW1(config-if-range)#channel-group 10 mode on
Creating a port-channel interface Port-channel 10
SW1(config-if-range)#exit## 进入聚合接口“10”去配置地址
SW1(config)#int port-channel 10
SW1(config-if)#ip address 192.168.100.100 255.255.255.0
SW1(config-if)#exit
SW2

Switch>enable 
Switch#conf t
Switch(config)#hostname SW2SW2(config)#int range e0/0-2
SW2(config-if-range)#no switchport 
SW1(config-if-range)#channel-group 10 mode on
Creating a port-channel interface Port-channel 10
SW2(config-if-range)#exitSW2(config)#int port-channel 10
SW2(config-if)#ip address 192.168.100.200 255.255.255.0
SW2(config-if)#exit
查看LACP聚合组建立情况

SW1#show etherchannel summary

这边是RU,那就是正在使用的三层接口,说明配置成功了

在这里插入图片描述

查看LACP聚合端口情况

SW1#show ip int brief
在这里插入图片描述

SW1和SW2互Ping

在这里插入图片描述

LACP模式

SW1

Switch>enable
Switch#conf t
Switch(config)#hostname SW1## 进入需要聚合的接口,需要关闭交换功能
SW1(config)#int range e0/0-2
SW1(config-if-range)#no switchport ## 创建聚合组“10”,用ON聚合模式
## 思科会自动建一个聚合接口“10”,ID和聚合组一致
SW1(config-if-range)#channel-group 10 mode active
Creating a port-channel interface Port-channel 10
SW1(config-if-range)#exit## 进入聚合接口“10”去配置地址
SW1(config)#int port-channel 10
SW1(config-if)#ip address 192.168.100.100 255.255.255.0
SW1(config-if)#exit
SW2

Switch>enable 
Switch#conf t
Switch(config)#hostname SW2SW2(config)#int range e0/0-2
SW2(config-if-range)#no switchport 
SW1(config-if-range)#channel-group 10 mode active
Creating a port-channel interface Port-channel 10
SW2(config-if-range)#exitSW2(config)#int port-channel 10
SW2(config-if)#ip address 192.168.100.200 255.255.255.0
SW2(config-if)#exit
SW1和SW2互Ping

在这里插入图片描述

LACP模式

SW1

Switch>enable
Switch#conf t
Switch(config)#hostname SW1## 进入需要聚合的接口,需要关闭交换功能
SW1(config)#int range e0/0-2
SW1(config-if-range)#no switchport ## 创建聚合组“10”,用ON聚合模式
## 思科会自动建一个聚合接口“10”,ID和聚合组一致
SW1(config-if-range)#channel-group 10 mode desirable
Creating a port-channel interface Port-channel 10
SW1(config-if-range)#exit## 进入聚合接口“10”去配置地址
SW1(config)#int port-channel 10
SW1(config-if)#ip address 192.168.100.100 255.255.255.0
SW1(config-if)#exit
SW2

Switch>enable 
Switch#conf t
Switch(config)#hostname SW2SW2(config)#int range e0/0-2
SW2(config-if-range)#no switchport 
SW1(config-if-range)#channel-group 10 mode desirable
Creating a port-channel interface Port-channel 10
SW2(config-if-range)#exitSW2(config)#int port-channel 10
SW2(config-if)#ip address 192.168.100.200 255.255.255.0
SW2(config-if)#exit
SW1和SW2互Ping

在这里插入图片描述

相关文章:

  • 北京网站建设多少钱?
  • 辽宁网页制作哪家好_网站建设
  • 高端品牌网站建设_汉中网站制作
  • 自动化产线 搭配数据采集监控平台 创新与突破
  • mysql 安装配置 next 按钮为什么置灰点击不了
  • 3D 渲染一个房屋需要多长时间?
  • chatglm2-6b-prompt尝试
  • SwiftUI 6.0(Xcode 16)新 PreviewModifier 协议让预览调试如虎添翼
  • 路网双线合并单线——ArcGIS 解决方法
  • 全国区块链职业技能大赛国赛考题区块链产品需求分析与方案设计
  • CSS 计数器:WebKit 的样式增强术
  • Java8-21新特性
  • HarmonyOS应用开发者高级认证,Next版本发布后最新题库 - 单选题序号3
  • modbus slave 设备通过 网关thingsboard-gateway 将数据上传到thingsboard云平台
  • 基于ListBox制作一个好看的侧边菜单导航栏
  • 【Agent】信息提取场景
  • 深入理解Android中的缓存与文件存储目录
  • IDEA的工程与模块管理
  • 【Redis学习笔记】2018-06-28 redis命令源码学习1
  • ➹使用webpack配置多页面应用(MPA)
  • 2018一半小结一波
  • 345-反转字符串中的元音字母
  • CentOS7 安装JDK
  • codis proxy处理流程
  • C语言笔记(第一章:C语言编程)
  • gcc介绍及安装
  • js学习笔记
  • leetcode378. Kth Smallest Element in a Sorted Matrix
  • mysql innodb 索引使用指南
  • MYSQL 的 IF 函数
  • REST架构的思考
  • 安卓应用性能调试和优化经验分享
  • 动态规划入门(以爬楼梯为例)
  • 面试总结JavaScript篇
  • 爬虫模拟登陆 SegmentFault
  • 首页查询功能的一次实现过程
  • 新书推荐|Windows黑客编程技术详解
  • 延迟脚本的方式
  • 一个完整Java Web项目背后的密码
  • 用Node EJS写一个爬虫脚本每天定时给心爱的她发一封暖心邮件
  • 回归生活:清理微信公众号
  • 摩拜创始人胡玮炜也彻底离开了,共享单车行业还有未来吗? ...
  • ​业务双活的数据切换思路设计(下)
  • # Python csv、xlsx、json、二进制(MP3) 文件读写基本使用
  • # 数仓建模:如何构建主题宽表模型?
  • #100天计划# 2013年9月29日
  • #HarmonyOS:软件安装window和mac预览Hello World
  • #if等命令的学习
  • #控制台大学课堂点名问题_课堂随机点名
  • #数据结构 笔记三
  • #我与Java虚拟机的故事#连载05:Java虚拟机的修炼之道
  • (1)虚拟机的安装与使用,linux系统安装
  • (day6) 319. 灯泡开关
  • (ISPRS,2023)深度语义-视觉对齐用于zero-shot遥感图像场景分类
  • (二十三)Flask之高频面试点
  • (附源码)计算机毕业设计SSM保险客户管理系统
  • (四)汇编语言——简单程序
  • (学习日记)2024.04.04:UCOSIII第三十二节:计数信号量实验