Configuring 802.1X and Port-Based Security 533Configuring Port SecurityBeginning in Privileged EXEC mode, use the following commands to enableport security on an interface to limit the number of source MAC addressesthat can be learned.Command Purposeconfigure Enter Global Configuration mode.interfaceinterface Enter interface configuration mode for the specifiedinterface. Theinterface variable includes the interface typeand number, for example gigabitethernet 1/0/3.You can also specify a range of interfaces with the interfacerange command, for example, interface rangegigabitethernet 1/0/8-12 configures interfaces 8, 9, 10, 11,and 12.port security [discard][trapseconds]Enable port security on the port. This prevents the switchfrom learning new addresses on this port after themaximum number of addresses has been learned.• discard — Discards frames with unlearned sourceaddresses. This is the default if no option is indicated.• trapseconds — Sends SNMP traps and defines theminimal amount of time in seconds between twoconsecutive traps. (Range: 1–1000000)port security maxmax-addrSet the maximum number of MAC addresses that can belearned on the port while port security is enabled.CTRL + Z Exit to Privileged EXEC mode.show ports security[interface]View port security settings on all interfaces or the specifiedinterface.show ports securityaddresses [interface]View the current MAC addresses that have been learnedon all ports or the specified port.