PurposeCommand or Action
Specifies a MAC address that should be forbidden by port-security on all the
interfaces.
port-security mac-address forbidden
mac address
Example:
Switch(config)# port-security
Step 3
mac-address forbidden 2.2.2
Specifies the interface to be configured, and enter interface configuration mode.
interface interface-id
Example:
Switch(config)# interface
Step 4
gigabitethernet1/0/1
Sets the interface switchport mode as access or trunk; an interface in the default
mode (dynamic auto) cannot be configured as a secure port.
switchport mode {access | trunk}
Example:
Switch(config-if)# switchport mode
Step 5
access
Enables voice VLAN on a port.
switchport voice vlan vlan-id
Step 6
Example:
Switch(config-if)# switchport voice
vlan-id—Specifies the VLAN to be used for voice traffic.
vlan 22
Enable port security on the interface.switchport port-security
Example:
Switch(config-if)# switchport
Step 7
port-security
(Optional) Sets the maximum number of secure MAC addresses for the interface.
The maximum number of secure MAC addresses that you can configure on a
switchport port-security [maximum
value [vlan {vlan-list | {access | voice}}]]
Step 8
switch or switch stack is set by the maximum number of available MAC
Example:
Switch(config-if)# switchport
addresses allowed in the system. This number is set by the active Switch
Database Management (SDM) template. This number is the total of available
MAC addresses, including those used for other Layer 2 functions and any other
secure MAC addresses configured on interfaces.
port-security maximum 20
(Optional) vlan—sets a per-VLAN maximum value
Enter one of these options after you enter the vlan keyword:
• vlan-list—On a trunk port, you can set a per-VLAN maximum value on
a range of VLANs separated by a hyphen or a series of VLANs separated
by commas. For nonspecified VLANs, the per-VLAN maximum value is
used.
Consolidated Platform Configuration Guide, Cisco IOS Release 15.2(4)E (Catalyst 2960-X Switches)
1488
How to Configure Port Security