一、什么是端口聚合
端口聚合是將多個物理端口捆綁在一起,形成一個邏輯鏈路,以實現帶寬增加、提高冗余和負載均衡的技術。端口聚合,也稱為以太通道(Ethernet Channel),主要用于交換機之間的連接。在具有多條冗余鏈路的情況下,基本生成樹協議(STP)會關閉部分鏈路以避免二層環路,而端口聚合則允許同時使用這些鏈路。這種技術將多個物理端口聯合起來作為單一邏輯通道,交換機將其視為一個端口,從而實現對多物理鏈路的并行使用。
二、聚合模式
1.靜態匯聚
靜態LACP匯聚由用戶手工配置,不允許系統自動添加或刪除匯聚組中的端口。匯聚組中必須至少包含一個端口,當匯聚組只有一個端口時,只能通過刪除匯聚組的方式將該端口從匯聚組中刪除。
2.動態匯聚
動態LACP匯聚是一種系統自動創建/刪除的匯聚,不允許用戶增加或刪除動態LACP匯聚中的成員端口。只有速率和雙工屬性相同、連接到同一個設備、有相同基本配置的端口才能被動態匯聚在一起。即使只有一個端口也可以創建動態聚,此時為單端口匯聚。
三、LACP配置
1、指定聚合協議
Switch(config-if-range)#channel-protocol lacp
2.設置聚合模式?
#這里設置的是LACP主動模式
Switch(config-if-range)#channel-group1 mode active
3、將聚合通道配置為trunk
Switch(config)#interface port-channel 1
Switch(config-if)#swithport mode trunk?
4.查看端口匯聚情況?
Switch#show ether channel summary
5、將接口加入到匯聚組
#進入接口
Switch(config)interface fo/20?
#配置匯聚協議
switch(config-if)channel-protocol lacp#配置匯聚組模式
Switch(config-if)channel-group 1 mode active
Switch(config)# interface range fastEthernet 0/1 - 2
Switch(config-if-range)#channel-group 1 mode on?
四、實驗
?
實驗要求:switch11和swich12配置通過LACP配置鏈路聚合
switch11配置:
Switch>enable
Switch#configure terminal
Switch(config)#int f0/1
Switch(config-if)#channel-protocol lacp
Switch(config-if)#channel-group 1 mode active
Switch(config)#int f1/1
Switch(config-if)#channel-protocol lacp
Switch(config-if)#channel-group 1 mode active
Switch(config)#interface port-channel 1
Switch(config-if)#switchport mode trunk
Switch(config-if)#switchport trunk allowed vlan all
switch12配置:
Switch>enable
Switch#configure terminal
Switch(config)#int f0/1
Switch(config-if)#channel-protocol lacp
Switch(config-if)#channel-group 1 mode active
Switch(config)#int f1/1
Switch(config-if)#channel-protocol lacp
Switch(config-if)#channel-group 1 mode active
Switch(config)#interface port-channel 1
Switch(config-if)#switchport mode trunk
Switch(config-if)#switchport trunk allowed vlan all