天天看点

Etherchannel(链路汇聚)

Etherchannel(链路汇聚)

1.当两台交换机之间连接多条线路来增加带宽时,由于STP的原因,最终会阻塞其他多余的线路而只留下一条线路来转发数据,为了能让两台交换机之间连接的多条线路同时提供数据转发达到增加宽带的效果,可以通过etherchannel来实现。

2.通过Etherchannel将交换机上的多条线路捆绑成一个组,相当于逻辑链路,组中活动的物理链路同时提供数据转发,可以提高链路带宽,当组中的物理链路断掉后,那么流量将被移到剩下的活动链路中去,只有组中还有活动的链路,用户的流量就不会中断。

3.对于catalyst IOS软件交换机,不仅能够支持第2层ethechannel,而且还可以支持第3层etherchannel,第3层etherchannel能够捆绑第3层或可路由接口;只要优势之一就是路由协议将etherchannel当作单条链路,并且路由选择协议不会在链路失效的过程中重新收敛。

4. Etherchannel只支持对Fastethernet接口和Gigabit ethernet接口的捆绑,一个Ethernet组中最多有8个接口为用户转发数据。

5.在两台交换机之间连接的多条链路时,必需同时做ethernet捆绑,若一边做捆绑一边不捆绑那么接口会工作在异常状态,不能转发数据。

6.为了让两边交换机的接口都工作在ethernet组中,可以通过手工强制指定接口工作在组中,也可以通过协议自动协商。

Catalyst交换机支持PAgP和LACP 2种协议:

PAgP : (Port Aggregationprotocol,端口汇聚协议),Cisco专用,Catalyst交换机默认配置。

LACP : (Link AggregationControl protocol,链路汇聚控制协议),IEEE标准 802.3ad。

在Cisco catalyst交换机之间,Etherchannel通常使用PAgP或LACP,为了是的链路伙伴的端口能够作为一个Etherchannel而工作,Etherchannel只能支持一种模式,对于cisco授权的厂商也可以使用PAgP。

PAgP有几种不同的工作模式,不同的工作模式决定端口组能否形成通道。

PAgP模式:

1.开启(on):这种模式强制端口不使用PAgP而形成Etherchannel,链路伙伴也处于on模式下才能形成Etherchannel。

2.关闭(of):禁止端口形成etherchannle。

3.自动(Auto):端口进入自动协商状态,如果端口收到pagp包那么就形成etherchannel,该模式下端不会主动发起协商,Auto是默认模式。

4.企望(Desirable):端口利用PAgP进入入etherchannel的协商状态, 主动模式 cisco推荐采用模式。

Auto和Desirable模式的PAgP支持如下选项:

1. Silent:Auto和Desirable模式所使用的默认关键字,它表示交换机不期望从伙伴设备接收pagp帧来防止交换机报告达到stp的链路状态为down,这种模式用于连接不支持pagp的设备(如流量发生器)。

2. Non-silent:Auto和Desirable模式所使用的默认关键字,表示交换期望从伙伴设备接收pagp帧,这种模式用于检测单向链路故障,如果没有从伙伴设备接收到apgp帧那么单向链路失败,stp的链路状态报告为down,推荐在支持pagp设备间使用non-slient。

若两边交换机都是在desirable模式下,则可以协商成功;若两边都是auto模式,则不能工作。在ethernet Desirable模式能够在配置不当或软硬件失效的情况下提供额外的稳定性,所有cisco推荐采用desirables模式形成etherchannel链路。

LACP模式:

1.开启(on): 这种模式强制端口形成etherchannel,并不需要Lacp 这种模式要求链路两侧etherchannel都处于on模式。

2.关闭(off): 禁止端口形成etherchannl。

3.被动(Passive):端口进入被动协商状态,若端口收到lacp数据包那么就形成etherchannel此模式端口不会主动发起协商,默认模式。

4.主动(Active):主动LACP协商状态,在配置etherchannel时推荐使用该模式。

LACP的配置参数:

1.系统优先级:LACP要求每个链路伙伴都有一个系统优先级,交换机能够自动地确定系统优先级,或者可以通过手工配置而确定系统

优先级。

2.端口优先级:LACP要求每个端口拥有一个端口优先级,交换机能够自动确定端口优先级,或者可以通过手工配置而确定端口优先级。

3.管理密钥:LACP要求每个通道内的每个端口都拥有一个密钥值,它可以自动确定也可以手工配置。

Attention:

1.在配置ethernet组时,需定义组号码,不要配置超过48个组。

2.两边交换机的ethernet组可以采用不同的号码 端口既不必是连续的,也不必位于同一个模块。

3.pagp组中不能超过8个接口。

4.lacp中不能超过16个接口,但只有8个活动接口。

5.两个协议可以配置在同台交换机上,但不能配置在同一个组中。

6.组中的接口不能是span的目标接口和安全接口以及801.1x端口。

7.将接口配置为2层时必须在相同的vlan,如果是trunknative vlan必须想通过。

