端口匯聚是將多個以太網端口匯聚在一起形成一個邏輯上的匯聚組,使用匯聚服務的上層實體把同一匯聚組內的多條物理鏈路視為一條邏輯鏈路。
  端口匯聚可以實現流量在匯聚組中各個成員端口之間進行分擔,以增加帶寬。同時,同一匯聚組的各個成員端口之間彼此動態備份,提高了連接可靠性。
  基於IEEE802.3ad標准的LACP(Link Aggregation Control Protocol,鏈路匯聚控制協議)是一種實現鏈路動態匯聚與解匯聚的協議。LACP協議通過LACPDU(Link Aggregation Control Protocol Data Unit,鏈路匯聚控制協議數據單元)與對端交互信息。
  啟動某端口的LACP協議后,該端口將通過發送LACPDU向對端通告自己的系統優先級、系統MAC、端口優先級、端口號和操作Key。對端接收到這些信息后,將這些信息與其它端口所保存的信息比較以選擇能夠匯聚的端口,從而雙方可以對端口加入或退出某個動態匯聚組達成一致。
  按照匯聚方式的不同,端口匯聚可以分為三類:手工匯聚、靜態LACP匯聚、動態LACP匯聚。
  實驗環境:兩台H3C E126A,Ethernet1/0/24、Ethernet1/0/23匯聚為一條鏈路。
