Configure trunk ports
To enable inter-switch VLAN communication, you need to configure switches to use VLAN trunking on the links between them. To configure a trunk port, the switchport mode trunk interface mode command is used. This type of interface can carry traffic of multiple VLANs. If your switches support both ISL and 802.1q frame tagging protocols, you also need to use the switchport trunk encapsulation {dot1q | isl} command to define the type of trunking.
Consider the following example:
Ports Fa0/10 and Fa0/11 on SW1 and Fa0/5 and Fa0/6 on SW2 are connected to end hosts and should be configured as access ports. However, the link between the switches needs to carry traffic of multiple VLANs and must be configured as trunk. Here is how we can configure ports on SW1 and SW2 to support trunking:
SW1:
SW2:
Now the link between SW1 and SW2 can carry traffic from both VLANS – VLAN5 and VLAN10. You can verify that an interface is indeed a trunk interface by using the show interface Fa0/1 switchport command on SW1: