Switchport Trunk Explained with Example.

By | December 3, 2023

How to Configure a Trunk Port on a Cisco Switch.

Switchport trunk in computer networking refers to a specific configuration on a switch port that allows it to carry traffic for multiple VLANs (Virtual Local Area Networks). This is in contrast to an “access port,” which typically carries traffic for a single VLAN.

Let’s explore the concept in more detail:

VLANs (Virtual Local Area Networks)

VLANs are used to segment network traffic logically into separate subnetworks. This segmentation enhances security, reduces broadcast traffic, and improves network management. By isolating traffic into different VLANs, network administrators can control access to resources more effectively and prevent unauthorized users from gaining access to sensitive data. Additionally, VLANs help optimize network performance by allowing for better bandwidth utilization and more efficient routing of traffic. Overall, the use of VLANs is a key component in creating a secure and efficient network infrastructure.

83% discount on VPN


Trunking

Trunking is a method used to pass traffic from multiple VLANs across a single physical link between switches or between a switch and a router. A trunk port is capable of receiving and sending traffic for multiple VLANs.


802.1Q VLAN Tagging

In most cases, VLAN trunking is implemented using the IEEE 802.1Q standard.
This standard introduces a technique known as “tagging,” where each Ethernet frame is tagged with a VLAN identifier (VID) as it traverses the trunk link. The VID indicates which VLAN the frame belongs to.
When the frame reaches the other end of the trunk link, the switch looks at this tag to determine which VLAN the frame is destined for.


Configuration:

On a managed switch, specific ports are configured as trunk ports. This configuration includes specifying which VLANs are allowed over the trunk.
A common configuration is to allow all VLANs over the trunk, known as a “trunk port with all VLANs allowed.”

To configure a trunk on a switch FastEthernet port, use the switchport mode trunk command. This command puts the interface into permanent trunking mode and negotiates to convert the neighbouring switch or links into trunk links.

Let’s use the topology below. The VLANs 10, 20, and 30 will support the management, IT, and Sales computers, PC1, PC2, and PC3. The F0/1 port on switch S1 will be configured as a trunk port and will forward traffic for VLANs 10, 20, and 30.

The following switch output shows the trunk configuration on interface fa0/1.

Configuration example:

SW1#config t

SW1(config)#interface fa0/1

SW1(config-if)#switchport mode trunk

SW1(config-if)#end

Note:

Fa0/1 is a native VLAN which is a default VLAN and is normally used to manage switches. But converting it to trunk mode is an added security!. However, you can change or modify a native VLAN. This I  mentioned earlier is added security.

Use the following command below to move or assign another switch port as native VLAN:

SW1#config t

SW1(config)#interface fa0/1

SW1(config-if)#switchport trunk native vlan 20

SW1(config-if)#end

The show interface fa0/1 or show running-config command reveals whether the trunk has been configured or not.

Summary

A Switchport Trunk refers to a networking configuration setting commonly found in Ethernet switches. A trunk link or port is a type of network connection that can carry multiple VLANs between switches. Essentially, it allows for the aggregation of multiple network cables into a single connection, which improves efficiency and reduces cabling complexity.

When a switch port is configured as a trunk port, it operates in a special mode that supports the transmission of VLAN-tagged frames. These tagged frames contain additional information that identifies the VLAN to which the traffic belongs. By understanding and appropriately handling these VLAN tags, trunk ports ensure that traffic is properly routed between VLANs across the network.

Additionally, trunk ports typically utilize protocols such as IEEE 802.1Q or ISL (Inter-Switch Link) to encapsulate VLAN information within Ethernet frames. Overall, Switchport Trunk configuration plays a crucial role in enabling efficient and secure communication between VLANs in a network environment.

How To Configure Switch Security VLAN Trunking VLAN Trunking Protocol

VLAN Switchport Membership mode

VLAN Configuration on Cisco router Troubleshoot VTP configuration

Native VLAN mismatches Troubleshoot VLAN and Trunks