
Here, we define a range of interfaces on which we want to configure port security, then proceed to configure port-security for all the interfaces specified at a go instead of one interface at a time. That’s all for port-security configuration on fa0/2Ī shorthand method for configuration :The port security configurations for both fa0/1 and fa0/2 could be done more faster with the help of interface range command as shown below: Switch(config-if-range)#interface range fa0/1-2 Switch(config-if)#switchport port-security violation shutdown In a similar way to switch interface fa0/1, configure switch port security for fa0/2 connected to PC2 : Switch(config)#interface fa0/2 We’re are done with port security configuration for fa0/1 Switch(config-if)#switchport port-security maximum 1 Let’s add the above 2 commands to our configuration: Switch(config-if)#switchport port-security violation shutdown defining the maximum number of MAC addresses that can be received on the port using the switchport port-security maximum NUMBER interface submode command.All three options discard the traffic from the unauthorized device. This is done using the switchport port-security violation interface command.

defining the action that the switch will take when a frame from an unathorized device is received.

The sticky keyword instructs the switch to dynamically learn the MAC address of the currently connected host. Switch(config-if)#switchport port-security mac-address sticky Switch(config-if)#switchport port-security Here are the commands: Switch(config)#int fa0/1

If an unauthorized device is connected to the same port, you can define the action that the switch will take, such as discarding the traffic, sending an alert, or shutting down the port. This will enable you to restrict access to a given switch interface so that only the authorized devices can use it. Switch port Security is a network security feature that associates specific MAC addresses of devices(such as PCs) with specific interfaces on a switch. Hello and welcome! In this tutorial, we’ll have an overview of switch port security then configure it in Packet Tracer.
