Access port

On this page 7

An access port is a switch port that belongs to exactly one VLAN and sends and receives untagged Ethernet frames, typically connecting a single end device such as a computer, printer, camera or access point. In Ethernet & switching, it is the counterpart of the trunk port: an access port hides VLANs from the attached device, while a trunk carries several VLANs between network devices using IEEE 802.1Q tags.

Because the connected device never sees a VLAN tag, it needs no VLAN configuration at all. The switch decides which broadcast domain the device joins purely by the port it is plugged into, which makes access ports the default building block of managed switch deployments in offices, schools and factories.

How an access port handles frames

When an untagged frame arrives on an access port, the switch assigns it internally to the port’s VLAN, often called the access VLAN or, in IEEE terms, the port VLAN ID (PVID). It learns the source MAC address in the MAC address table for that VLAN and forwards the frame only to ports in the same VLAN.

On the way out, the switch removes any VLAN tag before sending the frame to the device. If a tagged frame arrives from the device, behavior depends on the platform: many switches drop frames tagged with a different VLAN, and some accept frames tagged with the access VLAN itself. Relying on that behavior is poor practice.

DirectionFrame receivedSwitch action
IngressUntagged frameClassified into the access VLAN
IngressTagged with another VLANUsually dropped
EgressFrame from the access VLANSent untagged
EgressFrame from another VLANNever sent out this port
Frame handling on an access port

Access port compared with trunk and hybrid ports

Switch vendors use slightly different vocabulary, but most port modes fall into three groups. Understanding them prevents the most common VLAN mistakes.

Port modeVLANs carriedTaggingTypical neighbor
Access portOneUntagged onlyPC, printer, camera
Trunk portManyTagged, one native VLAN untaggedSwitch, router, hypervisor
Hybrid or general portManyMixed per VLANSpecialized devices
Access port with voice VLANOne data plus one voiceData untagged, voice taggedIP phone with a PC behind it
Switch port modes

The voice VLAN is a widely used extension. An IP phone learns the voice VLAN through LLDP-MED or a vendor discovery protocol, tags its own traffic, and passes the untagged traffic of a computer plugged into its built-in switch to the data VLAN. Strictly speaking the port then carries two VLANs, yet most vendors still configure it as an access port.

Configuring an access port

A minimal configuration sets the port mode to access and assigns the access VLAN. Good practice adds edge and security settings, because access ports face end devices that the network team does not fully control.

SettingTypical valuePurpose
Port modeStatic access, no negotiationPrevents a device from forming a trunk
Access VLANDepartment or device-class VLANPlaces the device in the right segment
Edge port or PortFastEnabledSkips spanning tree listening and learning delay
BPDU guardEnabledShuts the port if a switch is connected
Port security or 802.1XLimited MAC count or authenticationControls which devices may connect
Storm controlBroadcast threshold, often a few percentLimits broadcast floods
Recommended access port settings

Enabling PortFast or an edge port setting matters in practice: without it, classic Spanning Tree Protocol keeps a new port blocked for about 30 seconds, long enough for DHCP to time out on some devices. Rapid spanning tree shortens the delay but still benefits from the edge setting.

Security considerations for access ports

Access ports are where untrusted devices meet the network, so most layer 2 attacks start there. The main defense is to make sure a port can only ever behave as an access port.

  • Disable automatic trunk negotiation, such as dynamic trunking protocols, to prevent switch spoofing attacks.
  • Do not use VLAN 1 as an access VLAN; keep it unused and move management elsewhere.
  • Assign unused ports to an isolated parking VLAN and shut them down administratively.
  • Enable DHCP snooping and dynamic ARP inspection in user VLANs to block rogue servers and ARP spoofing.
  • Use 802.1X with dynamic VLAN assignment where devices move often, so the VLAN follows the user rather than the wall socket.

VLAN hopping by double tagging targets the native VLAN of trunks, not access ports directly, but it begins with an attacker sitting on an access port in that native VLAN. Keeping user access VLANs different from every trunk’s native VLAN removes the precondition.

Common mistakes and troubleshooting

Most access port problems show up as a device that gets no address or reaches the wrong systems. Checking the port mode, the VLAN assignment and whether that VLAN exists and is allowed on the uplink trunk solves the majority of cases. Commands that display the port’s operational mode and access VLAN, together with the MAC address table entry for the device, usually reveal the fault within minutes.

A frequent source of confusion is the difference between configured and operational state. A port configured for access may still be shut down by BPDU guard or port security after a violation, and it will then show as disabled or error-disabled even though its VLAN settings are correct. Recovering such a port requires removing the cause first, then re-enabling the interface.

Explained without jargon

Think of a building where each wall socket is wired into one particular department’s network. An access port is that kind of socket on a switch: whatever you plug in automatically joins the department chosen for that socket.

The computer itself does not need to know anything about departments. The switch makes the decision, which keeps setup simple and stops a device from wandering into a network it should not reach.

A typical use case

A secondary school installs a new 48-port managed switch in each classroom block. The network administrator creates three VLANs: VLAN 10 for staff computers, VLAN 20 for student devices and VLAN 30 for security cameras. Ports 1 to 8 become access ports in VLAN 10, ports 9 to 40 access ports in VLAN 20, and ports 41 to 46 access ports in VLAN 30, with the last two ports configured as trunks to the core switch.

Every access port gets PortFast and BPDU guard. During the first week a student plugs a small home switch into a classroom socket to share the connection. BPDU guard detects it and disables only that one port, the rest of the classroom keeps working, and the administrator sees the event in the log and re-enables the port after removing the device.