Port security is used to secure the port of a layer 3 switch for the purpose of to not access that port except the dedicated mac address computer, or when some violate that restriction the switch port must be off.
- Switch# conf terminal
- Switch(conf)# int fa 0/1
- Switch(conf_if)# switchport mode access
- Switch(conf_if)# switchport port security
- Switch(conf_if)# switchport port-security mac-address 00d0.b74f.8218
We can used sticky in place of giving MAC address as
- Switch(config_if)# switchport port-security mac-address sticky
- Switch(conf_if)# switchport port-security violation shutdown
- Switch(conf_if)# exit
- Switch(conf)#exit
- When some one violate that restriction then the switch port off to on this port back, as
- Switch(conf)# int fa 0/1 (that port no)
- Switch(conf_if)# shutdown
- Switch(conf_if)# no shutdown
- Switch(conf_if)# exit
- Switch(conf)# exit