Cisco Port Security

Port security can be enabled on switch ports to provide network security. You can restrict based on MAC address which computers can connect as well as how many can connect per port.

int fa 0/1
Lets you configure the interface.

switchport mode access
Makes the port an access port.

switchport port-security
Enables port security on the interface

switchport port-security violation {protect|restrict|shutdown}
The default is shutdown
Protect = Drops packets with unknown source addresses until you remove a sufficient number of secure MAC addresses to drop below the maximum value.
Restrict = Drops packets with unknown source addresses until you remove a sufficient number of secure MAC addresses to drop below the maximum value and causes the SecurityViolation counter to increment.
Shutdown = Puts the interface into the error-disabled state immediately and sends an SNMP trap notification.

switchport port-security maximum 2
The default is 1, this sets the interface to allow a maximum of 2 secure MAC addresses

switchport port-security mac-address 0000.0C68.018E
This sets this MAC address as being able to use the port.

switchport port-security mac-address sticky
This makes the port learn the first MAC address it sees connected to the port and adds it as allowed on the port.

Here are some commands to verify your port security settings:

show port-security
show port-security address
show port-security interface fastEthernet 0/1

If a violation occurs and the port is shut down you will need to bounce the port:
int fa 0/1
shutdown
no shutdown