链路聚合
Eth-Trunk( 链路聚合技术 )作为一种捆绑技术,可以把多个独立的物理接口绑定在一起作为一个大带宽的逻辑接口使用,这样既不用替换接口板也不会浪费IP地址资源。
Eth-Trunk技术原理与配置
Trh-Trunk概念
![](https://img-blog.csdnimg.cn/img_convert/7e2b590af77d209f21168690806cbfb6.png)
手工负载分担模式
![](https://img-blog.csdnimg.cn/img_convert/53363f212c6d7fc44ef382fe79f03056.png)
LACP模式
![](https://img-blog.csdnimg.cn/img_convert/7e3aec56b450565a6cb3783f41fc12ac.png)
LACP模式活动链路的选取
![](https://img-blog.csdnimg.cn/img_convert/f2a79bd629f0d9e8cdd7ef79be470d77.png)
LACP模式的抢占机制
![](https://img-blog.csdnimg.cn/img_convert/d96b339916564db2bbb1691fe4379056.png)
据情况而定要不要设置抢占,三条线路速率区别
Eth-Trunk接口负载分担
Eth-Trunk接口进行负载分担时,可以选择IP地址或者包作为负载分担的散列依据,同时还可以设置成员接口的负载分担权重(权重越大负载越大)
![](https://img-blog.csdnimg.cn/img_convert/fdfe62d9cce4c14b8ba1fb0b0901450d.png)
Eth-Trunk接口配置流程
![](https://img-blog.csdnimg.cn/img_convert/34d6a1869f9d946d35b8dd49f28946c6.png)
注意事项:
![](https://img-blog.csdnimg.cn/img_convert/ac91cb59cd98f7f989bee2bee54c5995.png)
手工负载分担配置:
[SW1]int Eth-Trunk 1 //<0-63>[SW1-Eth-Trunk1]portswitch //把聚合链路转化为2层聚合链路 undo portswith //把聚合链路从二层转为三层链路 Error: The interface is already a L2 interface.[SW1-Eth-Trunk1]mode manual load-balance //设置为手工负载分担,也是缺省值。[SW1-Eth-Trunk1]trunkport g 0/0/2 to 0/0/4 //将2、3、4接口加入也可在接口模式下将成员加入eth-trunk组中:[SW1-Eth-Trunk1]int g0/0/4[SW1-GigabitEthernet0/0/4]eth-trunk 1
LACP配置方式:
[SW1]lacp priority 10 //配置当前设备优先级为10,默认为32768[SW1]int Eth-Trunk 1[SW1-Eth-Trunk1]portswitch [SW1-Eth-Trunk1]mode lacp-static [SW1-Eth-Trunk1]trunkport g 0/0/2 to 0/0/4[S1-Eth-Trunk11]load-balance dst-mac //可选,配置负载均衡模式为目标MAC地址,通过hash算法自动调度。[SW1-Eth-Trunk1]max active-linknumber 2 //设置活跃链路最大值,1-8注意:设置抢占的目的是希望原本为活跃链路的接口在宕掉后恢复正常就再次成为活跃链路。也就是可以设定固定几个接口为活跃接口,只要恢复正常则立马成为活跃接口继续工作,在设置抢占相关命令时,主动端与被动端都需要设置。[SW1-Eth-Trunk1]lacp preempt enable //开启抢占[SW1-Eth-Trunk1]lacp preempt delay 10 //设置抢占延时时间为10秒,范围10-180秒
[SW1-Eth-Trunk1]int g0/0/2[SW1-GigabitEthernet0/0/2]lacp priority 10 //配置成员接口的LACP接口优先级,默认32768