Dell Networking SONiC 静态和 LACP 端口通道

Summary: 本文介绍运行 Dell Networking SONiC OS 的交换机中的静态和 LACP PortChannel。本文不涵盖 MC-LAG。本文使用运行 Dell SONiC 4.1 的交换机。

This article applies to This article does not apply to This article is not tied to any specific product. Not all product versions are identified in this article.

Instructions

文章的前提条件

我们在配置中使用标准接口命名。要详细了解 Dell SONiC 中的各种接口命名模式,请参阅Dell Networking S 系列:基本接口配置 – SONIC 4.0
 

我们将以下拓扑用于文章。
image.png

必须在 PortChannel、Eth 1/1、1/2 和 1/3 中为要添加的接口配置速度、双工和 MTU。
 

 

指数

什么是 Portchannel?
要记住
的要点静态 PortChannel 或 ON 模式
LACP 端口通道或活动模式
最小链接数
Mtu                        

 

什么是 Portchannel?

端口通道是一组可聚合在一起形成绑定通道(链路聚合组或 LAG 或 PortChannel)的一组或多个链路。

创建 PortChannel 的好处

  • 这提供了冗余、更高的带宽和更好的流量负载平衡。
  • 端口通道聚合成员链路的带宽。
  • 如果成员端口出现故障,流量将重定向到其余端口。

端口通道的类型

PortChannel 可以配置为任一

  • 静态 PortChannel 或 ON 模式
  • LACP 端口通道或活动模式
 

需要记住的要点

  • 如果对等端支持 LLDP,请使用 LLDP 验证链路连接
  • PortChannel 中的最大接口数为 32
  • PortChannel 可配置为 L2 交换机端口模式和 L3 路由端口模式(分配 Ipv4/IPV6 地址)

下面是将接口添加到端口通道时需要记住的要点。

  • 所有成员必须是相同的接口类型(如以太网)。
  • 所有成员接口必须具有相同的速度/双工/MTU。
  • 接口不得包含非默认 L2/L3 配置设置。仅支持说明和关机或不支持关机命令。
  • 我们无法将 IP 地址或静态 MAC 地址添加到成员接口。
  • 我们只能将接口分配给一个端口通道。
 

有用信息

我们可以将默认接口用于接口上的默认配置。这可以帮助我们轻松清理接口中的任何配置,然后再添加到 PortChannel。

示例配置

Lets Cleanup the configuration of Eth 1/1 before adding the interface to portchannel

DELLSONiC# show running-configuration interface Eth 1/1
!
interface Eth1/1
mtu 9100
speed 25000
shutdown
switchport trunk allowed Vlan 1-4094

Lets execute default interface Eth1/1

DELLSONiC# configure
DELLSONiC(config)# default interface Eth 1/1

We can see the interface configuration is defaulted

DELLSONiC(config)# do show running-configuration interface Eth 1/1
!
interface Eth1/1
mtu 9100
speed 25000
shutdown
DELLSONiC(config)#
 
 

静态 PortChannel 或 ON 模式

静态 PortChannel 或 ON 模式是配置 PortChannel 的简单方法。如果连接的设备不支持 LACP,则可以使用此模式。静态 LAG 没有任何机制来交换像 LACP 这样的聚合信息,因此它会在其中一个链路出现时开始转发数据包。

配置 PortChannel


将接口添加到 Portchannel。

配置语法

配置

说明

DELLSONiC(config)# interface Ethernet 

配置接口。

DELLSONiC(config)# interface range Ethernet 

可选:配置一系列接口。

DELLSONiC(conf-if-EthernetX)# channel-group 

定义接口下的 PortChannel。

DELLSONiC(conf-if-EthernetX)# no channel-group 

从端口通道中删除接口。

DELLSONiC(conf-if-EthernetX)# no shutdown

启用接口。

 

示例配置
 
Lets Configure Portchannel 1

admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure
DELLSONiC(config)# interface PortChannel 1 mode on
DELLSONiC(config-if-po1)# no shutdown
DELLSONiC(config-if-po1)# exit

Lets add interface Eth 1/1 as part of Portchannel 1

DELLSONiC(config)# interface Eth 1/1
DELLSONiC(config-if-Eth1/1)# channel-group 1
DELLSONiC(config-if-Eth1/1)# no shutdown
DELLSONiC(config-if-Eth1/1)# exit

