实验47: EtherChannel 配置
1.
实验目的
通过本实验,读者可以掌握如下技能:
(1) Etherchannel 的工作原理
(2) Etherchannel 的配置
2.
实验拓扑
拓扑图
3.
实验步骤
注:
1.
构成EtherChannel的端口必须具有相同的特性,如双工模式、速度、Trunking的状态等。
配置EtherChannel有手动配置和自动配置(PAGP或者LAGP)两种方法,自动配置就是让
EtherChannel
协商协议自动协商EtherChannel的建立。
2.
配置PAGP 或者LAGP
要想把接口配置为PAGP 的desirable 模式使用命令:“channel-group 1 mode desirable”;
要想把接口配置为PAGP 的auto 模式使用命令:“channel-group 1 mode auto”;
要想把接口配置为LACP 的active 模式使用命令:“channel-group 1 mode active”;
要想把接口配置为LACP 的passive 模式使用命令:“channel-group 1 mode passive”。
3.EtherChannel
的负载平衡方式,命令格式为“port-channel load-balance
method
”, 负载平衡的方式有:dst-ip、dst-mac、src-dst-ip、src-dst-mac等。
4.
创建以太通道,要指定一个唯一的通道组号,组号的范围是1~6的正整数。要取消
EtherChannel
时用“no interface port-channel 1”
5
“SU”表示EtherChannel 正常,如果显示为“SD”,把EtherChannel 接口关掉重新开启。
sw1(config)#int port-channel 1
//
以上是创建以太通道,要指定一个唯一的通道组号,组号的范围是1~6的正整数。
sw1(config-if)#int f
*Mar 1 00:09:23.439: %LINK-3-UPDOWN: Interface Port-channel1, changed state to up
*Mar 1 00:09:24.439: %LINEPROTO-5-UPDOWN: Line protocol on Interface Port-channel1, changed state to down
sw1(config-if)#int f0/0
sw1(config-if)#channel-group 1 mode on
//
以上将物理接口指定到已创建的通道中。
sw1(config-if)#
*Mar 1 00:09:43.431: %EC-5-BUNDLE: Interface Fa0/0 joined port-channel Po1
sw1(config-if)#
*Mar 1 00:09:46.455: %LINEPROTO-5-UPDOWN: Line protocol on Interface Port-channel1, changed state to up
sw1(config-if)#speed 100
sw1(config-if)#duplex full
//
以上配置通道中的物理接口的属性,速度和双工
sw1(config-if)#exi
*Mar 1 00:09:59.399: %EC-5-UNBUNDLE: Interface Fa0/0 left the port-channel Po1
*Mar 1 00:09:59.439: %EC-5-BUNDLE: Interface Fa0/0 joined port-channel Po1
*Mar 1 00:09:59.523: %EC-5-UNBUNDLE: Interface Fa0/0 left the port-channel Po1
*Mar 1 00:09:59.735: %EC-5-BUNDLE: Interface Fa0/0 joined port-channel Po1
sw1(config-if)#exit
sw1(config)#itn
*Mar 1 00:10:01.439: %LINK-3-UPDOWN: Interface Port-channel1, changed state to up
*Mar 1 00:10:01.527: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
sw1(config)#int f0/1
sw1(config-if)#chann 1 mode on
sw1(config-if)#
*Mar 1 00:10:15.399: %EC-5-BUNDLE: Interface Fa0/1 joined port-channel Po1
sw1(config-if)#spe 100
sw1(config-if)#dup full
sw1(config-if)#
*Mar 1 00:10:31.399: %EC-5-UNBUNDLE: Interface Fa0/1 left the port-channel Po1
*Mar 1 00:10:31.443: %EC-5-BUNDLE: Interface Fa0/1 joined port-channel Po1
*Mar 1 00:10:31.475: %EC-5-UNBUNDLE: Interface Fa0/1 left the port-channel Po1
*Mar 1 00:10:31.759: %EC-5-BUNDLE: Interface Fa0/1 joined port-channel Po1
sw1(config-if)#
*Mar 1 00:10:33.479: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up
sw1(config-if)#exit
sw1(config)#port-channel load-balance dst-mac
配置EtherChannel的负载平衡方式
Warning: Delete and re-create existing port channels to apply new load balance method to them
sw1(config)#do sh etherchannel summary
Flags: D - down P - in port-channel
I - stand-alone s - suspended
R - Layer3 S - Layer2
U - in use
Group Port-channel Ports
-----+------------+-----------------------------------------------------------
1 Po1(SU) Fa0/0(P) Fa0/1(P)
//
可以看到EtherChannel 已经形成,“SU”表示EtherChannel 正常
w2(config)#int port-channel 1
sw2(config-if)#int
*Mar 1 00:04:41.795: %LINK-3-UPDOWN: Interface Port-channel1, changed state to up
*Mar 1 00:04:42.795: %LINEPROTO-5-UPDOWN: Line protocol on Interface Port-channel1, changed state to down
sw2(config-if)#exit
sw2(config)#int port-channel 1
sw2(config-if)#int f0/0
sw2(config-if)#channel-group 1 mode on
sw2(config-if)#
*Mar 1 00:05:45.907: %EC-5-BUNDLE: Interface Fa0/0 joined port-channel Po1
sw2(config-if)#exit
sw2(config)#int
*Mar 1 00:05:48.927: %LINEPROTO-5-UPDOWN: Line protocol on Interface Port-channel1, changed state to up
sw2(config)#int f0/1
sw2(config-if)#channel-group 1 mode on
sw2(config-if)#
*Mar 1 00:06:06.595: %EC-5-BUNDLE: Interface Fa0/1 joined port-channel Po1
sw2(config-if)#speed 100
sw2(config-if)#duplex full
sw2(config-if)#
*Mar 1 00:06:26.679: %EC-5-UNBUNDLE: Interface Fa0/1 left the port-channel Po1
*Mar 1 00:06:26.727: %EC-5-BUNDLE: Interface Fa0/1 joined port-channel Po1
*Mar 1 00:06:26.755: %EC-5-UNBUNDLE: Interface Fa0/1 left the port-channel Po1
*Mar 1 00:06:27.007: %EC-5-BUNDLE: Interface Fa0/1 joined port-channel Po1
sw2(config-if)#
*Mar 1 00:06:28.759: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up
sw2(config-if)#exit
sw2(config)#int f0/0
sw2(config-if)#speed 100
sw2(config-if)#duplex full
sw2(config-if)#
*Mar 1 00:08:29.687: %EC-5-UNBUNDLE: Interface Fa0/0 left the port-channel Po1
*Mar 1 00:08:29.771: %EC-5-BUNDLE: Interface Fa0/0 joined port-channel Po1
*Mar 1 00:08:29.819: %EC-5-UNBUNDLE: Interface Fa0/0 left the port-channel Po1
*Mar 1 00:08:30.007: %EC-5-BUNDLE: Interface Fa0/0 joined port-channel Po1
sw2(config-if)#
*Mar 1 00:08:31.819: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
sw2(config-if)#exi
sw2(config)#port-channel load-balance dst-mac
Warning: Delete and re-create existing port channels to apply new load balance method to them
sw2(config)#do sh etherchannel summary
Flags: D - down P - in port-channel
I - stand-alone s - suspended
R - Layer3 S - Layer2
U - in use
Group Port-channel Ports
-----+------------+-----------------------------------------------------------
1 Po1(SU) Fa0/0(P) Fa0/1(P)
sw2(config)#
本文出自 “柯浩坚” 博客,转载请与作者联系!