配置链路聚合负载均衡示例
组网需求
如图3-25所示,在两台Switch设备上配置链路聚合组,链路聚合中包含4个成员接口。用户发现从SwitchA到SwitchB方向的业务流量在4条链路上负载分担不均衡,有些链路上的流量很多,有些链路上的流量很少,进一步发现SwitchA的Eth-Trunk接口出方向的流量是源MAC地址和源IP地址变化的流量。
操作步骤
- 查看SwitchA上Eth-Trunk1各成员接口的负载分担情况,发现4个成员口出方向的流量负载分担不是非常均衡。
[~SwitchA] display interface brief PHY: Physical *down: administratively down ^down: standby (l): loopback (s): spoofing (b): BFD down (e): ETHOAM down (d): Dampening Suppressed (p): port alarm down (dl): DLDP down (c): CFM down (sd): STP instance discarding InUti/OutUti: input utility rate/output utility rate Interface PHY Protocol InUti OutUti inErrors outErrors Eth-Trunk1 up up 0% 50.00% 0 0 10GE1/0/1 up up 0% 46.00% 0 0 10GE1/0/2 up up 0% 51.99% 0 0 10GE1/0/3 up up 0% 51.99% 0 0 10GE1/0/4 up up 0% 50.00% 0 0
- 发现实际网络中从SwitchA的Eth-Trunk接口出方向的流量是源MAC地址和源IP地址变化的流量,根据这个流量模型调整负载分担模板中的Eth-Trunk负载分担HASH算法为hash-mode(8)。
缺省情况下,负载分担模板中的Eth-Trunk负载分担HASH算法为hash-mode(1)。
出方向的流量不均衡请调整当前设备的负载分担方式,入方向的流量不均衡请调整上行设备的负载分担方式。
[~SwitchA] load-balance profile default [~SwitchA-load-balance-profile-default] eth-trunk hash-mode 8 [*SwitchA-load-balance-profile-default] commit [~SwitchA-load-balance-profile-default] quit
- 查看Eth-Trunk1各接口的负载分担情况,发现4个成员口出方向的流量负载分担相比之前变得均衡了。
[~SwitchA] display interface brief PHY: Physical *down: administratively down ^down: standby (l): loopback (s): spoofing (b): BFD down (e): ETHOAM down (d): Dampening Suppressed (p): port alarm down (dl): DLDP down (c): CFM down (sd): STP instance discarding InUti/OutUti: input utility rate/output utility rate Interface PHY Protocol InUti OutUti inErrors outErrors Eth-Trunk1 up up 0% 50.00% 0 0 10GE1/0/1 up up 0% 49.99% 0 0 10GE1/0/2 up up 0% 50.00% 0 0 10GE1/0/3 up up 0% 49.99% 0 0 10GE1/0/4 up up 0% 49.99% 0 0
配置文件
SwitchA的配置文件
# sysname SwitchA # load-balance profile default eth-trunk hash-mode 8 # vlan batch 10 # interface Eth-Trunk1 port link-type trunk port trunk allow-pass vlan 10 # interface 10GE1/0/1 eth-trunk 1 # interface 10GE1/0/2 eth-trunk 1 # interface 10GE1/0/3 eth-trunk 1 # interface 10GE1/0/4 eth-trunk 1 # return
SwitchB的配置文件
# sysname SwitchB # vlan batch 10 # interface Eth-Trunk1 port link-type trunk port trunk allow-pass vlan 10 # interface 10GE1/0/1 eth-trunk 1 # interface 10GE1/0/2 eth-trunk 1 # interface 10GE1/0/3 eth-trunk 1 # interface 10GE1/0/4 eth-trunk 1 # return