Etherchannel/Eth-trunk端口聚合原理

本文介绍端口聚合技术,包括PAgP和LACP两种协议的工作原理,并详细展示了如何配置LACP进行二层和三层端口聚合,以实现链路捆绑、增加带宽、流量负载分担及提高网络稳定性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.背景

端口聚合将两个设备间多条物理链路捆绑在一起组成逻辑链路,一是可实现增加带宽;除了增加带宽外,二是端口聚合还可以在多条链路上均衡分配流量,起到负载分担的作用;三是当一条或多条链路故障时,只要还有链路正常,流量将转移到其它的链路上,从而起到冗余的作用,增强了网络的稳定性和安全性。主要作用为:

  • 链路捆绑,增加带宽。
  • 多条链路流量负载分担
  • 冗余链路,保障稳定

1.1 端口聚合两种协议

PAgP(Port Aggregation Protocol )思科私有 :端口聚合协议。
LACP(Link Aggregation Control Protocol)是基于IEEE 802.3ad的国际标准,是一种实现链路动态聚合的协议,日常工作中使用较多。

1.2 PAgP协议

  • On:通道成员不协商,手工指定的强制模式。
  • Desirable:主动发送PAgP报文,积极的想和对端协商。
  • Auto:被动发送PAgP报文,等待对端询问,就同意建立。
  • Off:接口不配置Etherchannel。
    在这里插入图片描述

1.3 LACP协议

  • On:通道成员不协商,手工指定的强制模式。
  • Active:主动发送PAgP报文,积极的想和对端协商。
  • Passive:被动发送PAgP报文,等待对端询问,就同意建立。
  • Off:接口不配置Etherchannel。
    在这里插入图片描述

2.端口聚合配置

2.1 LACP二层配置

在这里插入图片描述

SW1配置:
Switch(config)#hostname SW1
SW1(config)##interface range e0/0-2
SW1(config-if-range)#shutdown
SW1(config-if-range)#channel-group 1 mode active

SW2配置:
Switch(config)#hostname SW2
SW2(config)##interface range e0/0-2
SW2(config-if-range)#shutdown
SW2(config-if-range)#channel-group 1 mode active

验证:
SW1#show etherchannel summary 
Flags:  D - down        P - bundled in port-channel
        I - stand-alone s - suspended
        H - Hot-standby (LACP only)
        R - Layer3      S - Layer2
        U - in use      N - not in use, no aggregation
        f - failed to allocate aggregator

        M - not in use, minimum links not met
        m - not in use, port not aggregated due to minimum links not met
        u - unsuitable for bundling
        w - waiting to be aggregated
        d - default port

        A - formed by Auto LAG


Number of channel-groups in use: 1
Number of aggregators:           1

Group  Port-channel  Protocol    Ports
------+-------------+-----------+-----------------------------------------------
1      Po1(SU)         LACP      Et0/0(P)    Et0/1(P)    Et0/2(P)    


SW1#show ip interface br
Interface              IP-Address      OK? Method Status                Protocol
Ethernet0/0            unassigned      YES unset  up                    up      
Ethernet0/1            unassigned      YES unset  up                    up      
Ethernet0/2            unassigned      YES unset  up                    up      
Ethernet0/3            unassigned      YES unset  up                    up      
Port-channel1          unassigned      YES unset  up                    up  


PC验证通信:
VPC3> ping 192.168.1.2

84 bytes from 192.168.1.2 icmp_seq=1 ttl=64 time=0.941 ms
84 bytes from 192.168.1.2 icmp_seq=2 ttl=64 time=1.324 ms
84 bytes from 192.168.1.2 icmp_seq=3 ttl=64 time=1.414 ms
84 bytes from 192.168.1.2 icmp_seq=4 ttl=64 time=1.350 ms
84 bytes from 192.168.1.2 icmp_seq=5 ttl=64 time=1.739 ms



2.2 LACP三层端口配置

在这里插入图片描述

SW1配置:
SW1(config)##interface range e0/0-2
SW1(config-if-range)#shutdown
SW1(config-if-range)#no switchport
SW1(config-if-range)#channel-group 1 mode active
SW1(config)#interface port-channel 1 
SW1(config-if)#ip address 12.1.1.1 255.255.255.0

SW2配置:
SW2(config)##interface range e0/0-2
SW2(config-if-range)#shutdown
SW2(config-if-range)#no switchport
SW2(config-if-range)#channel-group 1 mode active
SW2(config)#interface port-channel 1 
SW2(config-if)#ip address 12.1.1.2 255.255.255.0    
    

验证: 
SW1#show etherchannel su
Flags:  D - down        P - bundled in port-channel
        I - stand-alone s - suspended
        H - Hot-standby (LACP only)
        R - Layer3      S - Layer2
        U - in use      N - not in use, no aggregation
        f - failed to allocate aggregator

        M - not in use, minimum links not met
        m - not in use, port not aggregated due to minimum links not met
        u - unsuitable for bundling
        w - waiting to be aggregated
        d - default port

        A - formed by Auto LAG


Number of channel-groups in use: 1
Number of aggregators:           1

Group  Port-channel  Protocol    Ports
------+-------------+-----------+-----------------------------------------------
1      Po1(RU)         LACP      Et0/0(P)    Et0/1(P)    Et0/2(P)    
    
SW1#ping 12.1.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.1.1.2, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 1/1/3 ms
    
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值