encapsulation dot1Q <vlan>
Tag the subinterface with this VLAN ID. Must match the trunk's allowed VLAN.
The switch sends its trunk's native VLAN untagged, so the subinterface for that VLAN needs 'encapsulation dot1Q <vlan> native' (or the address goes on the physical port). An address on the physical port never answers a tagged VLAN.
Don't just read it — type encapsulation dot1Q <vlan> in a real network simulator in your browser and watch it take effect. No install, no account needed to start.
Frequently asked
What does the "encapsulation dot1Q <vlan>" command do?
Tag the subinterface with this VLAN ID. Must match the trunk's allowed VLAN.
What's the common gotcha with "encapsulation dot1Q <vlan>"?
The switch sends its trunk's native VLAN untagged, so the subinterface for that VLAN needs 'encapsulation dot1Q <vlan> native' (or the address goes on the physical port). An address on the physical port never answers a tagged VLAN.