Video 11 – VLAN Tagged e Untagged - Segmentazione rete | Prof. Giagnotti
🎥 VIDEO 11 · PACKET TRACER · VLAN
✍ Autore: profgiagnotti

Video 11 – VLAN Tagged e Untagged

Un solo switch, tante reti isolate: come dividere il traffico con VLAN 802.1Q, porte access e trunk, tagged vs untagged.

Video 11 Packet Tracer VLAN 802.1Q ~24 min di video 📑 Stampa → ▶ YouTube Aggiornata 2025/26

2. Di cosa parla questo video

In questo tutorial ti guiderò nella realizzazione di una rete segmentata attraverso la realizzazione di reti virtuali LAN (VLAN). Partiamo da una rete piatta dove tutti i PC si vedono e la trasformiamo in 3 VLAN isolate: VLAN 10 Studenti, VLAN 20 Docenti, VLAN 30 Ospiti.

Vedrai come creare le VLAN su switch Cisco 2960, assegnare porte access untagged, creare trunk tagged 802.1Q tra switch, verificare con show vlan brief e show interfaces trunk e testare l'isolamento: PC stessa VLAN pingano, VLAN diverse no (finché non faremo inter-VLAN routing nei video successivi).

💬 Nota del docente - Perché ho fatto questo video

Ragazzi, VLAN è l'argomento dove più di tutti confondete tagged e untagged. Nel video uso un'analogia: la porta access è come una busta senza etichetta (untagged, il PC non sa di essere in VLAN), la porta trunk è come un camion con tante buste etichettate (tagged, ogni frame ha tag 802.1Q). Se capite questa analogia, non sbaglierete mai più la configurazione. Ve lo mostro con Wireshark in Packet Tracer al minuto 18.

3. Obiettivi di apprendimento

  • ✅ Realizzare una rete con VLAN tagged e untagged su switch Cisco
  • ✅ Simulare la rete con VLAN in Packet Tracer con 2 switch e 6 PC
  • ✅ Interconnettere le VLAN tramite trunk 802.1Q e verificare isolamento
🎯 Cosa saprai fare dopo questo video

Alla fine saprai creare VLAN con vlan 10 name STUDENTI, assegnare porte con switchport access vlan 10, creare trunk con switchport mode trunk e verificare che PC in VLAN 10 pinghino solo VLAN 10. Capirai la differenza cruciale: access = untagged verso PC, trunk = tagged verso altro switch.

4. Perché le VLAN - Il problema delle reti piatte

Senza VLAN, uno switch è un unico dominio di broadcast: ARP, DHCP, broadcast inondano tutti.

Senza VLAN (flat)Con VLAN 10,20,30
1 broadcast domain3 broadcast domain isolati
Tutti i PC si vedonoStudenti non vedono Docenti
Sicurezza zeroIsolamento L2 nativo
Broadcast stormBroadcast limitato a VLAN
1 rete IP per tutti1 subnet per VLAN (es. 192.168.10.0/24 per VLAN10)
🎯 Domanda da verifica

Se vi chiedo "Perché VLAN?", rispondete: "Per segmentare a L2 senza router aggiuntivi: sicurezza (isolamento tra reparti), riduzione broadcast, flessibilità (sposto PC da VLAN 10 a 20 cambiando solo porta access), scalabilità (trunk tagged trasporta più VLAN su un solo cavo). Ogni VLAN è una rete IP diversa, serve router L3 per inter-VLAN". È risposta da 10.

5. Tagged vs Untagged - 802.1Q spiegato semplice

È il cuore del video, al minuto 12:

802.1Q - FRAME TAGGING
PC -> Switch porta ACCESS (untagged) PC invia frame Ethernet normale, senza tag Switch riceve su Fa0/1 access VLAN 10 Switch aggiunge internamente tag 10, ma NON lo invia al PC PC non sa di essere in VLAN -> untaggedSwitch -> Switch porta TRUNK (tagged) Frame da VLAN 10,20,30 viaggiano sullo stesso cavo Switch aggiunge tag 802.1Q: 4 byte extra con VLAN ID Fa0/24 trunk: frame VLAN 10 con tag 10, frame VLAN 20 con tag 20 Switch ricevente legge tag e inoltra solo a porte access di quella VLANNative VLAN: su trunk, 1 VLAN viaggia untagged (default VLAN 1) Per sicurezza, cambia native VLAN a 99 e tagga tutto!Frame normale: [DST MAC][SRC MAC][EtherType][Payload][FCS] Frame tagged: [DST MAC][SRC MAC][802.1Q TAG 4B][EtherType][Payload][FCS] ^ VLAN ID 12 bit = 1-4094
ACCESS - UNTAGGED
Verso PC, stampante, AP. 1 sola VLAN. PC ignora tag. Comando: switchport mode access + switchport access vlan 10. PC non configura VLAN.
TRUNK - TAGGED
Verso altro switch o router. Più VLAN. Frame con tag 802.1Q. Comando: switchport mode trunk. Native VLAN untagged, resto tagged.

6. Lab in Packet Tracer - Creiamo VLAN e trunk

