2 三層鏈路聚合
在三層交換機上,可以把接口變成三層的路由端口。華為的S系列交換機(S3700、S5700)是三層交換機,但不能把接口變成三層接口,
只能使用vlanif接口作為三層接口。所以S系列的交換機是軟三層,並不是硬三層的交換機。用undo portswitch把接口變成三層接口。
[Huawei]interface Eth-Trunk 1 [Huawei-Eth-Trunk1]undo portswitch [Huawei-Eth-Trunk1]ip address ? //s5700,軟3層,要通過vlanif 來實現3層不同vlan通信 ^ Error: Unrecognized command found at '^' position.
三層鏈路聚合拓撲結構圖
1 定義鏈路聚合組eth-trunk 1,開啟三層鏈路聚合
[Huawei]sysname AR1 [AR1]interface Eth-Trunk 1 //定義聚合組1 [AR1-Eth-Trunk1]undo portswitch //開啟三層 [AR1-Eth-Trunk1]ip address 12.1.1.1 24 //配置ip地址 [Huawei]sysname AR2 [AR2]interface Eth-Trunk 1 [AR2-Eth-Trunk1]undo portswitch [AR2-Eth-Trunk1]ip address 12.1.1.2 24
查看結果
[AR1]display ip interface brief *down: administratively down ^down: standby (l): loopback (s): spoofing The number of interface that is UP in Physical is 1 The number of interface that is DOWN in Physical is 2 The number of interface that is UP in Protocol is 1 The number of interface that is DOWN in Protocol is 2 Interface IP Address/Mask Physical Protocol Eth-Trunk1 12.1.1.1/24 down down Ethernet0/0/8 unassigned down down NULL0 unassigned up up(s)
2 模式為靜態lacp
[AR1]interface Eth-Trunk 1 [AR1-Eth-Trunk1]mode lacp-static [AR2]interface Eth-Trunk 1 [AR2-Eth-Trunk1]mode lacp-static [AR1-Eth-Trunk1]display eth-trunk 1 Eth-Trunk1's state information is: Local: LAG ID: 1 WorkingMode: STATIC Preempt Delay: Disabled Hash arithmetic: According to SIP-XOR-DIP System Priority: 32768 System ID: 00e0-fcba-56bf 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 Partner: --------------------------------------------------------------------- ActorPortName SysPri SystemID PortPri PortNo PortKey PortState
狀態為靜態的lacp模式,但鏈路的狀態是down
3 把接口加入鏈路聚合組1
[AR1-Eth-Trunk1]display interface brief InUti/OutUti: input utility/output utility Interface PHY Protocol InUti OutUti inErrors outErrors Eth-Trunk1 down down 0% 0% 0 0 Ethernet0/0/0 up up 0% 0% 0 0 Ethernet0/0/1 up up 0% 0% 0 0 Ethernet0/0/2 up up 0% 0% 0 0 Ethernet0/0/3 down down 0% 0% 0 0 [AR1-Eth-Trunk1]trunkport Ethernet 0/0/0 to 0/0/2 Info: This operation may take a few seconds. Please wait for a moment... Error: The layer-2 interface can not add into a layer-3 trunk. [AR1]interface Ethernet 0/0/0 [AR1-Ethernet0/0/0]undo portswitch [AR1-Ethernet0/0/0]eth-trunk 1 Info: This operation may take a few seconds. Please wait for a moment...done. [AR1]interface Ethernet 0/0/1 [AR1-Ethernet0/0/1]undo portswitch //此處不支持三層路由端口 ^ Error: Unrecognized command found at '^' position. [AR1-Ethernet0/0/1]display interface brief PHY: Physical *down: administratively down (l): loopback (s): spoofing (b): BFD down ^down: standby (e): ETHOAM down (d): Dampening Suppressed InUti/OutUti: input utility/output utility Interface PHY Protocol InUti OutUti inErrors outErrors Eth-Trunk1 up up 0% 0% 0 0 Ethernet0/0/0 up up 0% 0% 0 0 Ethernet0/0/1 up up 0% 0% 0 0 Ethernet0/0/2 up up 0% 0% 0 0 [AR1]dis interface Ethernet 0/0/0 //查看網絡接口的信息 Ethernet0/0/0 current state : UP Line protocol current state : UP Description:HUAWEI, AR Series, Ethernet0/0/0 Interface Route Port,The Maximum Transmit Unit is 1500 IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 00e0-fcba-56bf Last physical up time : 2020-06-03 10:19:44 UTC-08:00 Last physical down time : 2020-06-03 10:19:42 UTC-08:00 Current system time: 2020-06-03 10:31:44-08:00 Port Mode: COMMON COPPER Speed : 100, Loopback: NONE Duplex: FULL, Negotiation: ENABLE Mdi : AUTO [AR1]dis interface Ethernet 0/0/1 //查看網絡接口的信息 Ethernet0/0/1 current state : UP Line protocol current state : UP Description:HUAWEI, AR Series, Ethernet0/0/1 Interface Switch Port, PVID : 1, TPID : 8100(Hex), The Maximum Frame Length is 1628 IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 00e0-fcba-56bf Last physical up time : 2020-06-03 09:51:57 UTC-08:00 Last physical down time : 2020-06-03 09:51:50 UTC-08:00 Current system time: 2020-06-03 10:32:53-08:00 Port Mode: COMMON COPPER Speed : 100, Loopback: NONE Duplex: FULL, Negotiation: ENABLE Mdi : AUTO
換成AR3260路由器,默認的AR201沒有多個GE接口,可以在視圖中添加路由器支持的接口卡
執行上面的操作,創建eth-trunk 聚合組1 ,並加入接口0/1/2
[AR3-Eth-Trunk1]trunkport GigabitEthernet 0/0/0 to 0/0/2 Info: This operation may take a few seconds. Please wait for a moment...done. [AR4-Eth-Trunk1]trunkport GigabitEthernet 0/0/0 to 0/0/2 Info: This operation may take a few seconds. Please wait for a moment...done. [AR3-Eth-Trunk1]display eth-trunk 1 Eth-Trunk1's state information is: Local: LAG ID: 1 WorkingMode: STATIC Preempt Delay: Disabled Hash arithmetic: According to SIP-XOR-DIP System Priority: 32768 System ID: 00e0-fcde-04d9 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/0 Selected 1GE 32768 1 305 10111100 1 GigabitEthernet0/0/1 Selected 1GE 32768 2 305 10111100 1 GigabitEthernet0/0/2 Selected 1GE 32768 3 305 10111100 1 Partner: --------------------------------------------------------------------- ActorPortName SysPri SystemID PortPri PortNo PortKey PortState GigabitEthernet0/0/0 32768 00e0-fcb3-560a 32768 1 305 10111100 GigabitEthernet0/0/1 32768 00e0-fcb3-560a 32768 2 305 10111100 GigabitEthernet0/0/2 32768 00e0-fcb3-560a 32768 3 305 10111100 [AR4-Eth-Trunk1]display interface brief PHY: Physical *down: administratively down (l): loopback (s): spoofing (b): BFD down ^down: standby (e): ETHOAM down (d): Dampening Suppressed InUti/OutUti: input utility/output utility Interface PHY Protocol InUti OutUti inErrors outErrors Eth-Trunk1 up up 0% 0% 0 0 GigabitEthernet0/0/0 up up 0% 0% 0 0 GigabitEthernet0/0/1 up up 0% 0% 0 0 GigabitEthernet0/0/2 up up 0% 0% 0 0 NULL0 up up(s) 0% 0% 0 0
查看接口的狀態
[AR3]display ip interface brief *down: administratively down ^down: standby (l): loopback (s): spoofing The number of interface that is UP in Physical is 2 The number of interface that is DOWN in Physical is 0 The number of interface that is UP in Protocol is 2 The number of interface that is DOWN in Protocol is 0 Interface IP Address/Mask Physical Protocol Eth-Trunk1 12.1.1.1/24 up up NULL0 unassigned up up(s)
---不是所有路由器都可以執行聚合捆綁
4 設置路由器上限活動接口閾值為2
[AR3-Eth-Trunk1]max active-linknumber 2 [AR3-Eth-Trunk1]display eth-trunk 1 Eth-Trunk1's state information is: Local: LAG ID: 1 WorkingMode: STATIC Preempt Delay: Disabled Hash arithmetic: According to SIP-XOR-DIP System Priority: 32768 System ID: 00e0-fcde-04d9 Least Active-linknumber: 1 Max Active-linknumber: 2 Operate status: up Number Of Up Port In Trunk: 2
最大兩個轉發鏈路,一個備份鏈路。根據接口的優先級和端口來選出
5 設置系統的優先級
[AR3]lacp priority 100 [AR3]display eth-trunk 1 Eth-Trunk1's state information is: Local: LAG ID: 1 WorkingMode: STATIC Preempt Delay: Disabled Hash arithmetic: According to SIP-XOR-DIP System Priority: 100 System ID: 00e0-fcde-04d9 Least Active-linknumber: 1 Max Active-linknumber: 2 Operate status: up Number Of Up Port In Trunk: 2
6 定義接口的優先級
[AR3]interface GigabitEthernet 0/0/1 [AR3-GigabitEthernet0/0/1]lacp priority 100 [AR3]interface GigabitEthernet 0/0/2 [AR3-GigabitEthernet0/0/2]lacp priority 100 [AR3]display eth-trunk 1 Eth-Trunk1's state information is: Local: LAG ID: 1 WorkingMode: STATIC Preempt Delay: Disabled Hash arithmetic: According to SIP-XOR-DIP System Priority: 100 System ID: 00e0-fcde-04d9 Least Active-linknumber: 1 Max Active-linknumber: 2 Operate status: up Number Of Up Port In Trunk: 2 --------------------------------------------------------------------- ActorPortName Status PortType PortPri PortNo PortKey PortState Weight GigabitEthernet0/0/0 Selected 1GE 32768 1 305 10111100 1 GigabitEthernet0/0/1 Selected 1GE 100 2 305 10111100 1 GigabitEthernet0/0/2 Unselect 1GE 100 3 305 10100000 1
7 開啟搶占功能
[AR3]interface Eth-Trunk 1 [AR3-Eth-Trunk1]lacp preempt enable [AR3]display eth-trunk 1 Eth-Trunk1's state information is: Local: LAG ID: 1 WorkingMode: STATIC Preempt Delay Time: 30 Hash arithmetic: According to SIP-XOR-DIP System Priority: 100 System ID: 00e0-fcde-04d9 Least Active-linknumber: 1 Max Active-linknumber: 2 Operate status: up Number Of Up Port In Trunk: 2 --------------------------------------------------------------------- ActorPortName Status PortType PortPri PortNo PortKey PortState Weight GigabitEthernet0/0/0 Selected 1GE 32768 1 305 10111100 1 GigabitEthernet0/0/1 Selected 1GE 100 2 305 10111100 1 GigabitEthernet0/0/2 Unselect 1GE 100 3 305 10100000 1
8 設置負載分擔方式
[AR3-Eth-Trunk1]load-balance src-dst-mac
[AR4-Eth-Trunk1]load-balance src-dst-mac
9 測試三層聚合鏈路的通信
可以看到三層的eth-trunk 可以通信,並且功能可以當作一個物理接口的功能,可以運行路由協議。