Topology
Instructions
Connect to the switch using a console connection. Connect a PC to the switch or connect the switch to the FastEthernet port on a router:
- Add port security to an interface on the switch
- Hard set the MAC address of the PC/router interface as the permitted address
- Ensure that the switch interface is up (and an IP address is on the PC)
- Set the port security violation action to “restrict”
- Change the MAC address of the PC, or plug in another machine
- Issue a show port-security interface x command on the switch
Solution Hints and Commands
- Before configuring port security, it is recommended that the switch port be statically configured as a Layer 2 access port. This configuration is illustrated in the following output:
| VTP-Server-1(config)#interface FastEthernet0/1
VTP-Server-1(config-if)#switchport |
- Use the switchport port-security command to enable port security on a switch interface
- Use the switchport port-security mac-address xxxx.xxxx.xxxx command to hard set the MAC address as the permit address
- Use the show ip interface brief command to verify interface status
- Use the switchport port-security violation restrict command to configure violation action
- Use the show port-security command
