Print

H3C S5560X-EI 采集 EAA 方式实现链路聚合成员端口不抢占配置案例

2020-06-05 发表

组网及说明


两台 S5560X-EI 交换机通过聚合口 Bridge-Aggregation23 互联(成员接口分别均为 G1/0/22 和 G1/0/23 ),如下图所示:



需求1:缺省 Bridge-Aggregation23 中,仅一条链路承担业务数据转发;若承担业务转发的链路 down ,业务流量自动由另一条成员链路承担转发。


需求2:当 需求1 中的故障链路恢复后,需要确保业务流量不自动切换回已恢复的链路。仅当当前承担业务转发的链路 down 后,业务流量才进行切换。减少流量切换次数。




配置步骤


对于需求1,可通过部署聚合最大选中端口数量的方式解决,即配置 link-aggregation selected-port maximum 1;

对于需求2,当故障线路恢复后,流量不切换到恢复的链路中转发,无论设备采用静态聚合还是动态聚合,均可采用EAA方式,自动根据聚合成员接口的状态,调整聚合接口优先级,进而确保选中的成员接口不出现抢占的情况。


采用动态聚合模式配置( S5560X-EI_1 与 S5560X-EI_2 下列关键配置相同):

   1.    关键配置如下

     # 

     lacp system-priority 1024  // 其中一台设备部署该命令

    #

     interface Bridge-Aggregation23

     link-aggregation mode dynamic

     link-aggregation selected-port maximum 1 

    #

     interface GigabitEthernet1/0/22

     port link-mode bridge

     link-aggregation port-priority 40000

     lacp period short port

     link-aggregation group 23 

    #

     interface GigabitEthernet1/0/23

     port link-mode bridge

     link-aggregation port-priority 60000

     lacp period short

     port link-aggregation group 23 

    #

     track 22 interface GigabitEthernet1/0/22

     track 23 interface GigabitEthernet1/0/23 

    #

     rtm cli-policy 22down

     event track 22 state negative

     action 0 cli system-view

     action 1 cli int g 1/0/22

     action 2 cli link-agg port-priorit 60000

     action 3 cli quit 

     action 4 cli int g 1/0/23

     action 5 cli link-agg port-priorit 40000

     action 6 cli quit

     commit 

     user-role network-admin 

    #

     rtm cli-policy 23down

     event track 23 state negative

     action 0 cli system-view

     action 1 cli int g 1/0/22

     action 2 cli link-agg port-priorit 40000

     action 3 cli quit 

     action 4 cli int g 1/0/23 

     action 5 cli link-agg port-priorit 60000 

     action 6 cli quit 

     commit   // commit 为开始 rtm cli-policy 策略命令,在display current-configuration 中不显示

     user-role network-admin 

    # 

    两端 S5560X-EI 交换机采用上述方式部署后,缺省 G1/0/22 为选中端口,流量转发如图1。

    [S5560X-EI_1]display link-aggregation verbose bridge-aggregation 23 

    ......

      Aggregate Interface: Bridge-Aggregation23

     Creation Mode: Manual

     Aggregation Mode: Dynamic

     Loadsharing Type: Shar Management 

     VLANs: None

     System ID: 0x400, 0868-8d3c-c74c

     Local:

     Port Status Priority Index Oper-Key Flag

     GE1/0/22(R) S 40000 4 2 {ABCDEF}

     GE1/0/23 U 60000 3 2 {ABCD} 

     Remote:

     Actor Priority Index Oper-Key SystemID Flag

     GE1/0/22 40000 2 1 0x8000, 9ce8-956a-f9e3 {ABCDEF}

     GE1/0/23 60000 1 1 0x8000, 9ce8-956a-f9e3 {ABCD}


图1


    2.    当 G1/0/22 链路故障 Down后,流量自动切换到G1/0/23接口转发,且触发CLI policy 22down策略,自动执行修改聚合接口优先级的策略。

     此时流量转发如图2所示。

    %Jul 1 10:57:02:144 2013 S5560X-EI_1 IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet1/0/22 changed to down.

     ...... 

    %Jul 1 10:57:02:426 2013 S5560X-EI_1  RTM/6/RTM_POLICY: CLI policy 22down is running successfully. 


    [S5560X-EI_1]display link-aggregation verbose bridge-aggregation 23 

    ......

      Aggregate Interface: Bridge-Aggregation23

     Creation Mode: Manual

     Aggregation Mode: Dynamic

     Loadsharing Type: Shar Management 

     VLANs: None

     System ID: 0x400, 0868-8d3c-c74c

     Local:

     Port Status Priority Index Oper-Key Flag

     GE1/0/22 U 60000 4 2 {ABC}

     GE1/0/23(R) S 40000 3 2 {ABCDEF} 

     Remote:

     Actor Priority Index Oper-Key SystemID Flag

     GE1/0/22 40000 2 1 0x8000, 9ce8-956a-f9e3 {ABEF}

     GE1/0/23 40000 1 1 0x8000, 9ce8-956a-f9e3 {ABCDEF}

    

