Join our Newsletter — 33% off our NHI Course
Home› Glossary› Architecture & Implementation› Layer 2 Switch
Architecture & Implementation

Layer 2 Switch

← Back to Glossary
By NHI Mgmt Group Updated October 24, 2026 Domain: Architecture & Implementation

A Layer 2 switch forwards network traffic within the same local network using device MAC addresses. It operates at the data link layer, connecting endpoints efficiently without routing between IP networks, and supports segmentation features such as VLANs to improve control, performance, and broadcast containment.

How a Layer 2 Switch Works

A Layer 2 switch operates at the data link layer, using MAC addresses to decide where Ethernet frames should go. It learns which devices sit on which ports and forwards traffic only where it needs to go, which makes local communication faster and reduces unnecessary flooding compared with a shared hub.

That forwarding behaviour is why Layer 2 switching is a core building block of enterprise LANs. It provides efficient endpoint connectivity inside the same broadcast domain, while leaving routing between different IP networks to Layer 3 devices.

VLAN Segmentation and Broadcast Control

Layer 2 switches are often used with VLANs to divide one physical network into multiple logical segments. That separation helps contain broadcasts, reduces accidental cross-talk between groups, and lets organisations create clearer trust boundaries inside a campus or data-centre network.

VLAN design is one of the main reasons Layer 2 switching remains relevant even when routing is widely available. A well-structured switch fabric can improve performance and administrative control, but it also introduces dependency on correct port assignment, trunk configuration, and segmentation policy.

Where Layer 2 Switching Fits in Network Architecture

Layer 2 switching is best understood as the access and aggregation layer of a network, not as a replacement for routing. It connects hosts, printers, access points, servers, and other local endpoints, then hands off traffic that must cross subnets or reach external networks to a router or Layer 3 switch.

In practice, this means the switch fabric is part of the local delivery plane, while IP design, subnetting, and inter-VLAN policy determine how traffic moves beyond the local segment. The distinction matters because performance tuning, segmentation goals, and fault domains are different at Layer 2 than they are at Layer 3.

Common Operational Limits and Failure Modes

Layer 2 switching is efficient, but it is not inherently safe just because it is local. Misconfigured VLANs, looped cabling, overly broad trunk access, or incorrect spanning-tree behaviour can cause outages, leakage between segments, or noisy broadcast conditions that affect the whole local domain.

Because the switch forwards based on learned MAC information, it can also be affected by malformed or excessive frame patterns, poor port-security design, or flat network layouts that make lateral movement easier after a foothold is gained.

Risk and Threat Considerations

Layer 2 switches concentrate local connectivity, so configuration errors can expose more of the network than intended. The main security concern is not the switching function itself, but the way trust boundaries, VLAN separation, and port-level controls can fail when a flat or weakly segmented design is used.

Failure mechanism: A compromised endpoint, rogue device, or misconfigured trunk can exploit weak Layer 2 boundaries to move laterally, reach adjacent systems, or blend into ordinary local traffic.

Impact: Attackers may gain broader network reach, increase the blast radius of a compromise, or disrupt local services through loops, flooding, or segmentation bypass.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

NIST CSF 2.0, NIST SP 800-53 Rev 5 and CIS Controls v8 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
NIST CSF 2.0PR.AA-05 — Network IntegrityLayer 2 segmentation supports controlled network trust boundaries and traffic separation.
Recommendation — Use network segmentation controls to limit unnecessary east-west communication on switch fabrics.
NIST SP 800-53 Rev 5SC-7 — Boundary ProtectionSwitching and VLAN design materially define local network boundary enforcement.
CM-7 — Least FunctionalityPort, trunk, and service minimization reduce the attack surface of Layer 2 infrastructure.
AC-4 — Information Flow EnforcementVLANs and switch policy enforce how traffic may flow between local segments.
Recommendation — Enforce boundary protections to separate VLANs and restrict unauthorized internal traffic flows. Disable unnecessary switch features, ports, and trunks to reduce exposure. Apply flow-enforcement rules to prevent unauthorized inter-segment communication.
CIS Controls v8CIS-12 — Network Infrastructure ManagementSwitches are core network infrastructure requiring secure configuration and governance.
Recommendation — Manage switch configurations centrally and review them for unauthorized changes.

Practitioner Guidance

Why practitioners should care: Layer 2 switching decisions shape how much of the environment shares a broadcast domain and how easily traffic can be separated into manageable zones. That makes switch design a security and resilience decision, not only a performance one.

Common misunderstanding: Many teams treat VLANs as if they are automatically strong isolation. In reality, segmentation only works when trunks, access ports, management interfaces, and inter-switch links are tightly controlled and regularly reviewed.

Practitioner takeaway: Treat the Layer 2 fabric as a control surface, validate its segmentation continuously, and assume that weak port or trunk governance can turn a local connectivity layer into an attack path.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on October 24, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org