2021-12-23⽹⼯基础(⼗四)链路聚合的两种模式、堆叠、集 、IP路由基础
⼀链路聚合的两种模式
1.⼿⼯模式(管理员⼿⼯指定,⽆协议报⽂。没有开销)
2.LACP模式(交换机之间会交互LACP的协议,会有⼀点⼉报⽂交互)⼀般正常情况下推荐使⽤LACP模式。
⼀般⾃动协商都会⼿⼯强制的要好,除⾮⾃动确实失败,⽆法成功。才会⽤⼿动模式。
1 ⼿⼯模式
⼿⼯模式:Eth-Trunk的建⽴、成员接⼝的加⼊均由⼿动配置,双⽅系统之间不使⽤LACP进⾏协商。
正常情况下所有链路都是活动链路,该模式下所有活动链路都参与数据的转发,平均分担流量,如果某条活动链路故障,链路聚合组⾃动在剩余的活动链路中平均分担流量。 当聚合的两端设备中存在⼀个不⽀持LACP协议时,可以使⽤⼿⼯模式。 相关命令
⼿⼯模式负载均衡:[Huawei-Eth-Trunk1]mode manual load-balance
dna双螺旋结构模型⼿⼯模式缺陷
为了使链路聚合接⼝正常⼯作,必须保证本端链路聚合接⼝中所有成员接⼝的对端接⼝:
1 属于同⼀设备
2 加⼊同⼀链路聚合接⼝
⼿⼯模式下,设备间没有报⽂交互,因此只能通过管理员⼈⼯确认。
⼿动模式下,设备只能通过物理层状态判断对端接⼝是否正常⼯作。
2 LACP模式
LACP模式:采⽤LACP协议的⼀种链路聚合模式。设备间通过链路聚合控制协议数据单元(Link Aggregation Control Protocol Data Unit,LACPDU)进⾏交互,通过协议协商确保对端是同⼀台设备、同⼀个聚合接⼝的成员接⼝。
LACPDU报⽂中包含设备优先级、MAC地址、接⼝优先级、接⼝号等。
相关命令
LACP模式:[Huawei-Eth-Trunk1]mode lacp-static
负载分担
基于包的负载分担
在使⽤Eth-Trunk转发数据时,由于聚合组两端设备之间有多条物理链路,如果每个数据帧在不同
的链路上转发,则有可能导致数据帧到达对端时间不⼀致,从⽽引起数据乱序。
基于流的负载分担
Eth-Trunk推荐采⽤逐流负载分担的⽅式,即⼀条相同的流负载到⼀条链路,这样既保证了同⼀数
负载分担模式
Eth-trunk⽀持基于报⽂的IP地址或MAC地址来进⾏负载分担,可以配置不同的模式(本地有效,对出⽅向报⽂⽣效)将数据流分担到不同的成员接⼝上。
常见的模式有:源IP、源MAC、⽬的IP、⽬的MAC、源⽬IP、源⽬MAC。
实际业务中⽤户需要根据业务流量特征选择配置合适的负载分担⽅式。业务流量中某种参数变化越频繁,选择与此参数相关的负载分担⽅式就越容易实现负载均衡。
莲子脱皮机默认情况下,交换机⽤的是源⽬IP模式。
源⽬IP模式算法如下,当有两条链路时,优先级⾼的是0号链路,第⼆条是1号链路,源IP+⽬IP末尾是偶数,数据就从0号链路⾛,反正,奇数,数据就从1号链路⾛。
相关命令
设置分担模式
[Huawei-Eth-Trunk1]load-balance ?
dst-ip According to destination IP hash arithmetic
dst-mac According to destination MAC hash arithmetic
src-dst-ip According to source/destination IP hash arithmetic
src-dst-mac According to source/destination MAC hash arithmetic
src-ip According to source IP hash arithmetic
src-mac According to source MAC hash arithmetic
⼆堆叠、集
1 什么是堆叠、集
堆叠(iStack):多台⽀持堆叠特性的交换机通过堆叠线缆连接在⼀起,从逻辑上变成⼀台交换设备,作为⼀个整体参与数据转发。
集(ClusterSwitchSystem,CSS):将两台⽀持集特性的交换机设备组合在⼀起,从逻辑上组合成⼀台交换设备。
集只⽀持两台设备,⼀般框式交换机⽀持CSS,盒式设备⽀持iStack。
2 堆叠、集的优势
交换机多虚⼀:堆叠交换机对外表现为⼀台逻辑交换机,控制平⾯合⼀,统⼀管理。
转发平⾯合⼀:堆叠内物理设备转发平⾯合⼀,转发信息共享并实时同步。
跨设备链路聚合:跨物理设备的链路被聚合成⼀个Eth-Trunk端⼝,和下游设备实现互联。
实验:华三IRF实验(同华为堆叠,因为ENSP模拟器不⽀持做堆叠,因此使⽤了HCL模拟器)
⾸先配置交换机1
[SW1]irf member 1 priority 32 \\设置交换机1的优先级为32
[SW1]interface range Ten-GigabitEthernet 1/0/49 to Ten-GigabitEthernet 1/0/50 \\进⼊49-50接⼝视图
[SW1-if-range]shutdown \\关闭接⼝
[SW1-if-range]quit
[SW1]display interface brief \\查看接⼝信息
XGE1/0/49 ADM 10G F A 1
XGE1/0/50 ADM 10G F A 1
[SW1]irf-port 1/2 \\创建虚拟接⼝
[SW1-irf-port1/2]port group interface Ten-GigabitEthernet 1/0/49
[SW1-irf-port1/2]port group interface Ten-GigabitEthernet 1/0/50 \\将49-50加⼊虚拟接⼝
[SW1-irf-port1/2]quit
[SW1]interface range Ten-GigabitEthernet 1/0/49 to Ten-GigabitEthernet 1/0/50
[SW1-if-range]undo shutdown \\开启接⼝
[SW1-if-range]quit
[SW1]save force \\保存配置
[SW1]irf-port-configuration active \\激活irf
[SW2]irf member 1 renumber 2 \\修改端⼝成员编号1为2
Renumbering the member ID may result in configuration change or loss. Continue?[Y/N]:y
[SW2]save force \\保存配置
[SW2]quit
<SW2>reboot \\重启交换机
Start to check configuration with next startup configuration file, .DONE!
This command will reboot the device. Continue? [Y/N]:y
[SW2]interface range Ten-GigabitEthernet 2/0/49 to Ten-GigabitEthernet 2/0/50 \\进⼊49-50接⼝视图[SW2-if-range]shutdown \\关闭接⼝
[SW2-if-range]quit
[SW2]irf-port 2/1 \\创建虚拟接⼝
[SW2-irf-port2/1]port group interface Ten-GigabitEthernet 2/0/49
[SW2-irf-port2/1]port group interface Ten-GigabitEthernet 2/0/50 \\将49-50加⼊虚拟接⼝
[SW2-irf-port2/1]quit
[SW2]interface range Ten-GigabitEthernet 2/0/49 to Ten-GigabitEthernet 2/0/50
[SW2-if-range]undo shutdown \\开启接⼝
[SW2-if-range]quit
[SW2]save force \\保存配置
[SW2]irf-port-configuration active \\激活irf
完成后查看接⼝信息验证是否成功
<SW1>display interface brief \\查看接⼝信息
Brief information on interfaces in route mode:
壁挂燃气锅炉
Link: ADM - administratively down; Stby - standby
Protocol: (s) - spoofing
Interface Link Protocol Primary IP Description
InLoop0 UP UP(s) --
ebeam
MGE0/0/0 DOWN DOWN --
NULL0 UP UP(s) --
REG0 UP -- --
Brief information on interfaces in bridge mode:
Link: ADM - administratively down; Stby - standby
Speed: (a) - auto
Duplex: (a)/A - auto; H - half; F - full
Type: A - access; T - trunk; H - hybrid
Interface Link Speed Duplex Type PVID Description
FGE1/0/53 DOWN 40G A A 1
FGE1/0/54 DOWN 40G A A 1
FGE2/0/53 DOWN 40G A A 1
管式静态混合器FGE2/0/54 DOWN 40G A A 1
GE1/0/1 DOWN auto A A 1
GE1/0/2 DOWN auto A A 1
GE1/0/3 DOWN auto A A 1
摄像机标定GE1/0/4 DOWN auto A A 1
GE1/0/8 DOWN auto A A 1 GE1/0/9 DOWN auto A A 1 GE1/0/10 DOWN auto A A 1 GE1/0/11 DOWN auto A A 1 GE1/0/12 DOWN auto A A 1 GE1/0/13 DOWN auto A A 1 GE1/0/14 DOWN auto A A 1 GE1/0/15 DOWN auto A A 1 GE1/0/16 DOWN auto A A 1 GE1/0/17
DOWN auto A A 1 GE1/0/18 DOWN auto A A 1 GE1/0/19 DOWN auto A A 1 GE1/0/20 DOWN auto A A 1 GE1/0/21 DOWN auto A A 1 GE1/0/22 DOWN auto A A 1 GE1/0/23 DOWN auto A A 1 GE1/0/24 DOWN auto A A 1 GE1/0/25 DOWN auto A A 1 GE1/0/26 DOWN auto A A 1 GE1/0/27 DOWN auto A A 1 GE1/0/28 DOWN auto A A 1 GE1/0/29 DOWN auto A A 1 GE1/0/30 DOWN auto A A 1 GE1/0/31 DOWN auto A A 1 GE1/0/32 DOWN auto A A 1 GE1/0/33 DOWN auto A A 1 GE1/0/34 DOWN auto A A 1 GE1/0/35 DOWN auto A A 1 GE1/0/36 DOWN auto A A 1 GE1/0/37 DOWN auto A A 1 GE1/0/38 DOWN auto A A 1 GE1/0/39 DOWN auto A A 1 GE1/0/40 DOWN auto A A 1 GE1/0/41 DOWN auto A A 1 GE1/0/42 DOWN auto A A 1 GE1/0/43 DOWN auto A A 1 GE1/0/44 DOWN auto A A 1 GE1/0/45 DOWN auto A A 1 GE1/0/46 DOWN auto A A 1 GE1/0/47 DOWN auto A A 1 GE1/0/48 DOWN auto A A 1 GE2/0/1 DOWN auto A A 1 GE2/0/2 DOWN auto A A 1 GE2/0/3 DOWN auto A A 1 GE2/0/4 DOWN auto A A 1 GE2/0/5 DOWN auto A A 1 GE2/0/6 DOWN auto A A 1 GE2/0/7 DOWN auto A A 1 GE2/0/8 DOWN auto A A 1 GE2/
0/9 DOWN auto A A 1 GE2/0/10 DOWN auto A A 1 GE2/0/11 DOWN auto A A 1 GE2/0/12 DOWN auto A A 1 GE2/0/13 DOWN auto A A 1 GE2/0/14 DOWN auto A A 1 GE2/0/15 DOWN auto A A 1 GE2/0/16 DOWN auto A A 1 GE2/0/17 DOWN auto A A 1 GE2/0/18 DOWN auto A A 1 GE2/0/19 DOWN auto A A 1 GE2/0/20 DOWN auto A A 1 GE2/0/21 DOWN auto A A 1