图2


    3.    当 G1/0/22 接口链路恢复,及G1/0/22接口 UP 后,因为此时 G1/0/23 成员聚合接口优先级为40000,G1/0/22 成员聚合接口优先级为60000,且 link-aggregation selected-port maximum 1 ,因此 G1/0/23 仍然保持 Select 状态。G1/0/22不会因为恢复 UP ,而抢占 Select 状态。此时流量转发如图3所示。


    %Jul 1 10:58:11:263 2013 S5560X-EI_1  IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet1/0/22 changed to up.


    [S5560X-EI_1]display link-aggregation verbose bridge-aggregation 23 

    ......

      Aggregate Interface: Bridge-Aggregation23

     Creation Mode: Manual

     Aggregation Mode: Dynamic

     Loadsharing Type: Shar Management 

     VLANs: None

     System ID: 0x400, 0868-8d3c-c74c

     Local:

     Port Status Priority Index Oper-Key Flag

     GE1/0/22 U 60000 4 2 {ABC}

     GE1/0/23(R) S 40000 3 2 {ABCDEF} 

     Remote:

     Actor Priority Index Oper-Key SystemID Flag

     GE1/0/22 60000 2 1 0x8000, 9ce8-956a-f9e3 {ABCD}

     GE1/0/23 40000 1 1 0x8000, 9ce8-956a-f9e3 {ABCDEF} 


图3


    4.    当G1/0/23 链路故障 Down后,流量自动切换到G1/0/22接口转发,且触发CLI policy 23down策略,自动执行修改聚合接口优先级的策略。

     此时流量转发如图4所示。

    %Jul 1 10:59:21:993 2013 S5560X-EI_1 IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet1/0/23 changed to down. 

    ...... 

    %Jul 1 10:59:22:326 2013 S5560X-EI_1 RTM/6/RTM_POLICY: CLI policy 23down is running successfully.


    [S5560X-EI_1]display link-aggregation verbose bridge-aggregation 23 

    ......

      Aggregate Interface: Bridge-Aggregation23

     Creation Mode: Manual

     Aggregation Mode: Dynamic

     Loadsharing Type: Shar Management 

     VLANs: None

     System ID: 0x400, 0868-8d3c-c74c

     Local:

     Port Status Priority Index Oper-Key Flag

     GE1/0/22(R) S 40000 4 2 {ABCDEF}

     GE1/0/23 U 60000 3 2 {ABC} 

     Remote:

     Actor Priority Index Oper-Key SystemID Flag

     GE1/0/22 40000 2 1 0x8000, 9ce8-956a-f9e3 {ABCDEF}

     GE1/0/23 40000 1 1 0x8000, 9ce8-956a-f9e3 {ABEF}


图4


    5.    当 G1/0/23 接口链路恢复,及G1/0/23接口 UP 后,因为此时 G1/0/22 成员聚合接口优先级为40000,G1/0/23 成员聚合接口优先级为60000,且 link-aggregation selected-port maximum 1 ,因此 G1/0/22 仍然保持 Select 状态。G1/0/23不会因为恢复 UP ,而抢占 Select 状态。此时流量转发如图5所示。


    %Jul 1 11:00:07:122 2013 S5560X_EI_1 IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet1/0/23 changed to up.


    [S5560X-EI_1]display link-aggregation verbose bridge-aggregation 23 

    ......

      Aggregate Interface: Bridge-Aggregation23

     Creation Mode: Manual

     Aggregation Mode: Dynamic

     Loadsharing Type: Shar Management 

     VLANs: None

     System ID: 0x400, 0868-8d3c-c74c

     Local:

     Port Status Priority Index Oper-Key Flag

     GE1/0/22(R) S 40000 4 2 {ABCDEF}

     GE1/0/23 U 60000 3 2 {ABCD} 

     Remote:

     Actor Priority Index Oper-Key SystemID Flag

     GE1/0/22 40000 2 1 0x8000, 9ce8-956a-f9e3 {ABCDEF}

     GE1/0/23 60000 1 1 0x8000, 9ce8-956a-f9e3 {ABCD}


图5



