802.1Q VLAN trunk : architecture and configuration
Les VLAN 802.1Q (Virtual LAN) sont la pierre angulaire of the segmentation L2 en entreprise. Tagging 4 bytes dans l'en-tête Ethernet. 4094 VLAN maximum (VLAN ID 12 bits). Les trunks inter-switchs portent plusieurs VLAN. Ce guide couvre l'architecture VLAN, les trunks, le VLAN natif, les pièges, la convergence vers VXLAN. 2026.
Structure of tag 802.1Q
- TPID (Tag Protocol Identifier) : 2 bytes, valeur 0x8100
- PCP (Priority Code Point) : 3 bits, 8 niveaux de priorité 802.1p
- DEI (Drop Eligible Indicator) : 1 bit
- VID (VLAN ID) : 12 bits, 0-4095
- VLAN 0 : priority-tagged, VLAN 4095 : réservé, VLAN 1 : default (à éviter)
Modes de port
- Access : 1 seul VLAN, untagged. Endpoint (PC, téléphone IP, imprimante)
- Trunk : multiple VLAN, tagged 802.1Q. Inter-switch or vers serveurs virtualisés
- Hybrid (Juniper) : access + trunk sur un port selon configuration
- Router-on-a-stick : trunk vers un router qui sub-interface par VLAN
VLAN natif
- VLAN natif = VLAN untagged sur un trunk
- Par défaut VLAN 1 (mauvais choix : attaque double-tagging)
- Best practice : VLAN natif = VLAN blackhole 999 (inused, bloqué)
- Cisco : switchport trunk native vlan 999
- Juniper : native-vlan-id 999
Voice VLAN
Téléphones IP Cisco/Polycom/Yealink transmettent data (tag VLAN A) + voice (tag VLAN B) sur un même port :
- switchport access vlan 10 : VLAN data (PC)
- switchport voice vlan 20 : VLAN voice (phone)
- Téléphone reçoit its config VLAN via CDP/LLDP-MED
- PC connecté au port LAN of téléphone = VLAN 10
Private VLAN (PVLAN)
- Isolation au sein d'un VLAN
- Primary VLAN + Secondary (Isolated or Community)
- Isolated : ports ne peuvent pas communiquer entre eux
- Community : ports d'un même community communiquent, pas with les autres
- Promiscuous : peut parler to tous (ex : router, FW)
- Usage : hôtels, co-working, résidence — isoler chaque client
VTP / MVRP
- VTP (Cisco) : synchro VLAN database entre switchs. Historique mais dangereux (risque de supprimer tous les VLAN si serveur mal configuré)
- Best practice : VTP transparent or off
- MVRP (standard 802.1ak) : équivalent multi-vendor, rare en pratique
Design VLAN campus
Flat (small)
Tous les sites partagent les mêmes VLAN. Simple mais pas scalable.
Hierarchical
VLAN par building/floor. Ex : 10-19 building A floor 1-9, 20-29 building B, etc.
Functional
- VLAN 10-19 : data users
- VLAN 20-29 : voice
- VLAN 30-39 : wifi
- VLAN 40-49 : printers/IoT
- VLAN 50-59 : servers
- VLAN 90-99 : management
Limitations VLAN 4094
Sur grands campus/DC, 4094 VLAN peuvent ne pas suffire :
- Hôtels : chaque chambre = 1 VLAN → 500 chambres = 500 VLAN
- Cloud providers : 1000+ tenants
- Solution : VXLAN (16M VNI), QinQ (VLAN-in-VLAN)
QinQ (802.1ad)
Tag 802.1Q imbriqué dans un autre :
- S-tag (service provider) + C-tag (customer)
- Usage : ISP qui transporte VLAN clients sur its backbone
- Terme : Metro Ethernet, provider bridging
VXLAN : au-delà de 4094
VXLAN remplace VLAN sur fabric moderne :
- 24 bits VNI = 16M
- L2 over L3, pas de STP
- Voir article dédié VXLAN/EVPN-VXLAN
Security VLAN
- VLAN hopping (double-tagging) : prévenir with VLAN natif dédié bloqué
- Ne jamais mettre user VLAN = VLAN 1 (ni VLAN natif trunk)
- DHCP snooping + DAI + IP Source Guard sur access
- Port security : limite nombre MAC par port
Troubleshooting
- show vlan brief : VLAN configurés and leurs ports
- show interfathese trunk : trunks actifs, native VLAN, allowed VLAN
- show interfathese Gi1/0/1 switchport : mode port
- show mac address-table vlan 10 : MAC learning dans VLAN
- Piège fréquent : VLAN non autorisé sur trunk (switchport trunk allowed vlan)
Commander chez OPTINOC
Design VLAN campus + configuration trunks 802.1Q clé-en-main. Migration vers VXLAN sur fabric. Catalyst/Aruba/Juniper/FortiSwitch. Devis sous 48h.
