链路聚合的定义和不同层交换机的区别

本文介绍了链路聚合的概念,包括其作为提高带宽和提供冗余的端口绑定技术。详细阐述了实现链路聚合的条件,如成员接口限制、接口类型等,并分别讨论了二层和三层交换机在链路聚合中的应用和区别,强调了二层不带IP地址功能,三层则具备该功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一.定义

二.实现条件

 

一.定义

端口绑定技术:链路聚合(Link Aggregation)是将一组物理接口绑在一起作为一个逻辑接口来增加带宽的一种方法,又称为多接口负载均衡组(Load Sharing Group)或链路聚合组(Link Aggregation Group),通过在两台设备之间建立链路聚合组,可以提供更高的通讯带宽和更高可靠性。链路聚合不仅为设备间通信提供了冗余保护,而且不需要对硬件进行升级。

二.实现条件

链路聚合/端口聚合/端口绑定实现的条件:(必须为百兆以上交换机)

1.每个Eth-Trunk接口下最多可以包含8个成员接口

2.成员接口不能配置任何业务和静态MAC地址

3.成员接口加入Eth-Trunk时,必须为缺省的hybrid类型接口

4.Eth-Trunk接口不能嵌套,即成员接口不能是Eth-Trunk

5.一个以太网接口只能加入到一个Eth-Trunk接口,如果需要加入其他Eth-Trunk接口,必须先退出原来的Eth-Trunk接口

6.一个Eth-Trunk接口中的成员必须是同一类型,例如:FE(百兆)口和GE(千兆)口不能加入同一个Eth-Trunk接口

7.可以将不同接口板上的以太网接口加入到同一个Eth-Trunk

8.如果本地设备使用了Eth-Trunk,与成员接口直连的对接端口也必须捆绑为Eth-Trunk接口,两端才能正常通信

9.当成员接口的速率不一致时,实际使用中速率小的接口可能会出现拥塞,导致丢包

10.当成员接口加入Eth-Trunk后,学习mac地址时时按照Eth-Trunk来学习的,而不是按照成员接口来学习的

三.验证链路聚合

端口聚合又称为链路捆绑

分为二层和三层,二层链路捆绑对二层交换机,形成的链路不带IP地址功能。

二层交换机接口只能是二层性质的,接口链路类型可以设置为trunk或者access

二台二层交换机和2台PC机

PC机设置同网段ip

 开始设置三部曲

接着创建链路聚合 

 第二台交换机同样配置

检查下配置是否成功

 在电脑上测试正常通信

如果有另一路不同VLAN的话

创建vlan5 ,链路类型设置trunk

[B]vlan 5
[B-vlan5]int e0/0/5
[B-Ethernet0/0/5]port link-type access 
[B-Ethernet0/0/5]port default vlan 5
[B-Ethernet0/0/5]q 
[B]int Eth-Trunk 1
[B-Eth-Trunk1]port link-type trunk 
[B-Eth-Trunk1]port trunk allow-pass vlan 5
[B-Eth-Trunk1]q

查看MAC地址表

 [A]display mac-address 


MAC address table of slot 0:
-------------------------------------------------------------------------------
MAC Address    VLAN/       PEVLAN CEVLAN Port            Type      LSP/LSR-ID  
               VSI/SI                                              MAC-Tunnel  
-------------------------------------------------------------------------------
5489-9875-56ea 5           -      -      Eth-Trunk1      dynamic   0/-         
5489-9831-052a 5           -      -      Eth0/0/5        dynamic   0/-         
-------------------------------------------------------------------------------
Total matching items on slot 0 displayed = 2 

查看生成树的转发记录

[A]display stp brief 


 MSTID  Port                        Role  STP State     Protection
   0    Ethernet0/0/4               DESI  FORWARDING      NONE
   0    Ethernet0/0/5               DESI  FORWARDING      NONE
   0    Eth-Trunk1                  DESI  FORWARDING      NONE

三层链路捆绑针对三层交换机,形成的链路带IP地址功能。

三层交换机接口必须时二层性质和三层性质二选一,若三层交换机接口性质为三层,那将不可以设置链路为trunk或access

三层链路聚合实现的功能:PC机之间不同网段的数据通信。

三层路由器做聚合链路

PC1:IP192.168.1.10   子网掩码255.255.255.0,网关192.168.1.1

PC2:IP192.168.2.10   子网掩码255.255.255.0,网关192.168.2.2

A的配置