采用静态聚合模式配置( S5560X-EI_1 与 S5560X-EI_2 下列关键配置相同):

   1.    关键配置如下

    #

     interface Bridge-Aggregation23

     link-aggregation selected-port maximum 1 

    #

     interface GigabitEthernet1/0/22

     port link-mode bridge

     link-aggregation port-priority 40000

     link-aggregation group 23 

    #

     interface GigabitEthernet1/0/23

     port link-mode bridge

     link-aggregation port-priority 60000

     port link-aggregation group 23 

    #

     track 22 interface GigabitEthernet1/0/22

     track 23 interface GigabitEthernet1/0/23 

    #

     rtm cli-policy 22down

     event track 22 state negative

     action 0 cli system-view

     action 1 cli int g 1/0/22

     action 2 cli link-agg port-priorit 60000

     action 3 cli quit 

     action 4 cli int g 1/0/23

     action 5 cli link-agg port-priorit 40000

     action 6 cli quit

     commit 

     user-role network-admin 

    #

     rtm cli-policy 23down

     event track 23 state negative

     action 0 cli system-view

     action 1 cli int g 1/0/22

     action 2 cli link-agg port-priorit 40000

     action 3 cli quit 

     action 4 cli int g 1/0/23 

     action 5 cli link-agg port-priorit 60000 

     action 6 cli quit 

     commit   // commit 为开始 rtm cli-policy 策略命令,在display current-configuration 中不显示

     user-role network-admin 

    # 

    两端 S5560X-EI 交换机采用上述方式部署后,缺省 G1/0/22 为选中端口,流量转发如图1。  

     [S5560X-EI_1]display link-aggregation verbose bridge-aggregation 23 

        ......

        Aggregate Interface: Bridge-Aggregation23

        Aggregation Mode: Static

        Loadsharing Type: Shar

        Management VLANs: None 

        Port Status Priority Oper-Key

         GE1/0/22(R) S 40000 2

         GE1/0/23 U 60000 2   


图1


   2.    当 G1/0/22 链路故障 Down后,流量自动切换到G1/0/23接口转发,且触发CLI policy 22down策略,自动执行修改聚合接口优先级的策略。

     此时流量转发如图2所示。

    %Jul 1 11:37:05:578 2013 S5560X-EI_1 IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet1/0/22 changed to down. 


     %Jul 1 11:37:05:797 2013  S5560X-EI_1 RTM/6/RTM_POLICY: CLI policy 22down is running successfully. 


    [S5560X-EI_1]display link-aggregation verbose bridge-aggregation 23

    ......

    Aggregate Interface: Bridge-Aggregation23

    Aggregation Mode: Static

    Loadsharing Type: Shar

    Management VLANs: None

    Port Status Priority Oper-Key

    GE1/0/22 U 60000 2

    GE1/0/23(R) S 40000 2   


图2


    3.    当 G1/0/22 接口链路恢复,及G1/0/22接口 UP 后,因为此时 G1/0/23 成员聚合接口优先级为40000,G1/0/22 成员聚合接口优先级为60000,且 link-aggregation selected-port maximum 1 ,因此 G1/0/23 仍然保持 Select 状态。G1/0/22不会因为恢复 UP ,而抢占 Select 状态。此时流量转发如图3所示。 

    %Jul 1 11:37:18:720 2013  S5560X-EI_1 IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet1/0/22 changed to up.


    [S5560X-EI_1]display link-aggregation verbose bridge-aggregation 23

    ......

    Aggregate Interface: Bridge-Aggregation23

    Aggregation Mode: Static

    Loadsharing Type: Shar

    Management VLANs: None

    Port Status Priority Oper-Key

    GE1/0/22 U 60000 2

    GE1/0/23(R) S 40000 2   


图3


    4.    当G1/0/23 链路故障 Down后,流量自动切换到G1/0/22接口转发,且触发CLI policy 23down策略,自动执行修改聚合接口优先级的策略。

     此时流量转发如图4所示。

    %Jul 1 11:37:39:513 2013 S5560X-EI_1 IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet1/0/23 changed to down 


     %Jul 1 11:37:39:790 2013  S5560X-EI_1   RTM/6/RTM_POLICY: CLI policy 23down is running successfully.

    

    [S5560X-EI_1]display link-aggregation verbose bridge-aggregation 23

    ......

    Aggregate Interface: Bridge-Aggregation23

    Aggregation Mode: Static

    Loadsharing Type: Shar

    Management VLANs: None

    Port Status Priority Oper-Key 

    GE1/0/22(R) S 40000 2 

    GE1/0/23 U 60000 2  


图4


    5.    当 G1/0/23 接口链路恢复,及G1/0/23接口 UP 后,因为此时 G1/0/22 成员聚合接口优先级为40000,G1/0/23 成员聚合接口优先级为60000,且 link-aggregation selected-port maximum 1 ,因此 G1/0/22 仍然保持 Select 状态。G1/0/23不会因为恢复 UP ,而抢占 Select 状态。此时流量转发如图5所示。 

    %Jul 1 11:38:02:234 2013 S5560X-EI_1 IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet1/0/23 changed to up.  


     [S5560X-EI_1]display link-aggregation verbose bridge-aggregation 23 

        ......

        Aggregate Interface: Bridge-Aggregation23

        Aggregation Mode: Static

        Loadsharing Type: Shar

        Management VLANs: None 

        Port Status Priority Oper-Key

         GE1/0/22(R) S 40000 2

         GE1/0/23 U 60000 2    


图5



配置关键点


采用EAA方式,管理员可让设备实现根据既定的触发条件,自动执行指令,实现一定程度的设备智能化。