
Network skill is easy if you are focused on theory and how to configure it. Before you can configure it, first you need to know what is interface trunk.
What is Trunking in network communication?
Trunking is a technology to providing network access to multiple clients simultaneously. Meaning that it will carry multiple signals simultaneously between two switches.
When do you need to configure the trunking interface?
For example, if you want to allow multiple VLANs on the interface, you need to configure that interface to be trunking. Then interface trunk will carry those added VLANs.
You have multiple VLANs including, Voice VLAN, Video, Data, and other VLANs in your network infrastructure. So, those VLANs can’t work at the same interface as access. But it’s can work with the trunk interface by configuring that interface to be a trunk.
Tips before you configure trunk in an interface switch port, first you need to configure:
- Prepare two switches that you want to allow multiple VLANs
- Create VLAN in each switch
How to configure trunk in Cisco switch
The example below is configuring trunking between two switches and allowing two VLANs in the trunk port.
Scenario:
- Port-Gi24 on SW1 and Port-G24 on SW2 will configure as a trunk port
- PC1 Connected to port-1 of SW1 and PC2 connected to port-1 of SW2 on the same VLAN 10
- PC3 Connected to port-2 of SW1 and PC4 connected to port-2 of SW2 on the same VLAN 20
- PC1 will success ping to PC2 and PC3 will success ping to PC4
Below is the command line to configure each switch.
#SW1
sw1>enable
sw1#configure terminal
sw1(config)#interface FastEthernet 0/24
sw1(config-if)#switchport trunk encapsulation dot1q
sw1(config-if)#switchport mode trunk
sw1(config-if)#switchport trunk allowed vlan 10,20
sw1(config-if)#exit
sw1(config)#interface FastEthernet 0/1
sw1(config-int)#switchport mode access
sw1(config-int)#switchport access vlan 10
sw1(config)#interface FastEthernet 0/2
sw1(config-int)#switchport mode access
sw1(config-int)#switchport access vlan 20
See the example command line below


#SW2
sw2>enable
sw2#configure terminal
sw2(config)#interface FastEthernet 0/24
sw2(config-if)#switchport trunk encapsulation dot1q
sw2(config-if)#switchport mode trunk
sw2(config-if)#switchport trunk allowed vlan 10,20
sw2(config)#interface FastEthernet 0/3
sw2(config-if)#switchport mode access
sw1(config-if)#switchport access vlan 10
sw2(config)#interface FastEthernet 0/4
sw2(config-if)#switchport mode access
sw2(config-if)#switchport access vlan 20
Below is an example of a command line


Testing Result


Now, you are successful in ping from PC1 to PC2 and PC3 to PC4. This result was show that your configuration is correct and works well. If you still face any problems, check again your configurations and keep following our guide above.