Purpose
Command or Action
switch(config-if)# switchport port-security
violation restrict
Displays the port security configuration.
(Optional)
show running-config port-security
Example:
Step 4
switch(config-if)# show running-config
port-security
Copies the running configuration to the startup
configuration.
(Optional)
copy running-config startup-config
Example:
Step 5
switch(config-if)# copy running-config
startup-config
Verifying the Port Security Configuration
To display the port security configuration information, perform one of the following tasks.
Purpose
Command
Displays the port security configuration.
show running-config port-security
Displays the port security status of the device.
show port-security
Displays the port security status of a specific interface.
show port-security interface
Displays secure MAC addresses.
show port-security address
Verifies configuration on both vPC peers.
show vpc consistency-parameters vpc id
Displaying Secure MAC Addresses
Use the
show port-security address
command to display secure MAC addresses.
Configuration Example for Port Security
The following example shows a port security configuration for the Ethernet 2/1 interface with VLAN and
interface maximums for secure addresses. In this example, the interface is a trunk port. Additionally, the
violation action is set to Restrict.
feature port-security
interface Ethernet 2/1
switchport
switchport port-security
switchport port-security maximum 10
switchport port-security maximum 7 vlan 10
switchport port-security maximum 3 vlan 20
switchport port-security violation restrict
Cisco Nexus 9000 Series NX-OS Security Configuration Guide, Release 9.x
323
Configuring Port Security
Verifying the Port Security Configuration