接口
nv unset
命令会移除您使用等效 nv set
命令设置的配置。本指南仅在 nv unset
命令与 nv set
命令不同时进行描述。
nv set interface <interface-id> base-interface
将指定的接口配置为基本接口。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
Cumulus Linux 5.0.0 中引入
示例
cumulus@switch:~$ nv set interface swp5 base-interface
nv set interface <interface-id> bond down-delay
配置 bonding 接口的 down delay。您可以设置介于 0 和 65535 之间的值。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
Cumulus Linux 5.0.0 中引入
示例
cumulus@switch:~$ nv set interface bond1 bond down-delay 100
nv set interface <interface-id> bond lacp-bypass
在指定的 bond 上开启 LACP bypass 到 802.3ad 模式,使其即使在没有 LACP 伙伴的情况下也变为活动状态并转发流量。您可以指定 on 或 off。默认设置为 off。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
Cumulus Linux 5.0.0 中引入
示例
cumulus@switch:~$ nv set interface bond1 bond lacp-bypass on
nv set interface <interface-id> bond lacp-rate
配置链路伙伴传输 LACP 控制数据包的速率。您可以设置 fast
或 slow
值。默认设置为 fast
。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
Cumulus Linux 5.0.0 中引入
示例
cumulus@switch:~$ nv set interface bond1 bond lacp-rate slow
nv set interface <interface-id> bond member <member-id>
通过指定 bond 成员来配置 bonding 接口。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
<member-id> | Bond 成员名称。 |
版本历史
Cumulus Linux 5.0.0 中引入
示例
cumulus@switch:~$ nv set interface bond1 bond member swp1-4
nv set interface <interface-id> bond mode
将 bond 上的链路聚合模式配置为 802.3ad 或 balance-xor 模式。您可以指定 lacp
(802.3ad) 或 static
(balance-xor 模式)。默认模式为 802.3ad。
仅当您无法使用 LACP 时才设置 balance-xor 模式;LACP 可以检测 bond 成员之间不匹配的链路属性,甚至可以检测连接错误。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
Cumulus Linux 5.0.0 中引入
示例
cumulus@switch:~$ nv set interface swp1 bond mode static
nv set interface <interface-id> bond up-delay
配置 bonding 接口的 up delay。您可以设置介于 0 和 65535 之间的值。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
Cumulus Linux 5.0.0 中引入
示例
cumulus@switch:~$ nv set interface swp5 bond up-delay 100
nv set interface <interface-id> description
为指定的接口配置描述。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
Cumulus Linux 5.0.0 中引入
示例
cumulus@switch:~$ nv set interface swp1 description hypervisor_port_1
nv set interface <interface-id> ip address <ip-prefix-id>
为指定的接口配置带有路由前缀的 IP 地址。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
<ip-prefix-id> | IPv4 或 IPv6 地址和 CIDR 表示法的路由前缀。 |
版本历史
Cumulus Linux 5.0.0 中引入
示例
cumulus@switch:~$ nv set interface swp1 ip address 10.0.0.1/30
nv set interface <interface-id> ip gateway <ip-address-id>
在指定的接口上配置网关 IP 地址。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
<ip-address-id> | IP 地址。 |
版本历史
Cumulus Linux 5.0.0 中引入
示例
cumulus@switch:~$ nv set interface swp1 ip gateway 10.10.10.1
nv set interface <interface-id> ip ipv4 forward
为指定的接口开启或关闭 IPv4 转发。默认设置为 off
。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
Cumulus Linux 5.0.0 中引入
示例
cumulus@switch:~$ nv set interface swp1 ip ipv4 forward on
nv set interface <interface-id> ip ipv6 enable
开启或关闭 IPv6。默认设置为 on
。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
Cumulus Linux 5.0.0 中引入
示例
cumulus@switch:~$ nv set interface swp1 ip ipv6 enable off
nv set interface <interface-id> ip ipv6 forward
开启或关闭 IPv6 转发。默认设置为 on
。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
Cumulus Linux 5.0.0 中引入
示例
cumulus@switch:~$ nv set interface swp1 ip ipv6 forward off
nv set interface <interface-id> link auto-negotiate
为接口配置自动协商。
默认设置为 on
。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
Cumulus Linux 5.0.0 中引入
示例
cumulus@switch:~$ nv set interface swp1 link auto-negotiate off
nv set interface <interface-id> link breakout <mode-id>
配置端口分拆(拆分),选项如下
- 1x 不拆分端口。这是默认端口设置。
- 2x 将端口拆分为两个接口。
- 4x 将端口拆分为四个接口。
- 8x 将端口拆分为八个接口。
如果您将 100G 端口拆分为四个接口,并且自动协商已开启(默认设置),Cumulus Linux 会为每个接口通告最高速度,最高可达 100G 端口的最大速度 (100/4=25G)。如果需要,您可以覆盖此配置并为拆分端口设置特定速度。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
<mode-id> | 分拆模式:1x、2x、4x、8x。 |
版本历史
在 Cumulus Linux 5.4.0 中引入
示例
cumulus@switch:~$ nv set interface swp1 link breakout 4x
nv set interface <interface-id> link breakout <mode-id> lanes-per-port <lanes-per-port>
配置每个拆分端口的通道数。默认情况下,为了计算拆分端口宽度,Cumulus Linux 使用公式:拆分端口宽度 = 全端口宽度 / 分拆。例如,一个端口拆分为两个接口(2x 分拆)= 8 通道宽度 / 2x 分拆 = 每个拆分端口 4 个通道。如果您需要使用与默认值不同的端口宽度,您可以设置每个端口的通道数。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
<mode-id> | 分拆模式:1x、2x、4x、8x。 |
<lanes-per-port> | 分拆模式:1x、2x、4x、8x。 |
版本历史
在 Cumulus Linux 5.4.0 中引入
示例
cumulus@switch:~$ nv set interface swp1 link breakout 2x lanes-per-port 2
nv set interface <interface-id> link duplex
为接口配置双工模式;全双工或半双工。
默认设置为 full
。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
Cumulus Linux 5.0.0 中引入
示例
cumulus@switch:~$ nv set interface swp1 link duplex half
nv set interface <interface-id> link fast-linkup
在 NVIDIA Spectrum 1 交换机上的接口上配置快速链路连接 (fast linkup)。快速链路连接使您能够启动需要链路快速建立的端口,例如某些 100G 光纤网络接口卡。您可以指定 on
或 off
。默认设置为 off
。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
在 Cumulus Linux 5.3.0 中引入
示例
cumulus@switch:~$ nv set interface swp1 link fast-linkup on
nv set interface <interface-id> link fec
为接口配置前向纠错 (FEC)。FEC 使交换机能够检测和纠正两个接口之间电缆引入的误码。默认设置为 auto
。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
Cumulus Linux 5.0.0 中引入
示例
cumulus@switch:~$ nv set interface swp1 link fec baser
nv set interface <interface-id> link flap-protection enable
在指定的接口上启用 (on
) 和禁用 (off
) 链路抖动保护。默认情况下,Cumulus Linux 启用链路抖动检测。当十秒内发生五次链路抖动时,链路抖动检测会触发,此时接口进入 protodown 状态,并将 linkflap
显示为原因。switchd
服务也会显示日志消息。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
在 Cumulus Linux 5.7.0 中引入
示例
cumulus@switch:~$ nv set interface swp1 link flap-protection enable off
nv set interface <interface-id> link lanes
配置端口的通道数,以覆盖受支持速度和平台的默认行为。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
在 Cumulus Linux 5.4.0 中引入
示例
cumulus@switch:~$ nv set interface swp1 link lanes 1
nv set interface <interface-id> link mac-address <mac-address>
为指定的接口配置 MAC 地址。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
<mac-address> | 您要为接口配置的 MAC 地址。 |
版本历史
在 Cumulus Linux 5.10.0 中引入
示例
cumulus@switch:~$ nv set interface swp1 link mac-address 00:02:00:00:00:05
nv set interface <interface-id> link mtu
为接口配置最大传输单元 (MTU)。您可以设置介于 552 和 9216 之间的值。默认设置为 9216。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
Cumulus Linux 5.0.0 中引入
示例
cumulus@switch:~$ nv set interface swp1 link mtu 1500
nv set interface <interface-id> link speed
为接口配置速度。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
Cumulus Linux 5.0.0 中引入
示例
cumulus@switch:~$ nv set interface swp1 link speed 10G
nv set interface <interface-id> link state
以管理方式启动或关闭接口(admin up 或 admin down)。您可以指定 up
或 down
。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
Cumulus Linux 5.0.0 中引入
示例
cumulus@switch:~$ nv set interface swp1 link state up
nv set interface <interface-id> storm-control broadcast
配置每秒广播数据包数 (pps),该数据包数表示广播风暴。您可以设置介于 1 和 4294967295 之间的值。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
Cumulus Linux 5.0.0 中引入
示例
cumulus@switch:~$ nv set interface swp1 storm-control broadcast 400
nv set interface <interface-id> storm-control multicast
配置每秒组播数据包数 (pps),该数据包数表示组播风暴。您可以设置介于 1 和 4294967295 之间的值。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
Cumulus Linux 5.0.0 中引入
示例
cumulus@switch:~$ nv set interface swp1 storm-control multicast 3000
nv set interface <interface-id> storm-control unknown-unicast
配置每秒未知单播数据包数 (pps),该数据包数表示未知单播风暴。您可以设置介于 1 和 4294967295 之间的值。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
Cumulus Linux 5.0.0 中引入
示例
cumulus@switch:~$ nv set interface swp1 storm-control unknown-unicast 2000
nv set interface <interface-id> tunnel dest-ip
为指定接口上的 GRE 隧道配置目标 IP 地址。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
在 Cumulus Linux 5.1.0 中引入
示例
cumulus@switch:~$ nv set interface tunnelR2 tunnel dest-ip 10.10.10.3
nv set interface <interface-id> tunnel interface <interface-name>
配置 GRE 隧道接口名称。
版本历史
在 Cumulus Linux 5.1.0 中引入
示例
cumulus@switch:~$ nv set interface tunnelR2 tunnel interface MYGRETUNNEL
nv set interface <interface-id> tunnel mode gre
为指定的接口启用 GRE 模式。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
在 Cumulus Linux 5.1.0 中引入
示例
cumulus@switch:~$ nv set interface tunnelR2 tunnel mode gre
nv set interface <interface-id> tunnel source-ip
为指定接口上的 GRE 隧道配置源 IP 地址。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
在 Cumulus Linux 5.1.0 中引入
示例
cumulus@switch:~$ nv set interface tunnelR2 tunnel source-ip 10.10.10.1
nv set interface <interface-id> tunnel ttl
为指定接口上的 GRE 隧道配置 TTL。您可以设置介于 1 和 255 之间的值。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
在 Cumulus Linux 5.1.0 中引入
示例
cumulus@switch:~$ nv set interface tunnelR2 tunnel ttl 50
nv set interface <interface-id> type
配置接口类型。类型可以是 swp
、eth
、bond
、loopback
、svi
、sub
、peerlink
、tunnel
、bridge
或 vrf
。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
Cumulus Linux 5.0.0 中引入
示例
cumulus@switch:~$ nv set interface swp1 type swp
nv set interface <interface-id> vlan
在接口上配置 VLAN。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
Cumulus Linux 5.0.0 中引入
示例
cumulus@switch:~$ nv set interface swp1 vlan 10
nv set system link flap-protection interval
配置链路必须抖动多少秒才能达到链路抖动阈值中设置的次数,然后链路抖动保护才会触发。您可以指定介于 0(关闭)和 60 之间的值。默认设置为 10。
默认情况下,Cumulus Linux 启用链路抖动检测。默认情况下,当十秒内发生五次链路抖动时,链路抖动检测会触发,此时接口进入 protodown 状态,并将链路抖动显示为原因。switchd
服务也会显示日志消息。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
在 Cumulus Linux 5.7.0 中引入
示例
cumulus@switch:~$ nv set interface swp1 link flap-protection interval 30
nv set system link flap-protection threshold 0-30
配置链路抖动保护触发前链路在链路抖动窗口内可以抖动的次数。您可以指定介于 0(关闭)和 30 之间的值。默认设置为 5。
默认情况下,Cumulus Linux 启用链路抖动检测。默认情况下,当十秒内发生五次链路抖动时,链路抖动检测会触发,此时接口进入 protodown 状态,并将链路抖动显示为原因。switchd
服务也会显示日志消息。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
在 Cumulus Linux 5.7.0 中引入
示例
cumulus@switch:~$ nv set interface swp1 link flap-protection threshold 8
nv set vrf <vrf-id> loopback ip address <ip-prefix-id>
在指定的 VRF 中配置环回 IP 地址。
对于默认 VRF,请使用 nv set interface lo ip address <ip-prefix-id>
命令。
命令语法
语法 | 描述 |
---|---|
<vrf-id> | VRF 名称。 |
<ip-prefix-id> | IPv4 或 IPv6 地址和 CIDR 表示法的路由前缀。 |
版本历史
Cumulus Linux 5.0.0 中引入
示例
cumulus@switch:~$ nv set vrf RED loopback ip address 10.10.10.1/32