作者主頁:點擊!
ENSP專欄:點擊!
創(chuàng)作時間:2024年4月26日11點54分
鏈路聚合(Link Aggregation),又稱為端口聚合(Port Trunking),是一種將多條物理鏈路聚合成一條邏輯鏈路的技術。它可以提高網(wǎng)絡帶寬、增強網(wǎng)絡冗余性和改善網(wǎng)絡負載均衡。
鏈路聚合的作用
提高網(wǎng)絡帶寬
鏈路聚合可以將多條物理鏈路的帶寬疊加起來,從而提供更高的帶寬。例如,將兩條 1 Gbps 的物理鏈路聚合在一起,可以提供 2 Gbps 的帶寬。
增強網(wǎng)絡冗余性
如果一條或多條物理鏈路出現(xiàn)故障,鏈路聚合可以將流量自動切換到其他正常的鏈路上,從而保證網(wǎng)絡的正常運行。
改善網(wǎng)絡負載均衡
鏈路聚合可以將流量在多條物理鏈路上進行均衡分配,從而提高網(wǎng)絡的整體性能。
使用場景
- 需要高帶寬的網(wǎng)絡,例如服務器集群、數(shù)據(jù)中心等。
- 需要高可靠性的網(wǎng)絡,例如金融機構、醫(yī)療機構等。
- 需要負載均衡的網(wǎng)絡,例如大型企業(yè)網(wǎng)絡、ISP 網(wǎng)絡等。
手動模式配置
實驗拓撲
LSW1基本配置
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]int eth-trunk 10
[Huawei-Eth-Trunk10]trunk
[Huawei-Eth-Trunk10]trunkport g 0/0/1 to 0/0/3
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei-Eth-Trunk10]port link-type trunk
[Huawei-Eth-Trunk10]port trunk allow-pass vlan all
[Huawei-Eth-Trunk10]q
int eth-trunk 10
:進入Eth-Trunk 10的接口配置模式。
trunk
:在Eth-Trunk 10接口上啟用Trunk模式。這實質上是將其從一組單獨的物理鏈路轉換為單個邏輯鏈路。
trunkport g 0/0/1 to 0/0/3
:此命令將千兆以太網(wǎng)接口 g 0/0/1 至 g 0/0/3 添加為 Eth-Trunk 10 的成員接口。流量現(xiàn)在將分布在這些物理鏈路上。
port link-type trunk
:設置Eth-Trunk 10的鏈路類型為trunk。這可確保交換機將其視為單個邏輯鏈路。
port trunk allow-pass vlan all
:允許所有VLAN通過Eth-Trunk 10。默認情況下,Eth-Trunk只允許帶標簽的VLAN。此命令在 Eth-Trunk 上啟用標記和未標記的 VLAN 流量。
配置完成之后查看鏈路聚合
[Huawei]dis eth-trunk
Eth-Trunk10's state information is:
WorkingMode: NORMAL Hash arithmetic: According to SIP-XOR-DIP
Least Active-linknumber: 1 Max Bandwidth-affected-linknumber: 8
Operate status: up Number Of Up Port In Trunk: 3
--------------------------------------------------------------------------------
PortName Status Weight
GigabitEthernet0/0/1 Up 1
GigabitEthernet0/0/2 Up 1
GigabitEthernet0/0/3 Up 1
- Eth-Trunk10的狀態(tài)信息為: 該行表示Eth-Trunk 10的以下信息。
- 工作模式:NORMAL:表示Eth-Trunk 10工作在正常模式,這是理想的情況。
- 哈希算法:根據(jù) SIP-XOR-DIP:這指定用于跨成員接口負載平衡流量的哈希算法。在這種情況下,它使用源 IP (SIP) 地址與目標 IP (DIP) 地址進行異或。
- 最少活動鏈路數(shù):1:此時此值可能不相關。它可能表示與負載均衡的最小活動鏈路數(shù)相關的設置,但具體含義取決于交換機型號。
- Max Bandwidth-affected-linknumber: 8:這可能是指可以貢獻 Eth-Trunk 整體帶寬的成員接口的最大數(shù)量。它設置為 8,這可能是交換機型號支持的最大值。
- 運行狀態(tài): up:這是個好消息!它確認 Eth-Trunk 10 正在運行并且可以承載流量。
- Number Of Up Port In Trunk: 3:這表示可能配置的成員接口中有 3 個當前已啟動并參與 Eth-Trunk。
LSW2的基本配置
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]int Eth-Trunk 10
[Huawei-Eth-Trunk10]trunkport g 0/0/1 to 0/0/3
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei-Eth-Trunk10]port link-type trunk
[Huawei-Eth-Trunk10]port trunk allow-pass vlan all
[Huawei-Eth-Trunk10]q
[Huawei]q
查看鏈路聚合
<Huawei>dis eth-trunk
Eth-Trunk10's state information is:
WorkingMode: NORMAL Hash arithmetic: According to SIP-XOR-DIP
Least Active-linknumber: 1 Max Bandwidth-affected-linknumber: 8
Operate status: up Number Of Up Port In Trunk: 3
--------------------------------------------------------------------------------
PortName Status Weight
GigabitEthernet0/0/1 Up 1
GigabitEthernet0/0/2 Up 1
GigabitEthernet0/0/3
自動模式配置
實驗拓撲
LSW3的基本配置
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]int eth
[Huawei]int Eth-Trunk 10
[Huawei-Eth-Trunk10]mode lacp-static
[Huawei-Eth-Trunk10]load-balance dst-mac
[Huawei-Eth-Trunk10]trunkport g 0/0/1 to 0/0/3
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei-Eth-Trunk10]q
mode lacp-static
:這會將鏈路聚合控制協(xié)議 (LACP) 模式設置為靜態(tài)。靜態(tài)LACP模式下,交換機手動捆綁指定的成員接口,無需與其他設備協(xié)商。
load-balance dst-mac
:配置Eth-Trunk使用目的MAC地址對成員接口之間的流量進行負載均衡。數(shù)據(jù)包將根據(jù)目的 MAC 地址進行哈希處理,結果值將決定數(shù)據(jù)包通過哪個成員接口發(fā)送。文章來源:http://www.zghlxwxcb.cn/news/detail-861753.html
trunkport g 0/0/1 to 0/0/3
:此命令將千兆以太網(wǎng)接口 g 0/0/1 至 g 0/0/3 添加為 Eth-Trunk 10 的成員接口?,F(xiàn)在流量將根據(jù)目標 MAC 在這些物理鏈路上分配每個數(shù)據(jù)包的地址。文章來源地址http://www.zghlxwxcb.cn/news/detail-861753.html
<Huawei>dis eth-trunk
Eth-Trunk10's state information is:
Local:
LAG ID: 10 WorkingMode: STATIC
Preempt Delay: Disabled Hash arithmetic: According to DA
System Priority: 32768 System ID: 4c1f-cce1-2e0a
Least Active-linknumber: 1 Max Active-linknumber: 8
Operate status: up Number Of Up Port In Trunk: 3
--------------------------------------------------------------------------------
ActorPortName Status PortType PortPri PortNo PortKey PortState Weight
GigabitEthernet0/0/1 Selected 1GE 32768 2 2609 10111100 1
GigabitEthernet0/0/2 Selected 1GE 32768 3 2609 10111100 1
GigabitEthernet0/0/3 Selected 1GE 32768 4 2609 10111100 1
Partner:
--------------------------------------------------------------------------------
ActorPortName SysPri SystemID PortPri PortNo PortKey PortState
GigabitEthernet0/0/1 32768 4c1f-cc09-06f6 32768 2 2609 10111100
GigabitEthernet0/0/2 32768 4c1f-cc09-06f6 32768 3 2609 10111100
GigabitEthernet0/0/3 32768 4c1f-cc09-06f6 32768 4 2609 10111100
LSW4的配置命令
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]int e
[Huawei]int Eth-Trunk 10
[Huawei-Eth-Trunk10]mode lacp-static
[Huawei-Eth-Trunk10]load-balance dst-mac
[Huawei-Eth-Trunk10]trunkport g 0/0/1 to 0/0/3
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei-Eth-Trunk10]q
[Huawei]dis eth-trunk
Eth-Trunk10's state information is:
Local:
LAG ID: 10 WorkingMode: STATIC
Preempt Delay: Disabled Hash arithmetic: According to DA
System Priority: 32768 System ID: 4c1f-cc09-06f6
Least Active-linknumber: 1 Max Active-linknumber: 8
Operate status: down Number Of Up Port In Trunk: 0
--------------------------------------------------------------------------------
ActorPortName Status PortType PortPri PortNo PortKey PortState Weight
GigabitEthernet0/0/1 Unselect 1GE 32768 2 2609 10100010 1
GigabitEthernet0/0/2 Unselect 1GE 32768 3 2609 10100010 1
GigabitEthernet0/0/3 Unselect 1GE 32768 4 2609 10100010 1
Partner:
--------------------------------------------------------------------------------
ActorPortName SysPri SystemID PortPri PortNo PortKey PortState
GigabitEthernet0/0/1 0 0000-0000-0000 0 0 0 10100011
GigabitEthernet0/0/2 0 0000-0000-0000 0 0 0 10100011
GigabitEthernet0/0/3 0 0000-0000-0000 0 0 0 10100011
到了這里,關于華為ensp中鏈路聚合兩種(lacp-static)模式配置方法的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!