一、鏈路捆綁分類
1、二層鏈路捆綁(交換機與交換機之間)
2、二三層鏈路捆綁(交換機與路由器之間)
3、三層鏈路捆綁(路由器與路由器之間)
二、BPDU
BPDU是網橋協議數據單元(Bride Protocal Data Unit)的英文首字母縮寫
網橋協議數據單元是一種生成樹協議問候數據包,它以可配置的間隔發出,用來在網絡的網橋間進行信息交換
三、以太網鏈路捆綁的原理
1、以太網鏈路聚合的概念
以太網鏈路聚合是指將多條以太網物理鏈路捆綁在一起成為一條邏輯鏈路,從而實現增加鏈路帶寬的目的。
2、鏈路聚合的分類
鏈路聚合分為手工模式和LACP(Link Aggregation Control Protocol 鏈路聚合控制協議)模式
四、LACP(鏈路聚合控制協議)
1、LACP的概念
LACP模式需要有鏈路聚合控制協議LACP的參與,當需要在兩個直連設備間提供一個較大的鏈路帶寬而設備支持LACP協議時,建議使用LACP模式。
2、LACP的優點
LACP模式不僅可以實現增加帶寬、提高可靠性、負載分擔的目的,而且可以提高Eth-Trunk的兼容性、提供備份功能
3、LACP的作用
LACP模式下,部分鏈路是活動鏈路,所有活動鏈路均參與數據轉發,如果某條活動鏈路故障,鏈路聚合組自動在非活動鏈路中選擇一條鏈路作為活動鏈路,參與數據轉發的鏈路數目不變
五、Eth-Trunk接口
1、Eth-Trunk接口的概念
Eth-Trunk接口是一種可以動態創建的接口,該類型接口可以綁定若干物理的以太網接口作為一個邏輯接口使用,實現增加帶寬提高靠性的目的。
2、Eth-Trunk接口的優勢
① 通Trunk接口實現負載在Eth-Trunk接口內實現流量負載擔。
② 某員接口連接物理鏈路出現故障,流量切換備用鏈路,提高整Trunk鏈路可靠性。
③ Trunk接口總帶寬各員接口帶寬
六、鏈路聚合實驗分析
要求:
PC1能ping通loopback地址
步驟如下:
1、PC1和PC2配置IP地址、子網掩碼以及網關
2、對SW1和SW2的Eth-trunk1進行LACP配置
SW1命令如下:
1 <Huawei>sys //進入系統視圖 2 [Huawei]sysname SW1 //重命名 3 [SW1]lacp priority 1000 //配置優先等級使其成為主動端
4 [SW1]int Eth-Trunk 1 //進入Eth-Trunk1視圖
5 [SW1-Eth-Trunk1]bpdu enable //配置接口發送BPDU報文到CPU處理,起放環作用 6 [SW1-Eth-Trunk1]mode lacp-static //lacp靜態模式 7 [SW1-Eth-Trunk1]int e0/0/1 //進入0/0/1接口
8 [SW1-Ethernet0/0/1]eth-trunk 1 //將接口1到3加入eth-trunk1內,注意接口屬性必須是默認Hybrid
9 [SW1-Ethernet0/0/1]int e0/0/2
10 [SW1-Ethernet0/0/2]eth-trunk 1
11 [SW1-Ethernet0/0/2]int e0/0/3
12 [SW1-Ethernet0/0/3]eth-trunk 1
13 [SW1-Ethernet0/0/3]dis eth-trunk //查看接口是否加入到eth-trunk1內 14 [SW1-Ethernet0/0/3]q 15 [SW1]int Eth-Trunk 1
16 [SW1-Eth-Trunk1]max active-linknumber 2 //配置鏈路聚合活動接口上限閾值,其他做備用
17 [SW1-Eth-Trunk1]dis eth-trunk //查看最大活躍值是否為2
SW2命令如下:
1 <Huawei>sys 2 [Huawei]sysname SW2 3 [SW2]int Eth-Trunk 1
4 [SW2-Eth-Trunk1]bpdu enable 5 [SW2-Eth-Trunk1]mode lacp-static 6 [SW2-Eth-Trunk1]trunkport Ethernet 0/0/1 to 0/0/3
7 [SW2-Eth-Trunk1]dis eth-trunk 1
8 [SW2-Eth-Trunk1]dis trunkmembership eth-trunk 1 //查看鏈路負載情況,是否是三條,其中兩條打開,一條備用關閉狀態
補充知識:負載冗余測試方法:
3、對SW1的Eth-Trunk2接口進行配置
命令如下:
1 <SW1>sys 2 SW1]int Eth-Trunk 2 //進入eth-trunk2視圖
3 [SW1-Eth-Trunk2]trunkport GigabitEthernet 0/0/1 to 0/0/2 //將接口1到2加入到eth-trunk2內
4 [SW1-Eth-Trunk2]q
4、對R1的Eth-Trunk2接口進行配置,並加入IP地址
命令如下:
1 <Huawei>sys 2 [Huawei]sysname R1 3 [R1]int Eth-Trunk 2
4 [R1-Eth-Trunk2]trunkport GigabitEthernet 0/0/0 to 0/0/1
5 [R1-Eth-Trunk2]ip add 192.168.10.1 24
5、對R1的Eth-Trunk1接口進行配置,並加入IP地址
命令如下:
1 [R1]int Eth-Trunk 1
2 [R1-Eth-Trunk1]trunkport g 0/0/2 to 0/0/3
3 [R1-Eth-Trunk1]ip add 12.0.0.1 30
6、對R1的Eth-Trunk8接口進行配置,並加入IP地址和回環地址
命令如下:
1 <Huawei>sys 2 [Huawei]sysname R2 3 [R2]int Eth-Trunk 8
4 [R2-Eth-Trunk8]trunkport g 0/0/2 to 0/0/3
5 [R2-Eth-Trunk8]ip add 12.0.0.2 30
6 [R2-Eth-Trunk8]q 7 [R2]int LoopBack 0
8 [R2-LoopBack0]ip add 2.2.2.2 32
7、對R1配置默認路由(向上指默認,向下指靜態)
命令如下:
1 [R1]ip route-static 0.0.0.0 0.0.0.0 12.0.0.2 //默認地址即為0.0.0.0 下一條地址為12.0.0.2
8、對R2配置靜態路由
1 [R2]ip route-static 192.168.10.0 24 12.0.0.1 //靜態路由 目標網段+子網掩碼+下一條地址12.0.0.1
9、測試,在PC1上ping回環地址2.2.2.2