一、工作原理
二、链路聚合配置流程
三、二层链路聚合匹配命令(静态链路聚合)
[SwitchA] interface eth-trunk 1 #创建聚合口
[SwitchA-Eth-Trunk1] trunkport gigabitethernet 0/0/1 to 0/0/3 加入成员接口
[SwitchA-Eth-Trunk1] port link-type trunk 链路类型为trunk
[SwitchA-Eth-Trunk1] port trunk allow-pass vlan 10 20
[SwitchA-Eth-Trunk1] load-balance src-dst-mac #源MAC地址与目的MAC地址进行负载分担
基于流的不能保证带宽,默认的是使用源MAC、目的MAC
LACP协议链路聚合(动态链路聚合)
LACP模式活动链路的选取
1、选优先级,系统优先级,确定主动端、被动端,接口优先级(优先级比小优先)
[SwitchA] interface eth-trunk 1
[SwitchA-Eth-Trunk1] mode lacp #LACP模式
[SwitchA-Eth-Trunk1] mode lacp-static #配置接口优先级前,保证接口已加入LACP模式
[SwitchA-Eth-Trunk1] lacp preempt enable #开启抢占,默认抢占延迟30s
[SwitchA-Eth-Trunk1] lacp preempt delay 10 修改抢占时延
[SwitchA-Eth-Trunk1] port link-type trunk
[SwitchA-Eth-Trunk1] port trunk allow-pass vlan 301 to 305
[SwitchA-Eth-Trunk1] trunkport GigabitEthernet 1/0/1 to 1/0/4 #将GE1/0/1至GE1/0/4加入到Eth-Trunk1中
[SwitchA-Eth-Trunk1] max active-link 3 激活3条链路
[SwitchA-Eth-Trunk1] local-preference enable #接口流量本地优先转发功能
[SwitchA-Eth-Trunk1] quit
[SwitchA] lacp priority 0 确定本设备为Master,通过全局优先级比小,默认32768,根据主设备选举活动接口
[SwitchA] interface range gigabitethernet 1/0/3 to gigabitethernet 1/0/4
[SwitchA-GigabitEthernet1/0/3] lacp priority 100 修改优先级作为活动接口
interface eth-trunk 1
mode manual load-balance 二层聚合
undo portswitch 关闭二层功能,开启三层功能
display interface eth-trunk 1 #可以确认两台设备间 是否已经成功实现链路聚合。收集流量统计数据, 定位接口故障。
如果Eth-Trunk口处于UP状态,表明接口正常运行
如果接口处于Down状态,表明所有成员口物理层发生故障
如果管理员手动关闭端口,接口处于Administratively DOWN状态
四、手工聚合和动态聚合区别
五、注意事项
二层链路聚合配置(华三交换机)
第一步建立聚合组
interface bridge-aggregation 2=port link-aggregation group 2
第二步将物理端口加入到聚合组
interface range GigabitEthernet0/0/1 to GigabitEthernet0/0/2
port link-aggregation group 2
第三步在聚合组下配置相关信息
interface Bridge-Aggregation2
port link-type trunk
port trunk permit vlan all
配置全局聚合负载分担模式为按报文的目的MAC地址和源MAC地址实现聚合负载分担
link-aggregation load-sharing mode destination-mac source-mac
三层链路聚合配置
interface route-aggregation 2
ip address 192.168.1.1 255.255.255.252
link-aggregation global load-sharing mode destination-ip ip地址进行负载分担
link-aggregation mode dynamic 动态聚合模式
interface range g0/0/0 to g0/0/1
lacp mode passive
port link-aggregatio group 2
查看命令
display link-aggregation load-sharing mode
display link-aggregation summary
display link-aggregation interface
二层端口聚合配置(思科),etherchannel不支持10M端口的绑定
int range f0/23 ,f0/24
channel-group 1 mode on #将这两个接口绑定为一组并指定on模式
interface port-channel 1
switchport mode trunk #指定接口模式为trunk,如不指定,会自动继承物理接口的模式
interface range f0/23 - 24 #将二层接口改成三层接口
no switchport
channel-group 1 mode desirable 然后再绑定
interface port-channel 1 给channel通道配上IP地址
ip address 100.1.1.1 255.255.255.0
port-channel load-balance [dst-mac|src-mac] 配置etherchannel负载均衡
show etherchannel load-balance
show etherchannel summary 可以看到绑定了多少接口
Show interface etherchannel
与vmware对接,VMware默认支持基于端口负载均衡
1、负载均衡是基于vPort ID的。一个vPort和Host上的一个pNIC捆绑在一起,只有当这个pNIC失效的时候,才切到另外的pNIC链路上
2、基于源MAC地址的负载均衡,每个vNIC总是具有一个固定的MAC地址,因此这种方式的负载均衡同基于端口的负载均衡具有同样的缺点。同样是要求vPort数量大于pNIC的时候才会有效。同样是vNIC的速率不会大于单个pNIC的速率
3、基于IP Hash的负载均衡,根据源IP地址和目的IP地址的。因此同一台VM(源IP地址总是固定的)到不同目的的数据流,就会因为目的IP的不同,走不同的pNIC,只有这种方式下,VM对外的流量的负载均衡才能真正实现。
VMware是不关心对端物理交换机的配置的,VMware的负载均衡只负责从Host出站的流量(outbound),因此要做到Inbound的负载均衡,必须在物理交换机上做同样IP Hash方式的配置
VMware不支持动态链路聚合协议(例如802.3ad LACP或者Cisco的PAgP),因此只能实现静态的链路聚合。(类似于HP的SLB)。不仅如此,对端的交换机设置静态链路聚合的时候也要设置成IP Hash的算法。否则这种方式的负载均衡将无法实现
转载于:https://blog.51cto.com/maguangjie/1772403