如何在 Dell N2000、N3000 和 N4000 系列交换机上配置基于 MAC 的端口安全性。
Summary: Dell EMC Networking N 系列在交换机上配置基于 MAC 的端口安全性。
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 N 系列交换机上配置基于 MAC 的端口安全性
目录
- 如何在 N 系列交换机上启用基于 MAC 的端口安全性
- 如何将 MAC 地址静态添加到接口
- 如何配置允许的最大 MAC 地址数量
- 如何在特定接口上配置动态获取的 MAC 地址的最大限制
如何在 N 系列交换机上启用基于 MAC 的端口安全性
| 命令 | “Parameters(参数)” |
| console>enable | 进入“启用专用 Exec”模式。 |
| console#config | 进入配置模式。 |
| console(config)#switchport port-security | 在交换机上全局启用端口安全性。 |
| console(config)#interface gi1/0/5 | 输入需要端口安全性的特定接口。 |
| console(config-if-gi1/0/5)#switchport port-security | 在接口级别启用端口安全性。 |
注意:在接口上启用端口安全性时,在此端口上获取的所有动态 MAC 地址都将被删除,端口将重新获取此接口上的任何 MAC 地址。
如何将 MAC 地址静态添加到接口
| 命令 | “Parameters(参数)” |
| console#config | 进入配置模式。 |
| console(config)# mac address-table static c2f3.220a.12f4 vlan 1 interface gi1/0/5 | 这会将 MAC 地址 c2f3.220a.12f4 添加到适用于接口 gi1/0/5 的 MAC 表。 |
| console(config)#no mac address-table static c2f3.220a.12f4 vlan 1 interface gi1/0/5 | 在命令的开始处添加 "no" 以删除 MAC 地址。 |
如何配置允许的最大静态 MAC 地址数量
| 命令 | “Parameters(参数)” |
| console#config | 进入配置模式。 |
| console(config)#interface gi1/0/5 | 输入需要端口安全性的特定接口。 |
| console(config-if-Gi1/0/5)#switchport port-security maximum 3 | 将静态 MAC 地址的最大数限制设置为 3。 范围是 ,默认值为 100。 |
注意:要清除从端口上动态获取的 MAC 地址,必须执行以下示例命令。console#clear mac address-table dynamic interface gi1/0/5
注意:默认情况下,当发生端口安全性违规时,端口会丢弃此接口上源于违规 MAC 地址的所有帧。端口不会关闭。 如果您希望实际关闭端口,需要将此命令添加到需要该功能的特定接口: (config-if-Gi1/0/5)#switchport port-security violation shutdown :
如何在特定接口上配置动态获取的 MAC 地址的最大限制
| 命令 | “Parameters(参数)” |
| console#config | 进入配置模式。 |
| console(config)#interface gi1/0/5 | 输入需要端口安全性的特定接口。 |
| console(config-if-gi1/0/5)#switchport port-security dynamic 0 | 此示例使用 0,因为您通常不希望端口动态获得 MAC 地址。 范围 ,默认值为 100。 |
Affected Products
PowerSwitch N2000 Series, PowerSwitch N3000 Series, PowerSwitch N4000 SeriesArticle Properties
Article Number: 000121440
Article Type: How To
Last Modified: 05 Jun 2025
Version: 5
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.