Lets use interface range command to add interface Eth 1/2 and Eth 1/3 as part of Portchannel 1

DELLSONiC(config)# interface range Eth 1/2-1/3
%Info: Configuring only existing interfaces in range
DELLSONiC(config-if-range-eth**)# channel-group 1
DELLSONiC(config-if-range-eth**)# no shutdown
DELLSONiC(config-if-range-eth**)# end
DELLSONiC#
  

使用命令 show interface PortChannel 显示 PortChannel 摘要 以验证 PortChannel 的状态。

输出示例

DELLSONiC# show interface PortChannel 1
PortChannel1 is up, line protocol is up, reason oper-up, mode Static
Hardware is PortChannel, address is XX:XX:XX:XX:XX:XX
Minimum number of links to bring PortChannel up is 1
Mode of IPV4 address assignment: not-set
Mode of IPV6 address assignment: not-set
Graceful shutdown: Disabled
MTU 9100
LineSpeed 75.0GB
Events:
all-links-down at 2023-09-19T17:24:05.257874Z
lacp-fail at 2023-09-19T17:25:15.406803Z
portchannel-up at 2023-09-19T17:25:15.417415Z
Members in this channel: Eth1/1
Members in this channel: Eth1/2
Members in this channel: Eth1/3
Last clearing of "show interface" counters: never
10 seconds input rate 2 packets/sec, 2968 bits/sec, 371 Bytes/sec
10 seconds output rate 0 packets/sec, 0 bits/sec, 0 Bytes/sec
Input statistics:
          1320 packets, 243306 octets
          0 Multicasts, 0 Broadcasts, 1320 Unicasts
          0 error, 28 discarded
Output statistics:
          818 packets, 190127 octets
          0 Multicasts, 0 Broadcasts, 818 Unicasts
          0 error, 0 discarded
Time since last interface status change: 00:03:23
 
DELLSONiC# show PortChannel summary
Flags(oper-status):  D - Down U - Up (portchannel) P - Up in portchannel (members)
----------------------------------------------------------------------------------------------------------------------------
Group               PortChannel                   Type                Protocol          Member Ports
----------------------------------------------------------------------------------------------------------------------------
1                   PortChannel1   (U)            Eth                 NONE                 Eth1/1(P)
                                                                                           Eth1/2(P)
                                                                                           Eth1/3(P)

 

LACP 端口通道或活动模式

端口通道是一组可聚合在一起形成绑定通道(链路聚合组或 LAG 或端口通道)的一组或多个链路。
链路聚合控制协议 (LACP) 使用链路上的对等交换 (LACPDU) 来持续确定各种链路的聚合功能,并持续提供在给定系统对之间实现的最大聚合能力级别。

配置 PortChannel

配置语法

配置

说明

admin@DELLSONiC:~$ sonic-cli

登录到 DELL MF-CLI

DELLSONiC# configure terminal

进入配置模式。

DELLSONiC(config)# interface PortChannel  

将 PortChannel 配置为 LACP 活动端口通道。

sonic(config)# interface PortChannel  mode active

(可选)将 PortChannel 配置为 LACP 活动 PortChannel。您可以指定活动模式。(默认)

DELLSONiC(conf-if-poX)# no shutdown

取消修补 PortChannel。

DELLSONiC(conf-if-poX)#exit

退出 PortChannel。


将接口添加到 Portchannel。

配置语法

配置

说明

DELLSONiC(config)# interface Ethernet 

配置接口。

DELLSONiC(config)# interface range Ethernet 

可选:配置一系列接口。

DELLSONiC(conf-if-EthernetX)# channel-group 

定义接口下的 PortChannel。

DELLSONiC(conf-if-EthernetX)# no channel-group 

从端口通道中删除接口。

DELLSONiC(conf-if-EthernetX)# no shutdown

启用接口。


示例配置

Lets Configure Portchannel 1

admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure
DELLSONiC(config)# interface PortChannel 1
DELLSONiC(config-if-po1)# no shutdown
DELLSONiC(config-if-po1)# exit

Lets add interface Eth 1/1 as part of Portchannel 1

DELLSONiC(config)# interface Eth 1/1
DELLSONiC(config-if-Eth1/1)# channel-group 1
DELLSONiC(config-if-Eth1/1)# no shutdown
DELLSONiC(config-if-Eth1/1)# exit

Lets use interface range command to add interface Eth 1/2 and Eth 1/3 as part of Portchannel 1

