文檔簡介:
以華爲LACP協議在交換機的應用爲主,橫向對比其他廠家配置,以及與其他廠家lacp對接的實現。
一、維基百科解釋
鏈路聚合(英語: Link Aggregation )是一個計算機網絡術語,指將多個物理端口匯聚在一起,形成一個邏輯端口,以實現出/入流量吞吐量在各成員端口的負荷分擔,交換機根據用戶配置的端口負荷分擔策略決定網絡封包從哪個成員端口發送到對端的交換機。當交換機檢測到其中一個成員端口的鏈路發生故障時,就停止在此端口上發送封包,並根據負荷分擔策略在剩下的鏈路中重新計算報文的發送端口,故障端口恢復後再次擔任收發端口。鏈路聚合在增加鏈路帶寬、實現鏈路傳輸彈性和工程冗餘等方面是一項很重要的技術。
二、Eth-Trunk基本配置
<HUAWEI> system-view
[~HUAWEI] interface eth-trunk 1
[*HUAWEI-Eth-Trunk1] mode lacp-static
[*HUAWEI-Eth-Trunk1] trunkport 10ge 1/0/1 to 1/0/3
[*HUAWEI-Eth-Trunk1] commit
[~HUAWEI-Eth-Trunk1] quit
華爲的設備支持 兩種Eth-trunk工作模式:
手工負載分擔模式
LACP模式:靜態和動態
手工負載分擔(Manual load-balance)模式下,Eth-Trunk的建立、成員接口的加入由手工配置,沒有LACP(link Aggregation Control Protocol)協議報文的參與。該模式下所有活動鏈路都參與數據的轉發,平均分擔流量,因此稱爲負載分擔模式。如果某條活動鏈路故障,鏈路聚合組自動在剩餘的活動鏈路中平均分擔流量,當需要在兩個直連設備間提供一個較大的鏈路帶寬而設備又不支持LACP協議時,可以使用手工負載分擔模式。
靜態LACP(Static LACP)模式是一種利用LACP協議進行聚合參數協商、確定活動接口和非活動接口的鏈路聚合方式。
該模式下,需手工創建Eth-Trunk,手工加入Eth-Trunk成員接口,由LACP協議協商確定活動接口和非活動接口。
靜態LACP模式也稱爲M∶N模式。這種方式同時可以實現鏈路負載分擔和鏈路冗餘備份的雙重功能。在鏈路聚合組中M條鏈路處於活動狀態,這些鏈路負責轉發數據並進行負載分擔,另外N條鏈路處於非活動狀態作爲備份鏈路,不轉發數據。當M條鏈路中有鏈路出現故障時,系統會從N條備份鏈路中選擇優先級最高的接替出現故障的鏈路,同時這條替換故障鏈路的備份鏈路狀態變爲活動狀態開始轉發數據。
和靜態LACP模式相對應的還包括動態LACP模式。動態LACP模式的鏈路聚合,從Eth-Trunk的創建到加入成員接口都不需要人工的干預,由LACP協議自動協商完成。一般用在跟服務器對接。
三、LACP 報文格式
四、華爲跟其他廠家lacp模式對接表
Cisco 工作模式 | Huawei 工作模式 |
on | manual(缺省模式) |
active(LACP) | lacp-static |
passive(LACP) | lacp-static |
atuo(PAgP) | 不支持對接 |
desirable(PAgP) | 不支持對接 |
備註:
其他廠家如H3C、ZTE類似主要的區別就在於huawei LACP-STATIC對應的是其他廠家dynamic模式。
案例:
摘錄自華爲CE12800文檔
創建鏈路聚合組,配置LACP模式並將接口加入Eth-Trunk。
# 配置華爲設備。
<HUAWEI> system-view [~HUAWEI] interface eth-trunk 1 [*HUAWEI-Eth-Trunk1] mode lacp-static [*HUAWEI-Eth-Trunk1] trunkport 10ge 1/0/1 to 1/0/3 [*HUAWEI-Eth-Trunk1] commit [~HUAWEI-Eth-Trunk1] quit
# 配置CISCO設備。
CISCO#configure terminal CISCO(config)#interface port-channel 1 CISCO(config-if)#exit CISCO(config)#interface range gigabitEthernet 0/1, gigabitEthernet 0/2, gigabitEthernet 0/3 CISCO(config-if-range)#channel-protocol lacp CISCO(config-if-range)#channel-group 1 mode active CISCO(config-if-range)#exit CISCO(config)#exit
# 查看華爲設備。
[~HUAWEI] display eth-trunk 1Eth-Trunk1's state information is: Local: LAG ID: 1 Working Mode: Static System Priority: 32768 System ID: 0025-9e95-7c31 Operating Status: up Number Of Up Ports In Trunk: 3 Timeout Period: Slow -------------------------------------------------------------------------------- ActorPortName Status PortType PortPri PortNo PortKey PortState Weight 10GE1/0/1 Selected 1GE 32768 1 20289 10111100 1 10GE1/0/2 Selected 1GE 32768 2 20289 10111100 1 10GE1/0/3 Selected 1GE 32768 3 20289 10100000 1 Partner: ActorPortName SysPri SystemID PortPri PortNo PortKey PortState 10GE1/0/1 32768 0025-9e95-7c11 32768 0 20289 10111100 10GE1/0/2 32768 0025-9e95-7c11 32768 0 20289 10111100 10GE1/0/3 32768 0025-9e95-7c11 32768 0 20289 10100000
# 查看CISCO設備。
CISCO#show etherchannel 1 port-channel Port-channels in the group: --------------------------- Port-channel: Po1 (Primary Aggregator) ------------ Age of the Port-channel = 0d:05h:03m:48s Logical slot/port = 2/1 Number of ports = 3 HotStandBy port =null Port state = Port-channel Ag-Inuse Protocol = LACP Port security = Disabled Ports in the Port-channel: Index Load Port EC state No of bits ------+-------------+-----------+----------------------------------------------- 0 00 Gi0/1 Active 0 0 00 Gi0/2 Active 0 0 00 Gi0/3 Active 0 Time since last port bundled: 0d:00h:44m:09s Gi0/3 Time since last port Un-bundled: 0d:00h:44m:13s Gi0/3