CCNA Training » Port Security Tutorial (2024)

By default, all interfaces on a Cisco switch are in an enabled state, meaning that anyone can potentially connect to your network through a wall socket, posing a security risk. Port Security is a feature that enhances the security of Cisco switches by controlling access to Ethernet ports based on the MAC addresses of connected devices.

Port Security allows network administrators to associate only specific MAC addresses or set a maximum number of MAC addresses with each switch port. This association restricts access to the interface, ensuring that only authorized devices with recognized MAC addresses can use it. If an unauthorized device attempts to connect, you can configure the switch to take predefined actions, such as discarding the incoming traffic, sending a warning message or shutting down the port to mitigate the security threat.

In the figure below, only host with MAC address of AAA (just for example. In fact the MAC address must be 48 bits) was configured to connect to the switch port while other MAC addresses are blocked:

CCNA Training » Port Security Tutorial (1)

Configuring port security

There are three steps to configure port security on a Cisco switch:

1. Configure the switch port as an access port using the “switchport mode access” command.
2. Activate port security on the switch port with the “switchport port-security” command.
3. Specify the permitted MAC addresses for sending frames through the interface. This can be done by utilizing either the “switchport port-security mac-address {MAC_Address}” command or, for dynamic MAC address learning, the “switchport port-security mac address sticky” command while the host is connected. An example of the configuration is shown below:

Switch(config)#interface e0/1Switch(config-if)#switchport mode accessSwitch(config-if)#switchport port-securitySwitch(config-if)#switchport port-security mac-address aaaa.aaaa.aaaa

This is the minimum configuration to activate port-security.

To verify the port-security configuration on an interface, we can use the “show port-security interface {interface}” command:

Switch#show port-security interface Ethernet0/0Port Security : EnabledPort Status : Secure-upViolation Mode : ShutdownAging Time : 0 minsAging Type : AbsoluteSecureStatic Address Aging : DisabledMaximum MAC Addresses : 1Total MAC Addresses : 1Configured MAC Addresses : 0Sticky MAC Addresses : 1Last Source Address:Vlan : AAAA.AAAA.AAAA:1Security Violation Count : 0

There are two optional steps for more control of this feature:

1. Specify the action the switch should take when it receives a frame from an unauthorized device using the “switchport port-security violation {protect/restrict/shutdown}” command.

+ Protect: drops the packets with an unknown source MAC address. It will not make log entry for dropped packets. Interface will learn MAC address until it reaches the maximum allowed number of MAC address that was configured. Any additionally learned addresses would be dropped while keeping interface operational.
+ Restrict: drops the packets with unknown source MAC addresses. It then causes the SecurityViolation counter to increase and generate a security violation alert.
+ Shutdown: causes the interface to enter an error-disabled state (same as down state) immediately. It then sends an SNMP trap notification. The switchport will remain in this state until manually removed. This is the default violation mode.

All three options result in discarding traffic from the unauthorized device. Both the “restrict” and “shutdown” options also generate log messages when a violation occurs, with the “shutdown” mode additionally disabling the port.

2. Set the maximum allowable number of MAC addresses that can be used on the port using the “switchport port-security maximum {number}” interface command. The default number of MAC addresses allowed is 1 so if we connect another host to the same port, the security violation will occur and the port is put into err-disabled state:

First we will receive an error message like this when we try to connect another host (with MAC 0090.ab0e.4582) to this port (through another switch or hub):

%PM-4-ERR_DISABLE: psecure-violation error detected on Et0/0, putting Et0/0 in err-disable state%PORT_SECURITY-2-PSECURE_VIOLATION: Security violation occurred, caused by MAC address 0090.ab0e.4582 on port Ethernet0/0.%LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to down%LINK-3-UPDOWN: Interface Ethernet0/0, changed state to down

Then we can check this port to see it is in err-disabled state:

Switch#show interfaces Ethernet0/0Ethernet0/0 is down, line protocol is down (err-disabled)

Err-disabled state is same as “shutdown” state. But it means the security violation occurred on this port.

Also the port-security on this port:

Switch#show port-security interface Et0/0Port Security : EnabledPort Status : Secure-shutdownViolation Mode : ShutdownAging Time : 0 minsAging Type : AbsoluteSecureStatic Address Aging : DisabledMaximum MAC Addresses : 1Total MAC Addresses : 1Configured MAC Addresses : 1Sticky MAC Addresses : 0Last Source Address:Vlan : 0090.ab0e.4582:1Security Violation Count : 1

The line “Port Status: Secure-shutdown” means that this port has been shut down because of port-security. We can reactivate this port by using the “shutdown” and “no shutdown” commands.

Summary

Port security is a good feature in Cisco devices for securing access to your network through a switch. By following the steps outlined in this tutorial, you can configure, manage, and troubleshoot port security to enhance the security of your network and prevent unauthorized access.

CCNA Training » Port Security Tutorial (2024)

FAQs

What is port security CCNA? ›

By using port security, a network administrator can associate specific MAC addresses with the interface, which can prevent an attacker to connect his device. This way you can restrict access to an interface so that only the authorized devices can use it.

What are the 6 commands related to port security? ›

Related commands: port-security enable, port-security port-mode, port-security ntk-mode, port-security intrusion-mode, port-security max-mac-count, port-security authorization ignore, port-security oui, and port-security trap.

Is there a difference between CCNA and CCNA security? ›

CCNA R&S is associate level of Cisco Certification in Routing & Switching track/technologies, whereas CCNA Security is associate level of Certification offered by Cisco Systems in Network Security track/technologies.

What are the different types of port security? ›

Port security implements two traffic filtering methods, dynamic locking and static locking. These methods can be used concurrently. Dynamic locking. You can specify the maximum number of MAC addresses that can be learned on a port.

Is CCNA security discontinued? ›

Cisco announced the discontinuation of CCNA Security certification in 2020.

What are the three violation modes in port security? ›

You can configure the port for one of three violation modes: protect, restrict, or shutdown. See the "Configuring Port Security" section. To ensure that an attached device has the full bandwidth of the port, set the maximum number of addresses to one and configure the MAC address of the attached device.

How do you manage port security? ›

To configure port security:
  1. Plan your port security configuration and monitoring.
  2. On the Port Security window, select the port(s) to configure.
  3. Click Set Security Policy for the Selected Ports.
  4. Set Learn Mode to Static so the port will detect unauthorized devices.
  5. Learned addresses that become authorized do not age-out.

What is the maximum MAC address for a Cisco port security? ›

The maximum number of secure MAC addresses per port is 132. switchport port-security violation {shutdown | restrict | protect}: This command tells the switch what to do when the number of MAC addresses on the port has exceeded the maximum. The default is to shut down the port.

What is the Cisco command to list all ports? ›

You can display summary or detailed information on the switch ports using the show port command. To display summary information on all of the ports on the switch, enter the show port command with no arguments. Specify a particular module number to see information on the ports on that module only.

What are the 3 styles of port? ›

Within the three categories of Port wine, Ruby, Tawny and White, there are more than one style, each with their own labeling, so it can be frustrating as a consumer to know and remember all the different kinds.

What is the best port for security? ›

Top 25 Commonly used ports in Cybersecurity
  • HTTP (Port 80) — Used for transmitting web pages over the internet.
  • HTTPS (Port 443) — Used for transmitting secure web pages over the internet.
  • SSH (Port 22) — Used for secure remote login and file transfer.
  • FTP (Ports 20 and 21) — Used for file transfer over the internet.
Feb 3, 2023

Which type of port is most vulnerable to attacks? ›