DELLSONiC(config)# interface range Eth 1/2-1/3
%Info: Configuring only existing interfaces in range
DELLSONiC(config-if-range-eth**)# channel-group 1
DELLSONiC(config-if-range-eth**)# no shutdown
DELLSONiC(config-if-range-eth**)# end
DELLSONiC#


使用命令 show interface PortChannel 显示 PortChannel 摘要 以验证 PortChannel 的状态。

输出示例

DELLSONiC# show interface PortChannel 1
PortChannel1 is up, line protocol is up, reason oper-up, mode LACP
Hardware is PortChannel, address is XX:XX:XX:XX:XX:XX
Minimum number of links to bring PortChannel up is 1
Mode of IPV4 address assignment: not-set
Mode of IPV6 address assignment: not-set
Fallback: Disabled
Graceful shutdown: Disabled
MTU 9100
LineSpeed 75.0GB
Events:
all-links-down at 2023-09-19T16:19:23.406682Z
lacp-fail at 2023-09-19T16:37:02.782825Z
portchannel-up at 2023-09-19T16:37:42.564118Z
LACP mode ACTIVE interval SLOW priority 65535 address XX:XX:XX:XX:XX:XX
Members in this channel: Eth1/1(Selected)
LACP Actor port 1  address XX:XX:XX:XX:XX:XX key 1
LACP Partner port 1  address XX:XX:XX:XX:XX:XX key 1
Members in this channel: Eth1/2(Selected)
LACP Actor port 2  address XX:XX:XX:XX:XX:XX key 1
LACP Partner port 2  address XX:XX:XX:XX:XX:XX key 1
Members in this channel: Eth1/3(Selected)
LACP Actor port 3  address XX:XX:XX:XX:XX:XX key 1
LACP Partner port 3  address XX:XX:XX:XX:XX:XX key 1
Last clearing of "show interface" counters: never
10 seconds input rate 0 packets/sec, 0 bits/sec, 0 Bytes/sec
10 seconds output rate 0 packets/sec, 0 bits/sec, 0 Bytes/sec
Input statistics:
          107 packets, 20173 octets
          0 Multicasts, 0 Broadcasts, 107 Unicasts
          0 error, 16 discarded
Output statistics:
          209 packets, 34421 octets
         0 Multicasts, 0 Broadcasts, 209 Unicasts
          0 error, 0 discarded
Time since last interface status change: 00:02:04
DELLSONiC# show PortChannel summary
Flags(oper-status):  D - Down U - Up (portchannel) P - Up in portchannel (members)
----------------------------------------------------------------------------------------------------------------------------
Group               PortChannel                   Type                Protocol          Member Ports
----------------------------------------------------------------------------------------------------------------------------
1                   PortChannel1   (U)            Eth                 LACP                 Eth1/1(P)
                                                                                           Eth1/2(P)
                                                                                           Eth1/3(P)


 

最小链接数

我们可以配置最小链路数,以使用命令 min-links 启动端口通道。默认值为 0。

配置示例

admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure
DELLSONiC(config)# interface PortChannel 1
DELLSONiC(config-if-po1)# min-links 2
DELLSONiC(config-if-po1)# end
DELLSONiC#

