Cisco Catalyst – Troubleshooting Multiple Device Connections on a Switch

cisco-catalystcisco-commands

I have this configuration on an interface of my CISCO switch (switch 1).

 switchport access vlan 52  
 switchport mode access  
 switchport port-security  
 switchport port-security aging time 5  
 switchport port-security violation restrict  
 spanning-tree portfast  

Now when I connect another switch (switch 2) to this interface, then a PC (PC 1) to switch 2, all works fine. But when I connect another PC (PC 2) to switch 2, PC 1 goes automatically out of network, leaving only PC 1.

In summary, only one device can be connected to switch 2.

Here are the logs

Security violation occurred, caused by MAC address a0b3.cc9c.796a on port GigabitEthernet2/26.

2d02h: %PORT_SECURITY-2-PSECURE_VIOLATION: Security violation occurred, caused by MAC address a0b3.cc9c.796a on port GigabitEthernet2/26.
2d02h: %PORT_SECURITY-2-PSECURE_VIOLATION: Security violation occurred, caused by MAC address a0b3.cc9c.796a on port GigabitEthernet2/26.
2d02h: %PORT_SECURITY-2-PSECURE_VIOLATION: Security violation occurred, caused by MAC address a0b3.cc9c.796a on port GigabitEthernet2/26.

What could be the problem? How can I solve the problem?

Thanks in advance

PS: I am new to Networking

Best Answer

The problem is, that by default, maximum number of secure mac address is 1. So when the switch 1 learns about the first PC, it will save MAC of PC as secure MAC. Second PC's MAC is not secure, therefore port-security violation occurs, restricting traffic.

You can solve this by increasing maximum number of secure MAC adresses using command

switch1(config-if)#switchport port-security maximum 2

EDIT: Fixed up the syntax