A VLAN ID is the number that identifies the VLAN associated with an Ethernet frame. In an IEEE 802.1Q tag, the VLAN Identifier (VID) is a 12-bit field, allowing 4,096 values in total. VLANs divide one physical switch into separate Layer 2 broadcast domains, so frames in one VLAN are not forwarded or flooded to another VLAN. section 12.3.1 section 12.5
Apply the VLAN ID in these common switch and router roles:
- Create a VLAN with vlan vlan-id, optionally name it, and verify it with show vlan brief. section 12.2.1
- Assign an access port to one VLAN with switchport access vlan vlan-id; access ports send and receive untagged frames. section 12.5
- Carry multiple VLANs across a trunk using IEEE 802.1Q tags; the VID identifies each frame's VLAN. section 12.3.1 section 12.5
- Configure a router-on-a-stick subinterface with encapsulation dot1q vlan-id. The subinterface number does not determine the VLAN; the encapsulation command does. section 12.4.1
Assigning VLAN 10
SW1(config)# vlan 10 SW1(config-vlan)# name Engineering SW1(config)# interface g0/1 SW1(config-if)# switchport mode access SW1(config-if)# switchport access vlan 10 The port becomes an access port in VLAN 10. On a router, the equivalent VLAN association would be encapsulation dot1q 10 under a subinterface. section 12.2.1 section 12.5 section 12.4.1
Figure 12.6 The 802.1Q tag’s position in an Ethernet frame and the field of the tag. The fields are TPID (Tag Protocol Identifier) and TCI (Tag Control Information). TCI contains three subfields: PCP (Priority Code Point), DEI (Drop Eligible Indicator), and VID (VLAN Identifier).
Use the frame diagram to locate the 802.1Q tag and distinguish its TPID and TCI fields, including the VID. section 12.3.1
