How to Configure VLAN Trunking

In the previous post, we have discussed the basics of VLANs and how to configure VLANs. If you missed that one, we would highly recommend you to visit “Configure VLANs” post before start to configure VLAN trunking. VLAN trunking enables to carry VLAN traffic from one switch to another switch using the trunk port. A trunk port is simply a switch port that is used to interconnect switches. In order to forward VLAN traffic from one switch to another switch, you need to enable trunking on the trunk ports of switches. The following commands are used to configure VLAN trunking.

Switch(config-if)#interface <interface name/number>
Switch(config-if)#switchport mode trunk

We will use the following topology to configure VLAN trunking.Configure VLAN Trunking in Cisco Packet Tracer

We assume that you have already configured the appropriate IP addresses and VLANs as mentioned in the preceding topology. If you have not configured yet, please visit the following link.

Step By Step VLAN Configuration

Configure VLAN Trunking Step By Step

Once you have configured VLANs on Switch1 and Switch2, next, enable VLAN trunking on the Fa0/3 interfaces of both the switches. To do so, execute the following commands.

  1. On Switch1, execute the following commands.
Switch1(config-if)#interface Fa0/3
Switch1(config-if)#switchport mode trunk
  1. Next, move on to Switch2 and execute the following commands.
Switch2(config-if)#interface Fa0/3
Switch2(config-if)#switchport mode trunk
  1. Once you have enabled VLAN trunking on the trunk ports of both the switches, verify your VLAN trunking configuration. To do so, execute the following command on Switch1 as shown in the following figure.
Switch1# show interface fa0/3 switchport

How to show trunk portIn the preceding figure, you can see that the Fa0/3 interface is configured as trunk port. By default, a trunk port is enabled to carry VLAN traffic of all VLANs.

  1. After enabling VLAN trunking on the respective trunk ports of both the switches, verify that Switch1 passes VLAN traffic to Switch2. To do so, execute the following command on PC0.
  2. ping 10.0.0.2
  3. You should not be able to ping even both the PCs belong to the same network (10.0.0.0/8). The reason is that PC0 (IP 10.0.0.1, interface Fa0/1) and PC1 (IP 10.0.0.2, interface Fa0/2) belong to different VLAN IDs.
  4. Now, execute the following command on PC0.
    ping 10.0.0.3
  5. Now you should be able to ping successfully as shown in the following figure. The is reason is that VLAN trunking is enabled between both the switches and PC0 (IP 10.0.0.1, interface Fa0/1 of Switch1) and PC2 (IP 10.0.0.3, interface F0/1 of Switch2) belong to the same VLAN ID (Sales 10).Verify VLAN Trunking
  6. Now, execute the following command on PC0 and examine the output.
    ping 10.0.0.4
  7. You should not be able to ping because PC0 (IP 10.0.0.1, interface Fa0/1 of Switch1) and PC3 (IP 10.0.0.4, interface Fa0/2 of Switch2) belong to the different VLAN IDs.

In this post, we have explained how to configure VLAN trunking between switches. Please share your valuable feedback to improve the article.

Posted in Cisco, Switching Tagged with: ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*