If the MAC address is a secure MAC address on any interface, you cannot add it as a static secure MAC
address to another interface until you remove it from the interface on which it is already a secure MAC address.
Note
By default, no static secure MAC addresses are configured on an interface.
Before you begin
You must have enabled port security globally.
Verify that the interface maximum has not been reached for secure MAC addresses. If needed, you can remove
a secure MAC address, or you can change the maximum number of addresses on the interface.
SUMMARY STEPS
1.
configure terminal
2.
Enter one of the following commands:
•
interface ethernet slot
/
port
•
interface port-channel channel-number
3.
[
no
]
switchport port-security mac-address address
[
vlan vlan-ID
]
4.
(Optional)
show running-config port-security
5.
(Optional)
copy running-config startup-config
DETAILED STEPS
Purpose
Command or Action
Enters global configuration mode.
configure terminal
Example:
Step 1
switch# configure terminal
switch(config)#
Enters interface configuration mode for the interface that
you specify.
Enter one of the following commands:
Step 2
•
interface ethernet slot
/
port
•
interface port-channel channel-number
Example:
switch(config)# interface ethernet 2/1
switch(config-if)#
Configures a static MAC address for port security on the
current interface. Use the
vlan
keyword if you want to
[
no
]
switchport port-security mac-address address
[
vlan
vlan-ID
]
Step 3
specify the VLAN that traffic from the address is allowed
on.
Example:
switch(config-if)# switchport port-security
mac-address 0019.D2D0.00AE
Displays the port security configuration.
(Optional)
show running-config port-security
Example:
Step 4
Cisco Nexus 9000 Series NX-OS Security Configuration Guide, Release 9.x
315
Configuring Port Security
Adding a Static Secure MAC Address on an Interface