Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When creating Inter-VLAN Routing environments via Router-on-a-Stick method, why do we have to encapsulate sub-interfaces with dot1q vlan-number? What does that dot1q do and why do we have to type the same number as VLAN number?

share|improve this question
up vote 8 down vote accepted

In order to have a router actually route anything, it should be connected to at least two network interfaces; so, without VLAN trunking, you would need a router with at least two Ethernet ports, connected to two switch ports assigned to different VLANs, in order to route traffic between them.

VLAN trunking is the practice of having Ethernet frames from two or more VLANs flowing through a single physical port and cable, thus allowing the router to talk to two or more VLANs without actually needing a physical port for each one of them.

DOT1Q (actual name 802.1q) is a protocol for transmitting VLAN informations together with Ethernet frames, which are then called "tagged" frames, because each frame brings a VLAN tag with it, telling the receiving device "this frame belongs to VLAN X"; there are other protocols which can do similar things, but DOT1Q is the most commonly used one.

On Cisco devices, this is handled through sub-interfaces: you have a single Ethernet interface, let's say FastEthernet 0, and then you create subinterfaces of it, like FastEthernet 0.1 and FastEthernet 0.2. The main interface (the physical one) is configured for trunking mode and VLAN encapsulation, each sub-interface is assigned to a different VLAN, and then the router is able to route traffic between these "virtual" interfaces as if they were "real" ones.

VLAN trunking is used whenever you need to carry several VLANs together on a single physical Ethernet connection; oher common uses are connections between switches or to virtualization hosts.

share|improve this answer
Great information for an Inter-VLAN beginner. Thanks a dozen. – Caner Öncü Jul 26 '11 at 8:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.