手工匯聚:
第一台交換機的配置:
[H3CA]link-aggregation group 10 mode manual 
[H3CA]interface ethernet 1/0/24 
[H3CA-Ethernet1/0/24]port link-aggregation group 10 
Can not specify a loopback-detection enable port as aggregation group member !
[H3CA-Ethernet1/0/24]undo loopback-detection enable  //關閉掉lookback-detection功能
[H3CA-Ethernet1/0/24]port link-aggregation group 10
[H3CA-Ethernet1/0/24]
[H3CA]interface ethernet1/0/23
[H3CA-Ethernet1/0/23]undo loopback-detection enable
[H3CA-Ethernet1/0/23]port link-aggregation group 10
[H3CA-Ethernet1/0/23]
第二台交換機的配置:
[H3CB]link-aggregation group 10 mode manual
[H3CB]interface ethernet1/0/24
[H3CB-Ethernet1/0/24]undo loopback-detection enable
[H3CB-Ethernet1/0/24]port link-aggregation group 10
[H3CB-Ethernet1/0/24]interface ethernet1/0/23
[H3CB-Ethernet1/0/23]undo loopback-detection enable
[H3CB-Ethernet1/0/23]port link-aggregation group 10
[H3CB-Ethernet1/0/23]
顯示相關信息:
[H3CB]display link-aggregation summary //顯示摘要信息
Aggregation Group Type -- Dynamic, S -- Static , M -- Manual
Loadsharing Type: Shar -- Loadsharing, NonS -- Non-Loadsharing
Actor ID: 0x8000, 000f-e2a8-2def
AL AL Partner ID Select Unselect Share Master
ID Type Ports Ports Type Port
--------------------------------------------------------------------------------
10 M none 2 0 Shar Ethernet1/0/23
[H3CB]
[H3CB]display link-aggregation interface ethernet1/0/24 //顯示接口信息
Ethernet1/0/24:
Selected AggID: 10
Local:
Port-Priority: 32768, Oper key: 1, Flag: 0x00
Remote:
System ID: 0x0, 0000-0000-0000
Port Number: 0, Port-Priority: 0 , Oper-key: 0, Flag: 0x00
[H3CB]display link-aggregation interface ethernet1/0/23
Ethernet1/0/23:
Selected AggID: 10
Local:
Port-Priority: 32768, Oper key: 1, Flag: 0x00
Remote:
System ID: 0x0, 0000-0000-0000
Port Number: 0, Port-Priority: 0 , Oper-key: 0, Flag: 0x00
[H3CB]
[H3CB]display link-aggregation verbose //顯示詳細信息 
Loadsharing Type: Shar -- Loadsharing, NonS -- Non-Loadsharing
Flags: A -- LACP_Activity, B -- LACP_timeout, C -- Aggregation,
D -- Synchronization, E -- Collecting, F -- Distributing,
G -- Defaulted, H -- Expired
Aggregation ID: 10, AggregationType: Manual, Loadsharing Type: Shar
Aggregation Description:
System ID: 0x8000, 000f-e2a8-2def
Port Status: S -- Selected, U -- Unselected
Local:
Port Status Priority Key Flag
--------------------------------------------------------------------------------
Ethernet1/0/23 S 32768 1 {}
Ethernet1/0/24 S 32768 1 {}
Remote:
Actor Partner Priority Key SystemID Fla
g
--------------------------------------------------------------------------------
Ethernet1/0/23 0 0 0 0x0000,0000-0000-0000 {}
Ethernet1/0/24 0 0 0 0x0000,0000-0000-0000 {}
[H3CB]
LACP靜態配置及顯示信息:
[H3CA]link-aggregation group 10 mode static
[H3CA]interface ethernet1/0/24
[H3CA-Ethernet1/0/24]port link-aggregation group 10
Can not specify a loopback-detection enable port as aggregation group member !
[H3CA-Ethernet1/0/24]undo loopback-detection enable
[H3CA-Ethernet1/0/24]port link-aggregation group 10
%Apr 1 23:58:48:162 2000 H3CA LAGG/3/PartnerNoLacp:- 1 -LACP is not enabled on
the remote end of port Ethernet
[H3CA-Ethernet1/0/24]interface ethernet1/0/23
[H3CA-Ethernet1/0/23]undo loopback-detection enable
[H3CA-Ethernet1/0/23]port link-aggregation group 10
[H3CA-Ethernet1/0/23]
%Apr 1 23:59:52:016 2000 H3CA LAGG/3/PartnerNoLacp:- 1 -LACP is not enabled on
the remote end of port Ethernet1/0/23.
[H3CA-Ethernet1/0/23]
[H3CB]link-aggregation group 10 mode static
[H3CB]interface ethernet1/0/24
[H3CB-Ethernet1/0/24]undo loopback-detection enable
[H3CB-Ethernet1/0/24]port link-aggregation group 10
[H3CB-Ethernet1/0/24]interface ethernet1/0/23
[H3CB-Ethernet1/0/23]undo loopback-detection enable
[H3CB-Ethernet1/0/23]port link-aggregation group 10
[H3CB-Ethernet1/0/23]quit
[H3CB]
[H3CA-Ethernet1/0/23]display link-aggregation verbose 
Loadsharing Type: Shar -- Loadsharing, NonS -- Non-Loadsharing
Flags: A -- LACP_Activity, B -- LACP_timeout, C -- Aggregation,
D -- Synchronization, E -- Collecting, F -- Distributing,
G -- Defaulted, H -- Expired
Aggregation ID: 10, AggregationType: Static, Loadsharing Type: Shar
Aggregation Description:
System ID: 0x8000, 000f-e286-97be
Port Status: S -- Selected, U -- Unselected
Local:
Port Status Priority Key Flag
--------------------------------------------------------------------------------
Ethernet1/0/23 S 32768 1 {ACDEF}
Ethernet1/0/24 S 32768 1 {ACDEF}
Remote:
Actor Partner Priority Key SystemID Fla
g
--------------------------------------------------------------------------------
Ethernet1/0/23 23 32768 1 0x8000,000f-e2a8-2def {ACDEF}
Ethernet1/0/24 24 32768 1 0x8000,000f-e2a8-2def {ACDEF}
[H3CA-Ethernet1/0/23]
[H3CA]display link-aggregation summary
Aggregation Group Type -- Dynamic, S -- Static , M -- Manual
Loadsharing Type: Shar -- Loadsharing, NonS -- Non-Loadsharing
Actor ID: 0x8000, 000f-e286-97be
AL AL Partner ID Select Unselect Share Master
ID Type Ports Ports Type Port
--------------------------------------------------------------------------------
10 S 0x8000,000f-e2a8-2def 2 0 Shar Ethernet1/0/23
[H3CA]display link-aggregation interface ethernet1/0/24
Ethernet1/0/24:
Selected AggID: 10
Local:
Port-Priority: 32768, Oper key: 1, Flag: 0x3d
Remote:
System ID: 0x8000, 000f-e2a8-2def
Port Number: 24, Port-Priority: 32768 , Oper-key: 1, Flag: 0x3d
Received LACP Packets: 16 packet(s), Illegal: 0 packet(s)
Sent LACP Packets: 28 packet(s)
[H3CA]
LACP動態配置:
[H3CA]interface ethernet1/0/24
[H3CA-Ethernet1/0/24]lacp enable
Can not specify a loopback-detection enable port as aggregation group member !
[H3CA-Ethernet1/0/24]undo loopback-detection enable
[H3CA-Ethernet1/0/24]lacp enable
[H3CA-Ethernet1/0/24]quit
%Apr 1 23:58:42:156 2000 H3CA LAGG/3/PartnerNoLacp:- 1 -LACP is not enabled on
the remote end of port Ethernet1/0/24.
[H3CA]interface ethernet1/0/23
[H3CA-Ethernet1/0/23]undo loopback-detection enable
[H3CA-Ethernet1/0/23]lacp enable
[H3CA-Ethernet1/0/23]
%Apr 1 23:59:27:689 2000 H3CA LAGG/3/PartnerNoLacp:- 1 -LACP is not enabled on
the remote end of port Ethernet1/0/23.
[H3CA-Ethernet1/0/23]
[H3CB]interface ethernet1/0/24
[H3CB-Ethernet1/0/24]undo loopback-detection enable
[H3CB-Ethernet1/0/24]lacp enable
[H3CB-Ethernet1/0/24]interface ethernet1/0/23
[H3CB-Ethernet1/0/23]undo loopback-detection enable
[H3CB-Ethernet1/0/23]lacp enable
[H3CB-Ethernet1/0/23]quit


配置關鍵點:
1.同一個匯聚組中端口的基本配置必須保持一致,基本配置主要包括STP、QoS、VLAN、端口屬性等相關配置;
2.對於端口環回監測(loopback-detection)特性的相關命令和端口匯聚的相關命令,不能同時配置;
3.對於配置了mac-address max-mac-count命令的端口,不能加入到匯聚組中;反之,對於已經加入到某個匯聚組中的端口,也不能再配置mac-address max-mac-count命令;
4.對於使能了MAC地址認證或802.1x的端口,不能加入到匯聚組中;
5.對於鏡像目的端口、遠程鏡象反射端口、不能加入到匯聚組中;
6.對於配置了黑洞MAC地址、靜態MAC地址或配置了靜態ARP的端口,不能加入到匯聚組中;
7.對於配置了MAC地址和IP地址綁定的端口,不能加入到匯聚組中;
8.對於已經配置了端口安全(Port-Sercurity)特性相關命令的端口,不能加入到匯聚組中