Then, disconnect the cable between PC0 and Switch0.Īfter configuring PC2 computer, connect to Fa0/1 interface on Switch0. Now add another computer to the workspace to test whether port security is working and configure the IP settings of this computer. You can view the detailed information of the FastEthernet0/1 interface by applying the show port-security interface fa0/1 command.
SWITCHPORT PORT SECURITY MAC ADDRESS MAC
The MAC addresses here will be compared in case of violations. When you execute the show mac address-table command, you can see that the MAC addresses of the computers connected to the Switch are saved in the table. The SecurityViolation (Count) section is 0 because there are no violations on the interfaces. In the privileged mode of the switch, execute the show port-security command. In the event of any breach of these interfaces, the Fa0/1 or Fa0/2 interfaces will be shutdown.
The interface is set to access mode with the Switchport Mode Access command.Port Security is activated in FastEthernet0/1 and FastEthernet0/2 interfaces on the switch.If we explain the above configuration commands Switch(config-if)#switchport port-security violation shutdown Switch(config-if)#switchport port-security maximum 1 Switch(config-if)#switchport port-security mac-address sticky Switch(config-if)#switchport port-security Switch#configure terminalĮnter configuration commands, one per line. After the connection test, click on the Cisco Switch.Ĭlick on the Switch to open the CLI prompt, and then execute the following commands to enable port security. Similarly, test the connection with Ping from PC1. Ping the PC0 to the Router interface and PC1 to test the connection.
Open Cisco Packet Tracer and add one Router, Switch and two computers to the workspace, then assign the IP address to the Cisco Router.īefore enabling Port Security, test the network connection between clients.