<HUAWEI>undo terminal m                                     关闭弹窗
<HUAWEI>sys                                                  进入系统视窗
[~HUAWEI]sysname B                                          改名称
[*HUAWEI]user-interface console 0                             永不超时
[*HUAWEI-ui-console0]idle-timeout 1 1
[*HUAWEI-ui-console0]q                                        退出
[*HUAWEI]interface Eth-Trunk 1                                 创建Eth-Trunk 1接口
[*HUAWEI-Eth-Trunk1]undo portswitch                            接口开启三层功能
[*HUAWEI-Eth-Trunk1]ip address 10.1.1.1 255.255.255.0          给Eth-Trunk 1接口设置IP地址和子网掩码
[*HUAWEI-Eth-Trunk1]int ge1/0/0                                进入ge1/0/0 接口
[*HUAWEI-GE1/0/0]undo shutdown                                 ge1/0/0 接口开启
[*HUAWEI-GE1/0/0]eth-trunk 1                                    成为Eth-Trunk 1成员
[*HUAWEI-GE1/0/0]int ge1/0/1                                    进入ge1/0/1 接口
[*HUAWEI-GE1/0/1]undo shutdown                                   ge1/0/1 接口开启
[*HUAWEI-GE1/0/1]eth-trunk 1                                   成为Eth-Trunk 1成员
[*HUAWEI-GE1/0/1]int ge1/0/2                                    进入ge1/0/1 接口
[*HUAWEI-GE1/0/2]undo shutdown                                    ge1/0/2 接口开启
[*HUAWEI-GE1/0/2]eth-trunk 1                                   成为Eth-Trunk 1成员
[*HUAWEI-GE1/0/2]int ge1/0/3                                    进入ge1/0/3 接口
[*HUAWEI-GE1/0/3]undo shutdown                                    ge1/0/3 接口开启
[*HUAWEI-GE1/0/3]undo portswitch                               接口开启三层功能
[*HUAWEI-GE1/0/3]ip address 192.168.1.1 24                     给ge1/0/3接口设置IP地址和掩码长度
[*HUAWEI-GE1/0/3]q                                              退出
[*HUAWEI]ip route-static 192.168.2.0 24 10.1.1.2              配置静态路由,目的网段是192.168.2.0 掩码长度 24 下一跳是10.1.1.2
[*HUAWEI]q
Warning: Uncommitted configurations found. Are you sure to commit them before ex
iting? [Y(yes)/N(no)/C(cancel)]:y
<A>save                                                           保存
Warning: The current configuration will be written to the device. Continue? [Y/N
]:y
Now saving the current configuration to the slot 17 
Info: Save the configuration successfully.

查看路由表

 B的配置

<HUAWEI>undo terminal m                                     关闭弹窗
<HUAWEI>sys                                                  进入系统视窗
[~HUAWEI]sysname B                                          改名称
[*HUAWEI]user-interface console 0                             永不超时
[*HUAWEI-ui-console0]idle-timeout 1 1
[*HUAWEI-ui-console0]q                                        退出
[*HUAWEI]interface Eth-Trunk 1                                 创建Eth-Trunk 1接口
[*HUAWEI-Eth-Trunk1]undo portswitch                            接口开启三层功能
[*HUAWEI-Eth-Trunk1]ip address 10.1.1.2 255.255.255.0          给Eth-Trunk 1接口设置IP地址和子网掩码
[*HUAWEI-Eth-Trunk1]int ge1/0/0                                进入ge1/0/0 接口
[*HUAWEI-GE1/0/0]undo shutdown                                 ge1/0/0 接口开启
[*HUAWEI-GE1/0/0]eth-trunk 1                                    成为Eth-Trunk 1成员
[*HUAWEI-GE1/0/0]int ge1/0/1                                    进入ge1/0/1 接口
[*HUAWEI-GE1/0/1]undo shutdown                                   ge1/0/1 接口开启
[*HUAWEI-GE1/0/1]eth-trunk 1                                   成为Eth-Trunk 1成员
[*HUAWEI-GE1/0/1]int ge1/0/2                                    进入ge1/0/1 接口
[*HUAWEI-GE1/0/2]undo shutdown                                    ge1/0/2 接口开启
[*HUAWEI-GE1/0/2]eth-trunk 1                                   成为Eth-Trunk 1成员
[*HUAWEI-GE1/0/2]int ge1/0/3                                    进入ge1/0/3 接口
[*HUAWEI-GE1/0/3]undo shutdown                                    ge1/0/3 接口开启
[*HUAWEI-GE1/0/3]undo portswitch                               接口开启三层功能
[*HUAWEI-GE1/0/3]ip address 192.168.2.2 24                     给ge1/0/3接口设置IP地址和掩码长度
[*HUAWEI-GE1/0/3]q                                              退出
[*HUAWEI]ip route-static 192.168.1.0 24 10.1.1.1              配置静态路由,目的网段是192.168.1.0 掩码长度 24 下一跳是10.1.1.1
[*HUAWEI]q
Warning: Uncommitted configurations found. Are you sure to commit them before ex
iting? [Y(yes)/N(no)/C(cancel)]:y
<A>save                                                           保存
Warning: The current configuration will be written to the device. Continue? [Y/N
]:y
Now saving the current configuration to the slot 17 
Info: Save the configuration successfully.


查看路由表

 在B设备上ping A设备上的eth-trunk 1的IP 10.1.1.1

 测试正常后再到PC1上去PING PC2的ip

 证明配置正确
 

总结:

链路聚合定义,实现的条件

二层交换机和三层交换机实现的区别

二层交换机的链路聚合只能是二层交换机,不带IP地址功能

三层交换机是三层交换机,带IP地址功能

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值