Port security: keeping unauthorised devices off the network
Sign in to read this lesson
By default a switch learns any number of MACs on a port and allows them all. With port security you can set how many MACs a port allows (maximum) or which MAC addresses are allowed. When the rule is broken (a violation), the default shutdown mode puts the port into the err-disabled state. You can follow the violation with log messages, show port-security interface and Wireshark.
What you will learn
- By default there is no limit on the number of MACs learned on an interface, and every MAC is allowed. A cheap switch brought from home shows several MACs on one port.
- Port security only works on an access port:
switchport mode access→switchport port-security→switchport port-security maximum 1. switchport port-security mac-address aaaa.bbbb.ccccallows only that MAC (MAC filtering).- When an unauthorised MAC arrives, a violation happens. In the default shutdown mode the port goes err-disabled:
down/down (err-disabled), with%PM-4-ERR_DISABLEandPSECURE_VIOLATIONmessages in the log. show port-security interface fa0/1: Port Status (Secure-shutdown), Violation Mode, Maximum MAC Addresses, Last Source Address (the MAC that caused the violation) and Security Violation Count.
The lesson has 5 key points, an explanation and 5 questions. It opens with a package.