I sintomi sono descritti come li vedresti in una rete reale. Sta a te trovare la causa.
β
1. Gli host VLAN 20 (HR) non comunicano con nessuno
Il reparto HR Γ¨ completamente isolato. Gli host VLAN 10 (IT) funzionano parzialmente.
β
2. Il routing tra VLAN non funziona correttamente
Gli host di alcune VLAN non raggiungono il gateway. La configurazione del router sembra incompleta o errata.
β
3. SW1 non Γ¨ raggiungibile via IP dal reparto IT
Non Γ¨ possibile fare il management dello switch dal segmento VLAN 10. Gli altri switch sono raggiungibili.
R1-HQ#
π‘ Come lavorare: usa show running-config per vedere la config completa. Poi entra in conf t per correggere. ββ per la cronologia, cambia device senza perdere l'output.
π
Lab PRO
Accedi al simulatore CLI con 3 errori nascosti su VLAN, trunk e inter-VLAN routing.
π‘ Soluzione β VLAN, Trunk & Inter-VLAN
β οΈ Prima di leggere: hai provato tutti i show? Il vero apprendimento Γ¨ nel ragionamento, non nei comandi.
BUG 1
Trunk SW1βSW2: VLAN 20 non Γ¨ nella lista delle VLAN permesse
π Come identificarlo:
SW1# show interfaces trunk
Port Mode Encap Status Native vlan
Gi0/2 on 802.1q trunking 1
VLANs allowed: 1,10,30β VLAN 20 mancante!
BUG 3
SW1: SVI Vlan10 Γ¨ in shutdown β management non raggiungibile
π Come identificarlo:
SW1# show ip interface brief
Interface IP-Address OK? Method Status Protocol
Vlan10 192.168.10.254 YES manual down down
Vlan1 unassigned YES unset up up
π§ Fix:
SW1# conf tSW1(config)# interface Vlan10SW1(config-if)# no shutdown
Il sintomo Γ¨: gli host VLAN 20 (HR) non comunicano con nessuno, mentre VLAN 10 (IT) funziona parzialmente. Da dove inizi?
Passo 1 β Layer 2 prima di Layer 3
Quando una VLAN non comunica, inizia sempre dal Layer 2: la VLAN esiste? Transita sul trunk? Solo dopo vai al Layer 3 (routing, gateway).
Passo 2 β Verifica il trunk show interfaces trunk Γ¨ il comando piΓΉ importante per i problemi VLAN. Controlla: la porta Γ¨ in trunk? Le VLAN sono nella lista "allowed"? Le VLAN sono "active in management domain"? Le VLAN sono "in STP forwarding state"?
Passo 3 β Verifica il routing inter-VLAN
Su Router-on-a-Stick, ogni subinterface deve avere: encapsulation dot1Q con il VLAN ID corretto e un IP nella subnet di quella VLAN. Se l'encapsulation Γ¨ sbagliata, il router tenta di processare frame della VLAN sbagliata.
π Concetti chiave β VLAN e Trunk
802.1Q Tag
β’ 4 byte inseriti nel frame Ethernet
β’ 12 bit = VLAN ID (1β4094)
β’ Native VLAN = non taggata
β’ Tutto il resto = taggato
Trunk β errori comuni
β’ VLAN non nella lista "allowed"
β’ Native VLAN mismatch
β’ DTP non negozia (mode access)
β’ VLAN non creata (non in active)
Router-on-a-Stick
β’ Una sola interfaccia fisica
β’ N subinterface = N VLAN
β’ Ogni subif: dot1Q + IP
β’ La porta switch deve essere trunk
SVI (Switch Virtual Interface)
β’ Interfaccia virtuale per VLAN
β’ Usata per management o routing L3
β’ Richiede no shutdown
β’ Richiede che la VLAN esista
π Comandi show β cosa cercare
show vlan briefβ VLAN esiste? Quali porte assegnate?show interfaces trunkβ VLAN nella lista? In forwarding? Native ok?show ip interface briefβ SVI up/up? IP assegnato?show run | section interfaceβ dot1Q corretto? ip address corretto?show interfaces statusβ Porta in trunk? VLAN corretta?
π Teoria β Bug 1: VLAN mancante dal trunk
Cosa succede quando una VLAN non Γ¨ nella lista "allowed" di un trunk?
I frame taggati con quel VLAN ID vengono scartati silenziosamente all'ingresso del trunk. Lo switch non genera nessun errore β semplicemente i frame scompaiono. Per questo il sintomo sembra che gli host non esistano sulla rete.
Come leggere show interfaces trunk
Il comando mostra 3 sezioni critiche:
β’ VLANs allowed on trunk β configurazione manuale
β’ VLANs allowed and active in management domain β VLAN esistenti e attive
β’ VLANs in spanning tree forwarding state β pronte al forwarding
Una VLAN deve apparire in tutte e tre per funzionare.
Attenzione: "add" vs sostituzione switchport trunk allowed vlan 20 β sostituisce tutta la lista con solo VLAN 20 switchport trunk allowed vlan add 20 β aggiunge VLAN 20 alla lista esistente
Dimenticare add Γ¨ uno degli errori piΓΉ comuni all'esame.
π Teoria β Bug 2: encapsulation dot1Q errata
Come funziona l'encapsulation dot1Q su una subinterface
Quando il router riceve un frame sul trunk, legge il VLAN tag 802.1Q e lo smista alla subinterface con l'encapsulation corrispondente. Se Gi0/0.20 ha encapsulation dot1Q 10, il router manda alla subinterface .20 i frame della VLAN 10 β non della VLAN 20. Risultato: VLAN 20 non ha gateway, VLAN 10 viene processata due volte.
Regola da ricordare per l'esame
Il numero nella subinterface (Gi0/0.20) e il VLAN ID nell'encapsulation (dot1Q 20) non devono necessariamente essere uguali per legge IOS β ma per convenzione e chiarezza devono sempre corrispondere. All'esame controllali sempre entrambi.
π Teoria β Bug 3: SVI in shutdown
Quando una SVI Γ¨ down β le 4 cause possibili
1. Shutdown manuale β fix: no shutdown
2. VLAN non esiste sul switch β fix: vlan X
3. Nessuna porta attiva in quella VLAN β almeno una porta access VLAN X deve essere up
4. Tutte le porte della VLAN sono down β SVI line protocol = down
Status "up/down" vs "down/down" vs "up/up"
β’ up/up β SVI operativa β
β’ down/down β shutdown manuale o VLAN non esiste
β’ up/down β VLAN esiste ma nessuna porta attiva in quella VLAN
In questo scenario: down/down = shutdown manuale con shutdown nella config.
π¬π§ This is the English version β same content, Cisco official terminology. Study this to get familiar with the language you'll find on the real CCNA exam.
BUG 1
Trunk link β VLAN 20 missing from allowed VLAN list on SW1βSW2
π How to identify it:
SW1# show interfaces trunk
Port Mode Encap Status Native vlan
Gi0/2 on 802.1q trunking 1
VLANs allowed on trunk: 1,10,30β VLAN 20 missing!
Why this works: The keyword add appends VLAN 20 to the existing allowed list without overwriting it. Without add, the command switchport trunk allowed vlan 20 would replace the entire list with only VLAN 20 β a very common mistake on the exam.
π Key concept β Reading "show interfaces trunk"
Three sections to check:
β’ VLANs allowed on trunk β manually configured list
β’ VLANs allowed and active in management domain β existing and active VLANs
β’ VLANs in spanning tree forwarding state β ready to forward traffic
A VLAN must appear in all three sections to work correctly.
BUG 2
R1 Gi0/0.20 β wrong encapsulation dot1Q tag (10 instead of 20)
π How to identify it:
R1# show run | section interface
interface GigabitEthernet0/0.20
encapsulation dot1Q 10β should be 20!
ip address 192.168.20.1 255.255.255.0
Why this works: In Router-on-a-Stick, the router reads the 802.1Q tag on each incoming frame and forwards it to the matching subinterface. With dot1Q 10 on .20, VLAN 10 frames were processed twice and VLAN 20 had no gateway.
π Key concept β Router-on-a-Stick (RoaS)
β’ One physical interface on the router, multiple logical subinterfaces
β’ Each subinterface: encapsulation dot1Q <vlan-id> + IP address
β’ The switch port facing the router must be a trunk
β’ Convention: subinterface number should match VLAN ID (e.g. .20 β dot1Q 20)
β’ The physical interface has no IP address β only subinterfaces do
BUG 3
SW1 β SVI Vlan10 is administratively down (shutdown)
π How to identify it:
SW1# show ip interface brief
Interface IP-Address OK? Method Status Protocol
Vlan10 192.168.10.254 YES manual administratively down down
Vlan20 192.168.20.254 YES manual up up
π§ Fix:
SW1# configure terminalSW1(config)# interface Vlan10SW1(config-if)# no shutdown
Why this works: SVIs on Cisco switches can be manually shut down. The keyword administratively down in the Status column always means a manual shutdown command was applied β it's not a physical or protocol issue.
π Key concept β SVI Status interpretation up / up β SVI is fully operational β administratively down / down β manual shutdown applied up / down β VLAN exists but no active ports assigned to it down / down β VLAN does not exist on the switch
4 reasons an SVI can be down:
1. Manual shutdown β fix: no shutdown
2. VLAN not created β fix: vlan X
3. No access ports active in that VLAN
4. All ports in that VLAN are physically down
π―
Exam Practice β VLAN & Trunk
3 questions Β· CCNA 200-301 style Β· answer before checking
0/3
Q1.
A network administrator runs show interfaces trunk on SW1 and notices that VLAN 20 appears in the "VLANs allowed on trunk" section but NOT in "VLANs in spanning tree forwarding state". What is the most likely cause?
A) The VLAN does not exist on the switch
B) The trunk port is in access mode
C) STP has placed the VLAN in blocking state on that trunk
D) The native VLAN is misconfigured
Q2.
A router subinterface is configured as follows: interface GigabitEthernet0/0.30 encapsulation dot1Q 20 ip address 192.168.30.1 255.255.255.0
Hosts in VLAN 30 cannot reach their default gateway 192.168.30.1. What is the problem?
A) The IP address is wrong for VLAN 30
B) The encapsulation dot1Q value should be 30, not 20
C) The physical interface Gi0/0 needs an IP address
D) The subinterface number must match the IP subnet
Q3.
An administrator needs to add VLAN 40 to an existing trunk that already carries VLANs 1, 10, and 20. Which command correctly adds VLAN 40 without removing the existing VLANs?