Ports most targeted by attackers include ports 443 and 8080 (HTTP and HTTPS) No port is 100% secure and what determines the risk of a port is the way it is managed. To protect open ports, it is essential to use ports that encrypt traffic in order to make it difficult for hackers to access sensitive information.

What is the meaning of port security? ›

In a computer network, port security is a feature that restricts which devices may connect to a certain switch port. It protects against various security issues, including unauthorized access, data theft, network attacks, and more. Various methods of configuration, such as MAC address filtering, are available.

What is the job of port security? ›

Security specialists posted at marine ports or on ships will be tasked with patrolling the property, monitoring surveillance equipment, inspecting cargo, buildings, vehicles, equipment, and keeping an eye on all access points.

What is port in CCNA? ›

In computer networking, a port or port number is a number assigned to uniquely identify a connection endpoint and to direct data to a specific service. At the software level, within an operating system, a port is a logical construct that identifies a specific process or a type of network service.

What is port in network security? ›

What is a port? A port is a virtual point where network connections start and end. Ports are software-based and managed by a computer's operating system. Each port is associated with a specific process or service.

Top Articles
$50 Weekly Grocery Budget - Menu and grocery list for a family of four!
What is a Debt Instrument? Definition and Structure | Bajaj Finance
R Statistical Software
Heccymar Salerno Video
Weekends Only Credit Card Login
He's Baby Gronk. She's Livvy. He's got drip and she rizzed him up (and we've got it translated)
Rek Funerals
Is Costco Gas Good? Quality, Cost & Benefits | Ridester
Seafarers: Working conditions, health assessments and training requirements - Your Europe
Blue Diamond French Bulldogs
Tcc Virginia Beach Testing Center
Flights To Frankfort Kentucky
Tampa Bay Times Mugshots
Walmart Auto Care Centers Salem Photos
Red Wing Mn City Council
What Is a Bank Guarantee?
The Exorcist: Believer Showtimes Near Regal Carlsbad
Jailer Showtimes Near Regal Ua Galaxy - Indianapolis
18 Cafes in Yoyogi that You'll Want to Visit Repeatedly
Xm Cowboys Game
Tiraj Rapid Georgia Midi
Kenichiro Yoshida Net Worth
Mte Outage Map
Tamilyogi Movies Download 2022 Free Download
Kismile Heater Not Working
Closest O'reilly's Near Me
Estes4Me Login
Milf Hunting In Another World Chapter 19
Wrj Mugshots
Skyward Login Wylie Isd
Top 10 SEO Copywriting Service PowerPoint Presentation Templates in 2024
Paytexaswarrant
On a testé : une brosse visage nettoyante qui n'a aucun défaut
Pa Turnpike Vendor Portal
Craigslist Classified Phoenix Arizona
Bad Soden: Stadtplan, Tipps & Infos | ADAC Maps
Quantum Break's Story and Ending Explained
Solar Nails Port Lavaca
The Craigslist Killer - Filmkritik - Film - TV SPIELFILM
Creepshotorg
24Hrs Mcdonalds Near Me
SF valley apartments / housing for rent - craigslist
Facebook Levels Fyi
Rawdogriley
Box Csun
Oriellys Beeville
Where Is William 'Doc Marshall Now
Is Kaplan Cat Harder Than Nclex
Sariixo Of Leaked
How to Authenticate Designer Clothes
Joplin.craigslist
Latest Posts
Article information

Author: Domingo Moore

Last Updated:

Views: 6505

Rating: 4.2 / 5 (53 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Domingo Moore

Birthday: 1997-05-20

Address: 6485 Kohler Route, Antonioton, VT 77375-0299

Phone: +3213869077934

Job: Sales Analyst

Hobby: Kayaking, Roller skating, Cabaret, Rugby, Homebrewing, Creative writing, amateur radio

Introduction: My name is Domingo Moore, I am a attractive, gorgeous, funny, jolly, spotless, nice, fantastic person who loves writing and wants to share my knowledge and understanding with you.