输出示例
DELLSONiC# show PortChannel summary
Flags(oper-status):  D - Down U - Up (portchannel) P - Up in portchannel (members)
----------------------------------------------------------------------------------------------------------------------------
Group               PortChannel                   Type                Protocol          Member Ports
----------------------------------------------------------------------------------------------------------------------------
1                   PortChannel1   (U)            Eth                 LACP                 Eth1/1(P)
                                                                                           Eth1/2(P)
                                                                                           Eth1/3(P


考虑端口 Eth 1/2 和 Eth 1/3 链路关闭。Eth 1/1 为 UP。由于只有一个链路处于正常运行状态,并且最小链路为 2,因此 PortChannel 1 发生故障。

我们可以看到 Portchannel 1 已关闭,原因为最小链接。

输出示例

DELLSONiC# show interface status (Output grepped for brevity)
--------------------------------------------------------------------------------------------------------------------------------------
Name                Description                   Oper           Reason         AutoNeg   Speed          MTU            Alternate Name
--------------------------------------------------------------------------------------------------------------------------------------
Eth1/1              -                             up             oper-up        off       25000          9100           Ethernet0
Eth1/2              -                             down           admin-down     off       25000          9100           Ethernet1
Eth1/3              -                             down           admin-down     off       25000          9100           Ethernet2

PortChannel1        -                             down           min-links      -         75000          9100           -             


 

Mtu

我们可以在端口通道接口上配置 MTU。在 PortChannel 中配置 MTU 之前,必须先了解以下要点。 

  • 在配置端口通道 MTU 之前,在分配给端口通道的接口上配置 MTU。
  • PortChannel 的默认 MTU 为 9100。
  • 端口通道的所有成员都必须具有相同的 MTU 值。
  • 具有标记 VLAN 的成员接口必须具有比未标记成员高 4 字节的链路 MTU,才能考虑数据包标签。
  • 确保端口通道成员接口的 MTU 大于或等于端口通道 MTU。
  • 系统选择端口通道或端口通道成员上配置的最低 MTU 值作为端口通道 MTU。

示例

请考虑端口通道包含标记的成员,链路 MTU 为 1522,IP MTU 为 1500,无标记成员的链路 MTU 为 1518,IP MTU 为 1500。
端口通道的链路 MTU 不能高于 1518 字节,并且其 IP MTU 不能高于 1500 字节。

注意: 

  • 接口上的 MTU 配置为接口上的 IP 流量配置最大传输单元 (MTU) 帧大小。
  • show interface 显示 IP MTU。
  • 如果在配置端口通道 MTU 后在端口通道成员上配置 MTU,则端口通道 MTU 可能不会更新


输出示

例让我们将 PortChannel 的 MTU 更改为 1500(默认值为 9100)

DELLSONiC# configure
DELLSONiC(config)# interface PortChannel 1
DELLSONiC(config-if-po1)# mtu 1500
DELLSONiC(config-if-po1)# end
DELLSONiC#

输出示例
DELLSONiC# show interface PortChannel 1
PortChannel1 is up, line protocol is up, reason oper-up, mode LACP
Hardware is PortChannel, address is XX:XX:XX:XX:XX:XX
Minimum number of links to bring PortChannel up is 1
Mode of IPV4 address assignment: not-set
Mode of IPV6 address assignment: not-set
Fallback: Disabled
Graceful shutdown: Disabled
MTU 1500                                                     
LineSpeed 75.0GB
Events:
all-links-down at 2023-09-19T16:50:29.006155Z
lacp-fail at 2023-09-19T16:50:30.833807Z
portchannel-up at 2023-09-19T16:50:30.83887Z
LACP mode ACTIVE interval SLOW priority 65535 address XX:XX:XX:XX:XX:XX
Members in this channel: Eth1/1(Selected)
LACP Actor port 1  address XX:XX:XX:XX:XX:XX key 1
LACP Partner port 1  address XX:XX:XX:XX:XX:XX key 1
Members in this channel: Eth1/2(Selected)
LACP Actor port 2  address XX:XX:XX:XX:XX:XX key 1
LACP Partner port 2  address XX:XX:XX:XX:XX:XX key 1
Members in this channel: Eth1/3(Selected)
LACP Actor port 3  address XX:XX:XX:XX:XX:XX key 1
LACP Partner port 3  address XX:XX:XX:XX:XX:XX key 1
Last clearing of "show interface" counters: never
10 seconds input rate 0 packets/sec, 0 bits/sec, 0 Bytes/sec
10 seconds output rate 0 packets/sec, 0 bits/sec, 0 Bytes/sec
Input statistics:
          274 packets, 59031 octets
          0 Multicasts, 0 Broadcasts, 274 Unicasts
          0 error, 19 discarded
Output statistics:
          385 packets, 78115 octets
          0 Multicasts, 0 Broadcasts, 385 Unicasts
          0 error, 0 discarded
Time since last interface status change: 00:01:18 

Affected Products

Enterprise SONiC Distribution, PowerSwitch E3200-ON Series, Dell EMC Networking N3200-ON, PowerSwitch S5212F-ON, PowerSwitch S5224F-ON, PowerSwitch S5232F-ON, PowerSwitch S5248F-ON, PowerSwitch S5296F-ON, PowerSwitch Z9264F-ON, PowerSwitch Z9332F-ON , PowerSwitch Z9432F-ON ...
Article Properties
Article Number: 000217739
Article Type: How To
Last Modified: 28 Sep 2023
Version:  3
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.