How do I configure a port security on a Cisco switch
Ava Hall
Published Apr 24, 2026
1) Your switch interface must be L2 as “port security” is configure on an access interface. You can make your L3 switch port to an access interface by using the “switchport” command. 2) Then you need to enable port security by using the “switchport port-security” command.
How do I set port security on a Cisco switch?
1) Your switch interface must be L2 as “port security” is configure on an access interface. You can make your L3 switch port to an access interface by using the “switchport” command. 2) Then you need to enable port security by using the “switchport port-security” command.
What is port security in Cisco switch?
Port Security helps secure the network by preventing unknown devices from forwarding packets. … Packets that have a matching MAC address (secure packets) are forwarded; all other packets (unsecure packets) are restricted. You can enable port security on a per port basis.
What are the steps involved in configuring switch port security?
- define the interface as an access interface by using the switchport mode access interface subcommand.
- enable port security by using the switchport port-security interface subcommand.
How do you manage port security?
- Plan your port security configuration and monitoring.
- On the Port Security window, select the port(s) to configure.
- Click Set Security Policy for the Selected Ports.
- Set Learn Mode to Static so the port will detect unauthorized devices.
- Learned addresses that become authorized do not age-out.
What are the 3 port security violation modes for a switch?
Switchport Violations On Cisco equipment there are three different main violation types: shutdown, protect, and restrict.
What is the default port security setting on a switch port?
The default configuration of a Cisco switch has port security disabled. If you enable switch port security, the default behavior is to allow only 1 MAC address, shutdown the port in case of security violation and sticky address learning is disabled. Next, we will enable dynamic port security on a switch.
Why would you enable port security on a switch?
The main reason to use port security in a switch is to stop or prevent unauthorized users to access the LAN.How do you show port security?
To check and analyze the port security configuration on switch, user needs to access privilege mode of the command line interface. ‘show port-security address’ command is executed to check the current port security status.
Which device would you use to configure port security?What can you do? Configure port security on the switch. You’ve just enabled port security on an interface of a Catalyst 2950 switch. You want to generate an SNMP trap whenever a violation occurs.
Article first time published onWhy would a network administrator configure port security on a switch?
A network administrator would configure port security on the switch in order to prevent unauthorized hosts from accessing the LAN. This is the main reason why port security is being used in the switch. The feature is used to restrict input to an interface with the help of limiting and.
Can you configure port security trunk port?
Port security supports trunks. –On a trunk, you can configure the maximum number of secure MAC addresses both on the trunk and for all the VLANs on the trunk. –You can configure the maximum number of secure MAC addresses on a single VLAN or a range of VLANs.
What is enable or disable port security on a Cisco switch?
To enable sticky port security, enter the switchport port-security mac-address sticky command. When you enter this command, the interface converts all the dynamic secure MAC addresses, including those that were dynamically learned before sticky learning was enabled, to sticky secure MAC addresses.
Which circumstance causes a security violation on a switch port with port security enabled?
Switch Port Security It is a security violation when either of these situations occurs: The maximum number of secure MAC addresses have been added to the address table for that interface, and a station whose MAC address is not in the address table attempts to access the interface.
What are the different ways to apply port security on the access ports of layer 2 switch?
- Protect mode in Port Security of layer 2 switching. Protect option drop the frames with unknown source MAC address. …
- Restrict mode in Port Security of layer 2 switching. …
- Shutdown mode in Port Security of layer 2 switching.
What command lists the configuration settings for port security on an interface?
Other related commands: show port-security address – lists all the learned MAC addresses by interface. show port-security interface fa0/1 – shows the detailed port security settings for an interface, including enable/disable status.
How do I enable ports after security violation?
One method to enable back an interface, after a Port Security violation related shutdown (Errdisable state) is to bring the interface down and again up by issuing the commands “shutdown” and “no shutdown”. Other method is to bring up the switch port automatically after a period of time in Errdisable state.
What are the three methods of implementing Port Security?
- Protect: – This mode will only work with sticky option. …
- Restrict: – In restrict mode frames from non-allowed address would be dropped. …
- Shutdown: – In this mode switch will generate the violation alert and disable the port. …
- Switch(config)# errdisable recovery cause psecure-violation.
What is Switchport Port Security command?
The switchport security feature (Port Security) is an important piece of the network switch security puzzle; it provides the ability to limit what addresses will be allowed to send traffic on individual switchports within the switched network.
How do I configure ports?
- Open Windows Start menu, and click the “Settings” icon, choose “Network&Internet”, and “Windows Firewall”
- Find the “Advanced Settings” window and locate “Inbound Rules” on the left side of the panel.
- Click on “New Rule” on the right and choose “Port” option.
What does the show interface command display about the port in regards to port security?
The slot and port number of the interface. The number of MAC addresses secured on this interface. The secure MAC address. Whether the address was secured using a local or global resource.
What does port security block unauthorized access?
A. Port security blocks unauthorized access by examining the source address of a network device.
How do I test a port security violation on a Cisco switch?
Use show port-security interface to see the port security details per interface. You can see the violation mode is shutdown and that the last violation was caused by MAC address 0090.
Which Cisco IOS command is used to verify the port security configuration of a switch port?
8301 as an allowed host on the switch port. D. The command statically defines the MAC address of 00c0. 35F0.
What is the default action of port security on the interface when the maximum number of MAC addresses exceeded?
You can also choose to configure the action to take when the number of MAC addresses on the untrusted ports exceeds the configured limit. By default, the MAC limit option for a port is disabled.
Why do we use EtherChannel?
EtherChannel is a port link aggregation technology or port-channel architecture used primarily on Cisco switches. It allows grouping of several physical Ethernet links to create one logical Ethernet link for the purpose of providing fault-tolerance and high-speed links between switches, routers and servers.
What is the maximum number of secure MAC addresses that can be configured?
A secure port has a default of one MAC address. The default can be changed to any value between 1 and 3,000. The upper limit of 3,000 guarantees one MAC address per port and an additional 3,000 across all ports in the system.
Why should unused ports on a switch be disabled?
Disabling unused ports can stop a bad guy from plugging a malicious device into an unused port and getting unauthorized access to the network. It can also help train users—especially those in remote offices—to call IT before moving things around.