18-4
Catalyst 2950 Desktop Switch Software Configuration Guide
78-14982-01
Chapter 18 Configuring Port-Based Traffic Control
Configuring Port Security
Beginning in privileged EXEC mode, follow these steps to define a port as a protected port:
To disable protected port, use the no switchport protected interface configuration command.
This example shows how to configure Gigabit Ethernet interface 0/1 as a protected port and verify the
configuration:
Switch# configure terminal
Switch(config)# interface gigabitethernet0/1
Switch(config-if)# switchport protected
Switch(config-if)# end
Switch# show interfaces gigabitethernet0/1 switchport
Name: Gi0/1
Switchport: Enabled
<output truncated>
Protected: True
Unknown unicast blocked: disabled
Unknown multicast blocked: disabled
Configuring Port Security
You can use the port security feature to restrict input to an interface by limiting and identifying MAC
addresses of the stations allowed to access the port. When you assign secure MAC addresses to a secure
port, the port does not forward packets with source addresses outside the group of defined addresses. If
you limit the number of secure MAC addresses to one and assign a single secure MAC address, the
workstation attached to that port is assured the full bandwidth of the port.
If a port is configured as a secure port and the maximum number of secure MAC addresses is reached,
when the MAC address of a station attempting to access the port is different from any of the identified
secure MAC addresses, a security violation occurs. Also, if a station with a secure MAC address
configured or learned on one secure port attempts to access another secure port, a violation is flagged.
These sections include port security configuration information and procedures:
• Understanding Port Security, page 18-5
• Default Port Security Configuration, page 18-7
• Port Security Configuration Guidelines, page 18-7
• Enabling and Configuring Port Security, page 18-7
• Enabling and Configuring Port Security Aging, page 18-10
Command Purpose
Step 1
configure terminal Enter global configuration mode.
Step 2
interface interface-id Specify the type and number of the physical interface to
configure, for example gigabitethernet0/1, and enter
interface configuration mode.
Step 3
switchport protected Configure the interface to be a protected port.
Step 4
end Return to privileged EXEC mode.
Step 5
show interfaces interface-id switchport Verify your entries.
Step 6
copy running-config startup-config (Optional) Save your entries in the configuration file.