• ensp 链路聚合--lacp模式(三层链路聚合)


    2 三层链路聚合

    在三层交换机上,可以把接口变成三层的路由端口。华为的S系列交换机(S3700S5700)是三层交换机,但不能把接口变成三层接口,

    只能使用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 可以通信,并且功能可以当作一个物理接口的功能,可以运行路由协议。

    3 小结

  • 相关阅读:
    Restful levels &HATEOAS基本介绍~
    跨源资源共享(CORS)概念、实现(用Spring)、起源介绍
    Ubuntu下math库函数编译时未定义问题的解决
    常用软件清单~
    JetBrains PyCharm 专业版激活
    hello1.java内容简单介绍
    hello1 web项目中web.xml作用分析
    hello2 source analisis(notes)
    Servlet filter
    分析helo1项目中的 Web.xml
  • 原文地址:https://www.cnblogs.com/yhq1314/p/13158512.html
Copyright © 2020-2023  润新知