you NEED to learn Port Security…….RIGHT NOW!! // FREE CCNA // EP 14
Based on NetworkChuck's video on YouTube. If you like this content, support the original creators by watching, liking and subscribing to their content.
Treat every exposed Ethernet jack as a potential entry point because plug-in devices can often obtain network settings via DHCP and begin scanning.
Briefing
Exposed Ethernet ports are an easy entry point for attackers because a plug-in device can often obtain network settings via DHCP and then scan or probe the LAN. A key example is the Shark Jack from Hack 5: once connected to an active switch port, it requests an IP address through DHCP, learns the subnet mask, default gateway, and DNS details, and then runs an automated reconnaissance step (in this case an nmap scan) to gather information about reachable hosts and open ports. The practical takeaway is blunt: leaving switch ports “available” can turn everyday infrastructure into a remote foothold—especially in places like offices, airports, and even homes.
The defense starts with reducing what an attacker can use. Unused ports should be shut down at the switch level so they can’t come up even if someone plugs in a device. On Cisco switches, the workflow is to identify down interfaces with commands like “show ip interface brief” and then administratively disable specific ports using “configure terminal,” “interface fastethernet …,” and the “shutdown” command. The video also recommends a “black hole” approach for ports that must remain physically available: isolate them into a dedicated VLAN (a “black hole VLAN”) that has no DHCP server and no default gateway, so devices plugged into those ports can’t reach other parts of the network. In the Cisco example, VLAN 6666 is created and specific FastEthernet ports are assigned to it with “switchport access vlan 666,” effectively trapping any unauthorized device.
But even shutting down unused ports doesn’t solve the scenario where an attacker unplugs a legitimate device and plugs in their own for a moment. That’s where port security comes in. Port security uses Layer 2 MAC address learning to enforce an allowlist per switch port: the switch records which MAC address is permitted, and if a different MAC appears, the port can be shut down or traffic can be restricted. On Cisco, the configuration sequence includes setting the port as an access port (“switchport mode access”), enabling port security (“switchport port-security”), setting the maximum number of allowed MACs (“switchport port-security maximum 1”), and defining the allowed MAC behavior—either explicitly via “mac-address …” or implicitly via “sticky,” which learns the first connected device’s MAC and locks it in. The violation action (“switchport port-security violation shutdown” by default in the example) determines what happens when an unauthorized MAC shows up.
A live demonstration shows the consequence: after enabling port security on a specific GigabitEthernet interface, plugging in a different device triggers a security violation, and the switch places the port into an error-disabled state. Recovery requires administrative intervention—shutting the interface and bringing it back up with “shutdown” followed by “no shutdown,” after which the port returns to normal operation.
Finally, the video places port security in a broader enterprise context. It notes that stronger alternatives exist, including 802.1X authentication (login-based access), certificate-based device authentication, and automated profiling systems such as Cisco ICE. The overall message is a layered defense: disable or black-hole unused ports, and for active ports, prevent MAC spoofing and unplug-and-replug attacks with port security (or stronger identity-based controls).
Cornell Notes
Ethernet ports can be abused when attackers plug in devices that obtain network parameters via DHCP and then scan the LAN. The defense begins by shutting down unused switch ports so they can’t come up, and by isolating any “needed but risky” ports into a black hole VLAN with no DHCP or gateway. For active ports, port security limits which MAC addresses are allowed on each switch interface; if a different MAC appears, the switch can shut the port down or restrict traffic. On Cisco, port security is configured with “switchport port-security,” a MAC allow policy (explicit or “sticky”), and a violation action such as “shutdown.” Recovery from violations requires re-enabling the interface after it enters an error-disabled state.
Why does an exposed Ethernet port create a hacking opportunity even without credentials?
What are the two baseline ways to reduce risk from unused switch ports?
How does port security stop the unplug-and-replug attack?
What does “sticky” MAC learning do in Cisco port security?
What happens to a Cisco port when a port security violation occurs, and how is it restored?
What stronger alternatives to port security are mentioned for enterprise environments?
Review Questions
- If a switch port is left unused but still physically connected to the network, what two switch-side controls can prevent an attacker from using it?
- Describe the role of DHCP in the Shark Jack attack workflow and why that matters for port defenses.
- On Cisco, which port security settings determine (1) how many MAC addresses are allowed and (2) what the switch does when a different MAC appears?
Key Points
- 1
Treat every exposed Ethernet jack as a potential entry point because plug-in devices can often obtain network settings via DHCP and begin scanning.
- 2
Administratively shut down unused switch ports so they cannot transition to an operational state when something is plugged in.
- 3
For ports that must remain enabled, isolate them using a black hole VLAN with no DHCP server and no default gateway to prevent lateral access.
- 4
Use port security on active ports to enforce a per-interface MAC allowlist and block unplug-and-replug attacks.
- 5
Choose a port security violation action (such as shutdown) that matches the desired risk response and operational workflow.
- 6
When a port security violation shuts a port down, expect an error-disabled state and plan for interface recovery (shutdown/no shutdown).
- 7
Consider stronger access controls like 802.1X or certificate-based authentication for environments that need identity-based port access.