Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Access and trunk ports
In computer networking, access and trunk ports are two fundamental types of switch ports that manage network traffic differently. Access ports connect individual end devices to a single VLAN, while trunk ports carry traffic from multiple VLANs between network devices like switches and routers.
Understanding these port types is essential for proper VLAN implementation and network segmentation in modern switched networks.
Access Ports
Access ports are the simplest type of switch port, designed to connect end devices such as computers, printers, and IP phones. Each access port belongs to exactly one VLAN, and all traffic from the connected device is automatically tagged with that VLAN's ID.
Key characteristics of access ports:
Single VLAN membership Each port is assigned to only one VLAN
Untagged frames End devices send and receive untagged Ethernet frames
VLAN transparency Connected devices are unaware of VLAN operations
Configuring Access Ports
To configure an access port on a Cisco switch:
switch(config)# interface GigabitEthernet1/0/1 switch(config-if)# switchport mode access switch(config-if)# switchport access vlan 10
Trunk Ports
Trunk ports carry traffic from multiple VLANs over a single physical connection. They use VLAN tagging (typically 802.1Q) to identify which VLAN each frame belongs to, enabling communication between switches and other VLAN-aware devices.
Key characteristics of trunk ports:
Multiple VLAN support Can carry traffic from many VLANs simultaneously
Tagged frames Uses 802.1Q tags to identify VLAN membership
Inter-switch connectivity Essential for connecting switches together
Configuring Trunk Ports
To configure a trunk port on a Cisco switch:
switch(config)# interface GigabitEthernet1/0/2 switch(config-if)# switchport mode trunk switch(config-if)# switchport trunk allowed vlan 10,20,30
When to Use Each Port Type
| Scenario | Port Type | Reason |
|---|---|---|
| Connecting end devices (PCs, printers) | Access | Devices need single VLAN membership |
| Inter-switch connections | Trunk | Must carry multiple VLANs |
| Router connections | Trunk | Router needs access to multiple VLANs |
| Wireless Access Points | Trunk | Support multiple SSIDs on different VLANs |
Key Configuration Considerations
Native VLAN
Trunk ports have a native VLAN (default VLAN 1) for untagged traffic. This VLAN should match on both ends of a trunk link to avoid connectivity issues.
VLAN Pruning
Use the switchport trunk allowed vlan command to limit which VLANs can traverse a trunk, improving security and reducing unnecessary broadcast traffic.
Conclusion
Access ports connect end devices to a single VLAN with untagged frames, while trunk ports carry multiple VLANs using 802.1Q tagging. Proper configuration of these port types is essential for effective VLAN implementation and network segmentation.
