HCNA-18 Eth-Trunk链路聚合
按目前的链路连接方式,交换机到交换机之间的主干线路默认的STP生成树一定会只保留一条,其余两条线丢弃阻塞! [s2]display stp brief MSTID Port Role STP State Protection 0 GigabitEthernet0/0/1 DESI FORWARDING NONE 0 GigabitEthernet0/0/22 ROOT FORWARDING NONE 0 GigabitEthernet0/0/23 ALTE DISCARDING NONE 0 GigabitEthernet0/0/24 ALTE DISCARDING NONE 查看S2的生成树摘要信息,GE 0/0/23和GE 0/0/24的STP状态都是丢弃,干线只有GE0/0/22是转发。 下面配置Eth-Trunk链路,增加S1到S2之间的带宽实现冗余链路! [s1]interface Eth-Trunk1 //创建Eth-Trunk 1接口 [s1-Eth-Trunk1]mode manualload-balance //配置手工负载均衡模式 [s1]interfaceGigabitEthernet 0/0/22 [s1-GigabitEthernet0/0/22]eth-trunk1 //接口加入到eth-trunk 1中 [s1-GigabitEthernet0/0/22]quit [s1]interfaceGigabitEthernet 0/0/23 [s1-GigabitEthernet0/0/23]eth-trunk1 [s1-GigabitEthernet0/0/23]quit [s2]interface Eth-Trunk 1 [s2-Eth-Trunk1]mode manualload-balance [s2]interfaceGigabitEthernet 0/0/22 [s2-GigabitEthernet0/0/22]eth-trunk1 [s2-GigabitEthernet0/0/22]quit [s2]interfaceGigabitEthernet 0/0/23 [s2-GigabitEthernet0/0/23]eth-trunk1 [s2-GigabitEthernet0/0/23]quit [s1]display eth-trunk //查看链路聚合 Eth-Trunk1's stateinformation is: WorkingMode: NORMAL Hash arithmetic: According toSIP-XOR-DIP Least Active-linknumber:1 Max Bandwidth-affected-linknumber:8 Operate status: up Number Of Up Port In Trunk: 2 -------------------------------------------------------------------------------- PortName Status Weight GigabitEthernet0/0/22 Up 1 GigabitEthernet0/0/23 Up 1 查看到GE0/0/22和GE 0/0/23已经加入到Eth-Trunk1中,并且处于UP状态。NORMAL为正常模式(手工负载均衡) [s1]display interfaceEth-Trunk 1 //查看Eth-Trunk 1接口信息 Eth-Trunk1 current state :UP Line protocol current state: UP Description: Switch Port, PVID : 1, Hash arithmetic : According toSIP-XOR-DIP,Maximal BW: 2G, Current BW: 2G, The Maximum Frame Length is 9216 IP Sending Frames' Format isPKTFMT_ETHNT_2, Hardware address is 4c1f-cc81-4bf4 Current system time:2020-05-16 18:49:28-08:00 Input bandwidth utilization : 0% Output bandwidth utilization : 0% ----------------------------------------------------- PortName Status Weight ----------------------------------------------------- GigabitEthernet0/0/22 UP 1 GigabitEthernet0/0/23 UP 1 ----------------------------------------------------- The Number of Ports in Trunk: 2 The Number of UP Ports inTrunk : 2 查看到当前带宽为2G,GE 0/0/22+GE 0/0/23之和。 此时再看STP状态 [s1]display stp brief MSTID Port Role STP State Protection 0 GigabitEthernet0/0/1 DESI FORWARDING NONE 0 GigabitEthernet0/0/24 DESI FORWARDING NONE 0 Eth-Trunk1 DESI FORWARDING NONE [s2]display stp brief MSTID Port Role STP State Protection 0 GigabitEthernet0/0/1 DESI FORWARDING NONE 0 GigabitEthernet0/0/24 ALTE DISCARDING NONE 0 Eth-Trunk1 ROOT FORWARDING NONE 目前的结果是S1和S2的GE 0/0/22和GE0/0/23的接口被捆绑成一个Eth-Trunk接口,并且处理转发状态。 配置LACP模式Eth-Trunk 目前22+23接口组成的eth-trunk 1若其中一条链路出现故障,只有一条线路正常工作则无法保障带宽,现将三条链路进行捆绑,并采用LACP模式配置,实现两条链路同时转发数据,另一条链路作为备份链路,若其中一条出现故障则第三条备份链路实现立即代替转发。 [s1]interface Eth-Trunk 1 [s1-Eth-Trunk1]modelacp-static //配置模式为静态LACP Error: Error in changingtrunk working mode. There is(are) port(s) in the trunk. 发现报错,无法更改模式,注意!需要先删除加入了eth-trunk 1中的接口后再更改。 [s1]interfaceGigabitEthernet 0/0/22 [s1-GigabitEthernet0/0/22]undoeth-trunk //接口不加入eth-trunk [s1-GigabitEthernet0/0/22]quit [s1]interfaceGigabitEthernet 0/0/23 [s1-GigabitEthernet0/0/23]undoeth-trunk [s1-GigabitEthernet0/0/23]quit [s1]interface Eth-Trunk 1 [s1-Eth-Trunk1]modelacp-static //配置模式为静态LACP [s1-Eth-Trunk1]quit [s1]interfaceGigabitEthernet 0/0/22 [s1-GigabitEthernet0/0/22]eth-trunk1 [s1-GigabitEthernet0/0/22]quit [s1]interfaceGigabitEthernet 0/0/23 [s1-GigabitEthernet0/0/23]eth-trunk1 [s1-GigabitEthernet0/0/23]quit [s1]interfaceGigabitEthernet 0/0/24 [s1-GigabitEthernet0/0/24]eth-trunk1 [s1-GigabitEthernet0/0/24]quit [s2]interfaceGigabitEthernet 0/0/22 [s2-GigabitEthernet0/0/22]undoeth-trunk [s2-GigabitEthernet0/0/22]quit [s2]interfaceGigabitEthernet 0/0/23 [s2-GigabitEthernet0/0/23]undoeth-trunk [s2-GigabitEthernet0/0/23]quit [s2]interface Eth-Trunk 1 [s2-Eth-Trunk1]modelacp-static [s2-Eth-Trunk1]quit [s2]interfaceGigabitEthernet 0/0/22 [s2-GigabitEthernet0/0/22]eth-trunk1 [s2-GigabitEthernet0/0/22]quit [s2]interfaceGigabitEthernet 0/0/23 [s2-GigabitEthernet0/0/23]eth-trunk1 [s2-GigabitEthernet0/0/23]quit [s2]interfaceGigabitEthernet 0/0/24 [s2-GigabitEthernet0/0/24]eth-trunk1 [s2-GigabitEthernet0/0/24]quit 更改好模式,并把接口加入Eth-Trunk 1后查看Eth-Trunk 1接口状态。 [s1]display eth-trunk 1 Eth-Trunk1's stateinformation is: Local: LAG ID: 1 WorkingMode: STATIC Preempt Delay: Disabled Hash arithmetic: According toSIP-XOR-DIP System Priority: 32768 System ID: 4c1f-cc81-4bf4 Least Active-linknumber:1 Max Active-linknumber: 8 Operate status: up Number Of Up Port In Trunk: 3 -------------------------------------------------------------------------------- ActorPortName Status PortType PortPri PortNo PortKey PortStateWeight GigabitEthernet0/0/22 Selected1GE 32768 23 305 10111100 1 GigabitEthernet0/0/23 Selected1GE 32768 24 305 10111100 1 GigabitEthernet0/0/24 Selected1GE 32768 25 305 10111100 1 Partner: -------------------------------------------------------------------------------- ActorPortName SysPri SystemID PortPri PortNo PortKey PortState GigabitEthernet0/0/22 32768 4c1f-ccde-37a2 32768 23 305 10111100 GigabitEthernet0/0/23 32768 4c1f-ccde-37a2 32768 24 305 10111100 GigabitEthernet0/0/24 32768 4c1f-ccde-37a2 32768 25 305 10111100 可以看到三条链路全部是活动的(Selected) 下面把S1 SystemPriority系统优先级改成100,让其成为主动端,注意值越小,优先级越高。当配置完成主动端后,两端交换机会比较优先级从而选出主动端交换机,并且两端的Eth-Trunk链路会一致选择与主动端一样的端口转发数据。 [s1]lacp priority 100 [s1]display eth-trunk 1 Eth-Trunk1's stateinformation is: Local: LAG ID: 1 WorkingMode: STATIC Preempt Delay: Disabled Hash arithmetic: According toSIP-XOR-DIP System Priority: 100 System ID: 4c1f-cc81-4bf4 Least Active-linknumber:1 Max Active-linknumber: 8 Operate status: up Number Of Up Port In Trunk: 3 -------------------------------------------------------------------------------- ActorPortName Status PortType PortPri PortNo PortKey PortStateWeight GigabitEthernet0/0/22 Selected1GE 32768 23 305 10111100 1 GigabitEthernet0/0/23 Selected1GE 32768 24 305 10111100 1 GigabitEthernet0/0/24 Selected1GE 32768 25 305 10111100 1 …… 此时由于没有配置Eth-Trunk接口上限阈值,所以仍是显示三个接口都为活动状态;下面配置上限阈值。 [s1]interface Eth-Trunk 1 [s1-Eth-Trunk1]maxactive-linknumber 2 //配置最大活动链路数为2 [s1-Eth-Trunk1]quit [s1]display eth-trunk 1 Eth-Trunk1's stateinformation is: Local: LAG ID: 1 WorkingMode: STATIC Preempt Delay: Disabled Hash arithmetic: According toSIP-XOR-DIP System Priority: 100 System ID: 4c1f-cc81-4bf4 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/22 Selected1GE 32768 23 305 10111100 1 GigabitEthernet0/0/23 Selected1GE 32768 24 305 10111100 1 GigabitEthernet0/0/24 Unselect1GE 32768 25 305 10100000 1 …… 系统自动选举出了22和23接口成为活动链路 下面通过配置LACP接口优先级来手动设定活动链路23和24 [s1]interfaceGigabitEthernet 0/0/23 [s1-GigabitEthernet0/0/23]lacppriority 100 //配置接口LACP优先级为100 [s1-GigabitEthernet0/0/23]quit [s1]interfaceGigabitEthernet 0/0/24 [s1-GigabitEthernet0/0/24]lacppriority 100 [s1-GigabitEthernet0/0/24]quit [s1]interface Eth-Trunk 1 [s1-Eth-Trunk1]shutdown [s1-Eth-Trunk1]undo shutdown [s1-Eth-Trunk1]quit [s1]display eth-trunk 1 Eth-Trunk1's stateinformation is: Local: LAG ID: 1 WorkingMode: STATIC Preempt Delay: Disabled Hash arithmetic: According toSIP-XOR-DIP System Priority: 100 System ID: 4c1f-cc81-4bf4 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/22 Unselect 1GE 32768 23 305 10100000 1 GigabitEthernet0/0/23 Selected1GE 100 24 305 10111100 1 GigabitEthernet0/0/24 Selected1GE 100 25 305 10111100 1 …… [s2]display eth-trunk 1 Eth-Trunk1's stateinformation is: Local: LAG ID: 1 WorkingMode: STATIC Preempt Delay: Disabled Hash arithmetic: According toSIP-XOR-DIP System Priority: 32768 System ID: 4c1f-ccde-37a2 Least Active-linknumber:1 Max Active-linknumber: 8 Operate status: up Number Of Up Port In Trunk: 2 -------------------------------------------------------------------------------- ActorPortName Status PortType PortPri PortNo PortKey PortStateWeight GigabitEthernet0/0/22 Unselect 1GE 32768 23 305 10110000 1 GigabitEthernet0/0/23 Selected1GE 32768 24 305 10111100 1 GigabitEthernet0/0/24 Selected1GE 32768 25 305 10111100 1 …… 此时S1和S2的Eth-Trunk 1活动链路成功选择为23和24 注意配置最大阈值和LACP接口优先级时,只需要在配置的主动端交换机上配置即可。
|