Trunk Port is also referred to as Trunking Link. To move VLAN information between switches, it must be enabled on the respective ports.
What is a Trunk Port?
In our previous article, we examined the configuration of the Access Port in Switches. Access Ports belong to a single VLAN and do not make any frame changes for the VLAN information carried between the Switches, only the incoming traffic.
All VLANs configured with the Trunk Port defined on the two Switches are forwarded. VLAN information is encapsulated before passing through the Port, which is encapsulation ISL or 802.1Q.
In two Switches connected, the Trunk connection must be configured on two interfaces in order to pass different VLANs.
What is a Cisco Trunk?
The encapsulation method is available only for Cisco products. If you are using Cisco Switch devices in a network environment, you can set the encapsulation status to ISL.
802.1Q encapsulation has been developed to ensure the compatibility of all Switches.
802.1Q = Adds a 4-byte tag after the source address in the frame.
ISL (Inter-Switch Link) = Specific to Cisco only. Adds a 26-byte header and a 4-byte trailer into the frame.
How to Configure Trunk Port on Cisco Switch
To activate Trunk and examine its logic, open Packet Tracer and create a network topology, as shown in the following illustration.
Step 1
Perform VLAN creation on Cisco Switch before enabling this protocol. After creating the VLAN, click Switch0 to transfer the VLAN ID between the Switches.
Step 2
In the window that opens, click the CLI tab and then perform the following commands.
Switch# conf t
Switch(config)# interface gigabitethernet 0/1
Switch(config-if)# switchport mode trunk
Switch(config-if)# end
Switch# wr
Step 3
You must enable the Trunk feature on each device port to transmit information about different VLANs between switches.
Now click on the other Switch1 and configure the interface plugged into Switch0 as a Trunk.
Switch# conf t
Switch(config)# interface gigabitethernet 0/1
Switch(config-if)# switchport mode trunk
Switch(config-if)# end
Switch# wr
Step 4
From the PC1 command prompt in the Packet Tracer workspace, ping PC2, which is a member of VLAN5. You can see that the ping was successful from the image below.
If Trunk had not been configured in this scenario, the computers in VLAN5 would not have been able to communicate with each other!
Thus, VLANs at different locations can communicate with each other using the encapsulation method on the Ports.
Step 5
After applying the show interfaces switchport command on Switch0, you can check that the gigabitethernet 0/1 interface is set to Trunk.
Step 6
You can also check that the gigabitethernet 0/2 interface is set to Trunk after applying the show interfaces switchport command on Switch1.
Show Commands for Trunk Connection
Switch0#show running-config
Building configuration...
Current configuration : 1118 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
!
!
spanning-tree mode pvst
!
interface FastEthernet0/1
!
interface FastEthernet0/2
switchport access vlan 5
switchport mode access
!
interface FastEthernet0/3
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface FastEthernet0/16
!
interface FastEthernet0/17
!
interface FastEthernet0/18
!
interface FastEthernet0/19
!
interface FastEthernet0/20
!
interface FastEthernet0/21
!
interface FastEthernet0/22
!
interface FastEthernet0/23
!
interface FastEthernet0/24
!
interface GigabitEthernet0/1
switchport mode trunk
!
interface GigabitEthernet0/2
!
interface Vlan1
no ip address
shutdown
!
!
line con 0
!
line vty 0 4
login
line vty 5 15
login
!
!
end
Switch#
Switch0#show vlan brief
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/3, Fa0/4, Fa0/5
Fa0/6, Fa0/7, Fa0/8, Fa0/9
Fa0/10, Fa0/11, Fa0/12, Fa0/13
Fa0/14, Fa0/15, Fa0/16, Fa0/17
Fa0/18, Fa0/19, Fa0/20, Fa0/21
Fa0/22, Fa0/23, Fa0/24, Gig0/2
5 IT active Fa0/2
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
Switch#
Switch0#show interfaces trunk
Port Mode Encapsulation Status Native vlan
Gig0/1 on 802.1q trunking 1
Port Vlans allowed on trunk
Gig0/1 1-1005
Port Vlans allowed and active in management domain
Gig0/1 1,5
Port Vlans in spanning tree forwarding state and not pruned
Gig0/1 1,5
Switch#
Switch1#show running-config
Building configuration...
Current configuration : 1118 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
!
!
spanning-tree mode pvst
!
interface FastEthernet0/1
switchport access vlan 5
switchport mode access
!
interface FastEthernet0/2
!
interface FastEthernet0/3
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface FastEthernet0/16
!
interface FastEthernet0/17
!
interface FastEthernet0/18
!
interface FastEthernet0/19
!
interface FastEthernet0/20
!
interface FastEthernet0/21
!
interface FastEthernet0/22
!
interface FastEthernet0/23
!
interface FastEthernet0/24
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
switchport mode trunk
!
interface Vlan1
no ip address
shutdown
!
!
line con 0
!
line vty 0 4
login
line vty 5 15
login
!
end
Switch#
Switch1#show vlan brief
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/2, Fa0/3, Fa0/4, Fa0/5
Fa0/6, Fa0/7, Fa0/8, Fa0/9
Fa0/10, Fa0/11, Fa0/12, Fa0/13
Fa0/14, Fa0/15, Fa0/16, Fa0/17
Fa0/18, Fa0/19, Fa0/20, Fa0/21
Fa0/22, Fa0/23, Fa0/24, Gig0/1
5 IT active Fa0/1
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
Switch#
Switch1#show interfaces trunk
Port Mode Encapsulation Status Native vlan
Gig0/2 on 802.1q trunking 1
Port Vlans allowed on trunk
Gig0/2 1-1005
Port Vlans allowed and active in management domain
Gig0/2 1,5
Port Vlans in spanning tree forwarding state and not pruned
Gig0/2 1,5
Switch#
Switch0# show interfaces switchport
Name: Gig0/1
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: On
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk private VLANs: none
Operational private-vlan: none
Trunking VLANs Enabled: All
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL
Protected: false
Unknown unicast blocked: disabled
Unknown multicast blocked: disabled
Appliance trust: none
Switch1# show interfaces switchport
Name: Gig0/2
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: On
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk private VLANs: none
Operational private-vlan: none
Trunking VLANs Enabled: All
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL
Protected: false
Unknown unicast blocked: disabled
Unknown multicast blocked: disabled
Appliance trust: none
Using Trunking in Switch ⇒ Video
To set a specific port on the switch as Trunking, you can watch the video below and also subscribe to our YouTube channel to support us!
Final Word
Trunking must be enabled when configuring VLANs on Cisco or other branded SWs. Otherwise, devices belonging to the same VLAN but located at different locations cannot communicate with each other. Thanks for following us!
thnk u
You’re welcome! Thanks for your comment!