Nel video realizzo questa topologia al minuto 6-22:

  • Topologia: 2x Switch 2960, 6x PC (2 per VLAN), 1 cavo trunk tra switch Fa0/24-Fa0/24
  • VLAN: 10 STUDENTI 192.168.10.0/24, 20 DOCENTI 192.168.20.0/24, 30 OSPITI 192.168.30.0/24
  • Switch1: Fa0/1-2 VLAN10, Fa0/3-4 VLAN20, Fa0/5-6 VLAN30, Fa0/24 trunk
  • Switch2: stessa assegnazione, Fa0/24 trunk verso Switch1
  • Test isolamento: PC VLAN10 .10 ping PC VLAN10 .11 → Success, ping PC VLAN20 .10 → Fail (isolamento ok)
  • Verifica trunk: show interfaces trunk → vede VLAN 10,20,30 tagged + native 1 untagged
CISCO IOS - VLAN + TRUNK
Switch1# conf t Switch1(config)# vlan 10 Switch1(config-vlan)# name STUDENTI Switch1(config-vlan)# exit Switch1(config)# vlan 20 Switch1(config-vlan)# name DOCENTI Switch1(config-vlan)# exit Switch1(config)# vlan 30 Switch1(config-vlan)# name OSPITI Switch1(config-vlan)# exitSwitch1(config)# int range fa0/1-2 Switch1(config-if-range)# switchport mode access Switch1(config-if-range)# switchport access vlan 10 Switch1(config-if-range)# exitSwitch1(config)# int range fa0/3-4 Switch1(config-if-range)# switchport mode access Switch1(config-if-range)# switchport access vlan 20 Switch1(config-if-range)# exitSwitch1(config)# int range fa0/5-6 Switch1(config-if-range)# switchport mode access Switch1(config-if-range)# switchport access vlan 30 Switch1(config-if-range)# exitSwitch1(config)# int fa0/24 Switch1(config-if)# switchport mode trunk Switch1(config-if)# switchport trunk allowed vlan 10,20,30 Switch1(config-if)# switchport trunk native vlan 99 Switch1(config-if)# end! Verifica Switch1# show vlan brief Switch1# show interfaces trunk Switch1# show mac address-table vlan 10! Stessa config su Switch2 ! Poi test PC
🔧 Comando che dovete sapere a memoria

switchport mode access + switchport access vlan 10 per porta verso PC (untagged) e switchport mode trunk per porta tra switch (tagged). Dimenticare mode access lascia la porta in dynamic auto e la VLAN non si assegna. Nel video mostro che senza mode access, show vlan brief resta in VLAN 1.

7. Errori comuni da evitare

  • Porta in VLAN 1 di default: se non assegni access vlan, resta in VLAN 1 e non isola. Sempre configurare access vlan.
  • Trunk non creato: colleghi 2 switch con cavo ma lasci porte access → solo VLAN 1 passa, VLAN 10,20,30 isolate tra switch. Serve trunk.
  • Native VLAN mismatch: Switch1 native 1, Switch2 native 99 → CDP avvisa %CDP-4-NATIVE_VLAN_MISMATCH. Allinea native su entrambi.
  • Allowed VLAN dimenticata: trunk di default permette tutte le VLAN (1-1005), ma se dai allowed vlan 10,20 escludi 30. Verifica con show interfaces trunk.
  • PC con IP stessa subnet ma VLAN diverse: 192.168.10.10 in VLAN10 e 192.168.10.11 in VLAN20 non si pingano anche se IP stessa rete → isolamento L2 blocca prima di L3.
  • Confondere tagged verso PC: mai configurare trunk verso PC. PC non capisce tag 802.1Q e scarta frame. Solo AP o telefono VoIP con voice VLAN usa trunk verso endpoint.
  • VLAN creata ma non usata: vlan 10 esiste ma nessuna porta access in vlan 10 → show vlan brief mostra vlan 10 vuota, inutile.
⚠️ Errore che blocca il 100% nelle verifiche

Dimenticare di mettere switchport mode access prima di switchport access vlan. In Packet Tracer se la porta è in dynamic desirable (default), il comando access vlan non ha effetto finché non la metti in mode access. Sintomo: show vlan brief mostra Fa0/1 ancora in VLAN 1 anche dopo aver dato access vlan 10. Soluzione: sempre int fa0/1 → switchport mode access → switchport access vlan 10.

8. Approfondimento: access, trunk, native VLAN e inter-VLAN

Questo collega alla lezione teorica VLAN e ai prossimi video inter-VLAN:

ConcettoUntaggedTagged
Porta Access✅ 1 VLAN untagged verso PC❌ No tag
Porta Trunk1 Native VLAN untagged (sicurezza cambiarla)✅ Tutte le altre VLAN tagged 802.1Q
PCNon configura VLAN, IP normaleNon capisce tag, scarta
Switch-SwitchSolo nativeMulti-VLAN su 1 cavo

Nel prossimo video vedremo inter-VLAN routing tradizionale (1 cavo per VLAN verso router) e poi router-on-a-stick con sub-interfaces tagged. Per ora l'isolamento è voluto: è la sicurezza L2.

📚 Compito per casa

Crea rete con 2 switch, trunk Fa0/24, VLAN 10 (192.168.10.0/24) 2 PC, VLAN 20 (192.168.20.0/24) 2 PC per switch. Configura access e trunk, verifica show vlan brief e show interfaces trunk, testa ping stessa VLAN (deve funzionare tra switch via trunk) e VLAN diverse (deve fallire). Fai screenshot di show vlan brief + ping success stessa VLAN + ping fail VLAN diversa. Mandamelo prima del video inter-VLAN routing.

9. Risorse correlate