port security
PORT SECURITY GUIDELINES
Configure port security
If I were to configure port security on Fast Ethernet port 0/1 I would type in the following commands:
ALSwitch(config)#interface fastethernet 0/1
ALSwitch(config-if)#switchport mode access
ALSwitch(config-if)#switchport port-security
ALSwitch(config-if)#switchport port-security mac-address sticky
ALSwitch(config-if)#switchport port-security maximum 1
ALSwitch(config-if)#switchport port-security violation shutdown
This configuration allows the port to learn the first MAC address it is connected to and “sticks it” to the port. In this configuration only one MAC address is learned. If any other MAC address is detected the port is configured to shutdown as set in the violation command above.
If you wanted to accept the new PC on that port and clear the alarm and enable the port, type in the following:
ALSwitch#clear port-security sticky
ALSwitch(config)#interface fa 0/1
ALSwitch(config-if)#shutdown
ALSwitch(config-if)#no shutdown
The “shutdown” “no shutdown” commands under the interface is how we “bounce” the interface (restart the interface).