8.配置好ethernet组后,在port-channel下配置的参数会对所有的物理接口生效,但对单个物理接口的配置只对单个接口生效。

9.多个接口捆绑成单条ethernet后,在stp中被当作单条链路来计算,同时path cost值会和原物理链路有所不同。

10.一个etherchannel内的所有端口都必须具有相同的速度和双工模式,lacp要求端口只能工作在双工模式下。

11.一个etherchannel内的所有端口都要求具有相同的vlan开销配置,即使接口配置了不同的stp端口路径开销兼容端口也能形成一个etherchannel。

EtherChannel Misconfiguration Guard

EtherChannelGuard is a way of finding out if one end of the EtherChannel is not configuredproperly.

Thiscould be that there are some parameters not matching up such as duplex andspeed.Or it could be that one side is a trunk and the other isn’t.

When thereis a misconfiguration found, the switch will place the interfaces inerror-disabled state and an error will be displayed.

Configuration

SW1(config)#spanning-treeetherchannel guard misconfig 

Verification

SW1#showspanning-tree summary

Switchis in pvst mode

Rootbridge for: none

Extendedsystem ID is enabled

PortfastDefault is disabled

PortFastBPDU Guard Default is disabled

PortfastBPDU Filter Default is disabled

LoopguardDefault is disabled

EtherChannel misconfig guard is enabled

UplinkFastis disabled

BackboneFastis disabled

ConfiguredPathcost method used is short

NameBlocking Listening Learning Forwarding STP Active

------------------------------ --------- -------- ---------- --------------------------------------

Total0 0 0 0 0

To view any disabledinterfaces issue the show command:

SW1#show interfaces status err-disabled

Etherchannel负载均衡

Etherchannel支持基于一下方式的负载均衡:

1.src-mac:基于源MAC,默认为此方式,不同源主机,流量可能从不同的接口被发出去,但相同的源主机肯定是走相同的接口。

2.src-dst-mac:基于源和目的MAC,流量从主机a 到主机b,从主机a 到主机c 以及从主机c 到主机b 都可能走不同的接口。

3.src-ip:基于源ip,不同源ip 可能走不同的接口,相同的源ip 走相同的接口。

4.dst-ip :基于目的ip,到不同ip 会走不同的接口,不同主机发往相同的ip 会走相同的接口。

5.src-dst-ip:同时基于源和目的ip,流量从主机a 到主机b 从主机a 到主机c 以及从主机c 到主机b 都可能走不同的接口。

视IOS情况而定,并不是所有的ios 都支持这些负载方式,参考:“Understanding EtherChannel Load Balancing and Redundancy on CatalystSwitches”。

在交换机之间通过ethernet捆绑了多条链路后,默认执行基于源mac的负载均衡,而每条链路的流量比例却是固定的,接口上的流量比例,执行如下标准:

Etherchannel(链路汇聚)

Cisco IOS Etherchannel默认配置

Etherchannel(链路汇聚)

Configuring Layer 2 EtherChannels

Step1  configure terminal

Step2  interface interface-id

Step3  switchport mode {access | trunk}switchport access vlan vlan-id

Step4  channel-groupchannel-group-numbermode{auto[non-silent]|desirable [non-silent]|on}|{active| passive}

Step5  channel-protocol lacp

Step6  end

Step7  show running-config

Step8  copy running-config startup-config

Configuring Layer 3 EtherChannels

Step1  configure terminal

Step2  interface port-channelport-channel-number

Step3  no switchport

Step4  ip address ip-address mask

Step5  end

Step6  show etherchannel channel-group-numberdetail

Step7  copy running-config startup-config

Eg Configuring

Etherchannel(链路汇聚)

Swtich3550(config)#interfaceGigabitEthernet 0/1

Swtich3550(config-if)#switchport

Swtich3550(config-if)#channel-group1 mode on

Swtich3550(config-if)#exit

Swtich3550(config)#interfaceGigabitEthernet 0/2

Swtich3550(config)#interfaceport-channel 1

Swtich3550(config-if)#switchportmode trunk

Swtich3550#showetherchannel 1 summary

Flags: D - down   P - in port-channel

I -stand-alone s - suspended

R - Layer3 S- Layer2

U - in use

GroupPort-channel Ports

-----+------------+-----------------------------------------------------------

1 Po1(SU)  Fa0/1(P)  Fa0/2(s)

4500(config)#intGigabitEthernet 0/1

4500(config-if)#noswitchport

4500(config-if)#channel-group1 mode on

4500(config)#intGigabitEthernet 0/2

6500(config)#interfaceport-channel 1

6500(config-if)#ipaddress 100.1.1.1 255.255.255.0

6500(config)#intGigabitEthernet 0/1

6500(config-if)#noswitchport

6500(config-if)#channel-group1 mode on

6500(config)#intGigabitEthernet 0/2

上一篇: 备份链路
下一篇: ppp 多链路

继续阅读