Skip to main content

Trunks and Inter-VLAN Communication

1. What is a trunk?

Why?

It allows VLANs to remain separate while traveling over the same cable. Without trunking, only one VLAN could pass through a standard Ethernet cable.

 

2. Key concepts

802.1QVLAN encapsulation standard on a trunk
Native VLANVLAN that passes over an untagged trunk
Ruter-on-a-StickInter-VLAN routing method with a single router using subinterfaces

 

3. Configuring a Trunk on a Switch

interface fastethernet 0/24

Select an interface

Access (config-if) mode

switchport mode trunkActivate the trunk mode
switchport trunk allowed vlan 10,20,30Allow only VLANs 10,20,99 to access this trunk
switchport trunk native vlan 99Set the native VLAN to identifier 99
show interfaces trunk

 

4. Communication between VLANs

  • By default, VLANs cannot communicate with each other.
  • A router-on-a-stick uses a router configured with subinterfaces to enable inter-VLAN routing.

Basic configuration on a router

interface gigabitethernet 0/0.10
encapsulation dot1Q 10
ip address 192.168.10.1 255.255.255.0
interface gigabitethernet 0/0.20
encapsulation dot1Q 20
ip address 192.168.20.1 255.255.255.0

Each subinterface corresponds to a specific VLAN.