Port security monitors and blocks Layer 2 traffic on a switch on an individual port basis. Access the switch's CLI prompt. Enter interface configuration mode for the port you want to secure and run the following command. This number is the total of available MAC addresses, including those used for other Layer 2 functions and any other secure MAC addresses. Port security is a Layer 2 security feature that allows you to control which devices can access your network through specific switch ports. By limiting the number of MAC addresses that can be learned on a port and defining actions when violations occur, port security prevents unauthorized devices. It limits the number of MAC addresses that can appear on a port and specifies which MACs are allowed to connect.
[PDF Version]