端口安全
nv unset
命令删除您使用等效 nv set
命令设置的配置。本指南仅在 nv unset
命令与 nv set
命令不同时描述 nv unset
命令。
nv set interface <interface-id> port-security enable
启用 (on
) 和禁用 (off
) 接口上的端口安全。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
在 Cumulus Linux 5.7.0 中引入
示例
cumulus@switch:~$ nv set interface swp1 port-security enable on
nv set interface <interface-id> port-security mac-limit
配置允许访问指定端口的最大 MAC 地址数。您可以指定介于 1 和 512 之间的值。默认值为 32。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
在 Cumulus Linux 5.7.0 中引入
示例
cumulus@switch:~$ nv set interface swp1 port-security mac-limit 100
nv set interface <interface-id> port-security static-mac
配置允许访问指定端口的特定 MAC 地址。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
在 Cumulus Linux 5.7.0 中引入
示例
cumulus@switch:~$ nv set interface swp1 port-security static-mac 00:02:00:00:00:05
nv set interface <interface-id> port-security sticky-ageing
在指定的接口上启用 (enabled
) 和禁用 (disabled
) 粘性 MAC 老化。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
在 Cumulus Linux 5.7.0 中引入
示例
cumulus@switch:~$ nv set interface swp1 port-security sticky-ageing enabled
nv set interface <interface-id> port-security sticky-mac
启用 (enabled
) 和禁用 (disabled
) 粘性 MAC 端口安全,以跟踪端口上动态学习的特定 MAC 地址。
如果源 MAC 地址仍在发送流量,则 Cumulus Linux 会通过接口闪断和重启来维护学习到的粘性 MAC 地址;否则,学习到的粘性 MAC 地址会根据粘性 MAC 老化时间老化。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
在 Cumulus Linux 5.7.0 中引入
示例
cumulus@switch:~$ nv set interface swp1 port-security sticky-mac enabled
nv set interface <interface-id> port-security sticky-timeout
配置学习到的粘性 MAC 地址老化且不再有权访问端口的时间段。您可以指定介于 0 和 3600 分钟之间的值。默认设置为 1800 分钟。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
在 Cumulus Linux 5.7.0 中引入
示例
cumulus@switch:~$ nv set interface swp1 port-security sticky-timeout 20
nv set interface <interface-id> port-security violation-mode
在指定的接口上配置冲突模式,以将端口置于 protodown 状态 (protodown
) 或丢弃数据包 (restrict
)。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
在 Cumulus Linux 5.7.0 中引入
示例
cumulus@switch:~$ nv set interface swp1 port-security violation-mode protodown
nv set interface <interface-id> port-security violation-timeout
配置冲突模式超时后的分钟数。您可以指定介于 0 和 60 分钟之间的值。默认值为 30 分钟。
命令语法
语法 | 描述 |
---|---|
<interface-id> | 您要配置的接口。 |
版本历史
在 Cumulus Linux 5.7.0 中引入
示例
cumulus@switch:~$ nv set interface swp1 port-security violation-timeout 60