Cisco Switch Port Security Example:



In this blog we will learn about Cisco Switch port security. As per the below scenario we will configure the Cisco Switch port security.





Switch Configuration:

Hostname Configuration:
Switch>enable
Switch#configure terminal
Switch(config)#no ip domain-lookup
Switch(config)#hostname Switch1

Password Configuration:
Switch1(config)#enable secret Cisco
Switch1(config)#line console 0
Switch1(config-line)#logging Synchronous
Switch1(config-line)#login
Switch1(config-line)#password
Switch1(config-line)#exec-timeout 0 0
Switch1(config-line)#exit

Switch1(config)#line vty 0 15
Switch1(config-line)#login
Switch1(config-line)#password Networkinghub
Switch1(config-line)#exit

IP addressing Configuration:

Switch1(config)#ip default-gateway 192.168.10.1
Switch1(config)#interface vlan 1
Switch1(config-if)#ip address 192.168.10.2 255.255.255.0
Switch1(config-if)#no shutdown
Switch1(config-if)#interface gigabitethernet 0/1
Switch1(config-if)#description Link to Core Router

Port Security Configuration:

Switch1(config-if)#interface fastethernet 0/2
Switch1(config-if)#description Link to Workstation-1
Switch1(config-if)#Switch1port mode access
Switch1(config-if)#Switch1port port-security
Switch1(config-if)#Switch1port port-security maximum 1
Switch1(config-if)#Switch1port port-security violation shutdown
Switch1(config-if)#interface fastethernet 0/3
Switch1(config-if)#description Link to Workstation-2
Switch1(config-if)#Switch1port mode access
Switch1(config-if)#Switch1port port-security mac-address FE80::209:7CFF:FEDE:91C9
Switch1(config-if)#Switch1port port-security maximum 1
Switch1(config-if)#Switch1port port-security violation shutdown
Switch1(config-if)#exit
Switch1(config)#exit
Switch1#copy running-config startup-config
Switch1#


Verify Port Security:

Switch1#show port-security
Switch1#show port-security interface fastethernet 0/5
Switch1#show port-security Address
Switch1#show mac address-table dynamic
Switch1#clear mac address-table Dynamic
Switch1#clear mac address-table dynamic address aaaa.bbbb.cccc
Switch1#clear mac address-table dynamic interface fastethernet 0/5
Switch1#clear mac address-table dynamic vlan 10
Switch1#clear mac address-table Notification

No comments