Sub topic 3
VLAN IDs: usable and reserved values
This chapter assumes you know Ethernet frames and MAC addresses, how a switch learns and forwards frames, IPv4 subnets, and basic switch command-line use. It covers which VLAN ID values you can use, which are reserved, and the errors that come from mixing them up.
The 12-bit VLAN ID
The 802.1Q tag carries the VLAN ID (VID) in a 12-bit field. Twelve bits give 4096 values, 0 through 4095. Two of them are reserved by the standard, so 4094 values are usable.
| VID | Meaning |
|---|---|
| 0 | Priority tag. The frame carries a priority (PCP) but belongs to no VLAN. |
| 1 | Default VLAN on most switches. Usable, but cannot be deleted on Cisco switches. |
| 2–4094 | Usable VLAN IDs. |
| 4095 | Reserved by the standard. Never configure or send it. |
A frame with VID 0 is a priority-tagged frame. The receiving switch treats it as untagged for VLAN membership and uses only the priority bits. You rarely configure this yourself, but you may see it in packet captures from IP phones.
Normal and extended ranges on Cisco switches
Cisco IOS splits the usable IDs further.
- Normal range, 1–1001. These VLANs are stored in the
vlan.datfile in flash and are advertised by VTP versions 1 and 2. - 1002–1005. These are reserved for legacy FDDI and Token Ring VLANs. They exist by default and cannot be removed.
- Extended range, 1006–4094. These are supported on most current switches. In VTP versions 1 and 2 they work only in transparent mode, and they are saved in the running and startup configuration. Some older platforms limit how many extended VLANs you can use.
Platforms differ. Some switches also reserve internal VLANs for routed ports, typically in the 1006 upward range, so a VLAN you want may already be taken. Check your platform documentation before choosing IDs outside 2–1001.
Choosing IDs in practice
The ID has only local meaning to the trunk: two switches must agree on the number for the same segment, but the number says nothing about the subnet. Still, a consistent scheme helps people.
- Avoid VLAN 1 for user traffic. It is the default for every port, and many control protocols use it, so leaving users there widens the damage from a misconfiguration.
- Match the VLAN number to the subnet when you can, for example VLAN 10 for 192.168.10.0/24 and VLAN 20 for 192.168.20.0/24, as in the earlier examples.
- Name every VLAN so
show vlan briefis readable.
vlan 10
name USERS
vlan 20
name SERVERS
vlan 3000
name LAB-EXTENDEDCreating VLAN 3000 on a switch in VTP client or server mode with VTP version 1 or 2 is rejected. Use transparent mode, or VTP version 3, which supports the extended range.
Common errors
- Using 4095 or 0 as a VLAN. The switch rejects the command, and a tag with these values is not a normal VLAN frame.
- Assuming a VLAN exists because a port refers to it. On many Cisco platforms,
switchport access vlan 30can create VLAN 30 automatically, but on others, or when VTP is active, the port stays inactive until the VLAN exists. Always create the VLAN explicitly. - Forgetting that a VLAN must exist on both ends. A trunk can allow VLAN 20, but a switch that lacks VLAN 20 in its database drops that traffic.
- Reusing a number for different segments. Two sites that both use VLAN 20 for different purposes will merge into one broadcast domain if you ever join their trunks.
Exercise
A colleague tries to create VLAN 4095 for a new segment and VLAN 0 for an IP phone group. Why will neither work as a normal VLAN, and what would you suggest instead?
Show answer
VID 4095 is reserved by the standard and VID 0 means a priority-tagged frame with no VLAN membership. Use IDs in 2–4094 instead, for example 4000 and 4001 if the extended range is supported, or normal-range IDs such as 100 and 110 to stay compatible with VTP version 1 and 2.
Exercise
You need a VLAN numbered 2500 on a switch running VTP version 2 in server mode. What happens, and what are two ways to resolve it?
Show answer
The switch rejects it because extended-range VLANs are not supported in VTP version 1 or 2 server or client mode. Either set the switch to VTP transparent mode, or use VTP version 3. A third option is to choose an ID in the normal range.