β οΈ Prima di leggere: hai usato show ip nat statistics? Guarda quante traduzioni attive ci sono e da dove manca il traffico.
BUG 1
Gi0/0 (LAN) β manca ip nat inside
π Come identificarlo:
R1# show ip nat statistics
Total active translations: 0
Outside interfaces: GigabitEthernet0/1 (errato β vedi bug 3)
Inside interfaces: (nessuna!)
R1# show run | section interface
interface GigabitEthernet0/0
ip address 192.168.1.1 255.255.255.0
(manca ip nat inside)
π§ Fix:
R1# conf t
R1(config)# interface GigabitEthernet0/0
R1(config-if)# ip nat inside
PerchΓ© funziona: NAT ha bisogno di sapere quale interfaccia Γ¨ "interna" (inside) e quale Γ¨ "esterna" (outside). Senza ip nat inside sull'interfaccia LAN, il router non sa da dove proviene il traffico da tradurre β lo ignora completamente.
BUG 2
ACL 10 β wildcard mask errata, esclude la subnet 192.168.1.0/24
π Come identificarlo:
R1# show run | section access-list
access-list 10 permit 192.168.1.0 0.0.0.0
β wildcard 0.0.0.0 = solo host 192.168.1.0 esatto (la rete, non gli host!)
R1# show ip access-lists
Standard IP access list 10
10 permit 192.168.1.0, wildcard bits 0.0.0.0
(0 matches) β zero match = nessun host rientra
π§ Fix:
R1# conf t
R1(config)# no access-list 10
R1(config)# access-list 10 permit 192.168.1.0 0.0.0.255
PerchΓ© funziona: wildcard 0.0.0.0 matcha solo quell'indirizzo IP esatto β in questo caso 192.168.1.0 che Γ¨ l'indirizzo di rete, non un host. La wildcard corretta per includere tutti gli host di una /24 Γ¨ 0.0.0.255.
BUG 3
Gi0/0 (LAN) ha ip nat outside β dovrebbe essere Gi0/1 (WAN)
π Come identificarlo:
R1# show run | section interface
interface GigabitEthernet0/0
ip address 192.168.1.1 255.255.255.0
ip nat outside β sbagliato! LAN = inside
!
interface GigabitEthernet0/1
ip address 203.0.113.2 255.255.255.252
(manca ip nat outside) β WAN = outside
π§ Fix:
R1# conf t
R1(config)# interface GigabitEthernet0/0
R1(config-if)# no ip nat outside
R1(config-if)# interface GigabitEthernet0/1
R1(config-if)# ip nat outside
PerchΓ© funziona: NAT outside deve essere sull'interfaccia che si affaccia verso Internet (WAN). Con outside sulla LAN il router tentava di fare NAT al contrario β traduceva il traffico in ingresso dalla LAN come se fosse traffico pubblico in entrata, con risultati imprevedibili.
π§ Come ragionare su un problema NAT
Passo 1 β Verifica il routing
Prima di guardare NAT, controlla che il routing funzioni: show ip route β c'Γ¨ la default route verso l'ISP? Se manca la route, NAT non serve a nulla.
Passo 2 β Conta le traduzioni
show ip nat statistics β quante traduzioni attive? Zero = NAT non funziona. Guarda anche quali interfacce sono marcate inside/outside.
Passo 3 β Controlla la configurazione NAT
show run | section nat β la ACL Γ¨ corretta? Il comando ip nat inside source list punta alla ACL giusta?
Passo 4 β Controlla la ACL
show ip access-lists β guarda i contatori match. Zero match = gli host non rientrano nella ACL. Controlla la wildcard mask.
Passo 5 β Verifica inside/outside
show run | section interface β ogni interfaccia ha il tag corretto? LAN = inside, WAN = outside. Un errore qui inverte la logica NAT.
π Concetti chiave β NAT/PAT
Inside vs Outside
Inside = rete privata interna
Outside = rete pubblica (Internet)
LAN β ip nat inside
WAN β ip nat outside
Entrambi obbligatori per NAT
NAT vs PAT
NAT statico: 1 IP privato β 1 IP pubblico
NAT dinamico: pool di IP pubblici
PAT (overload): N IP privati β 1 IP pubblico con porte diverse
PAT Γ¨ il piΓΉ usato nelle aziende
4 terminologie NAT
Inside local: IP privato host (192.168.1.x)
Inside global: IP pubblico tradotto (203.x)
Outside local: IP dest visto dall'inside
Outside global: IP dest reale (8.8.8.8)
Wildcard mask nella ACL NAT
La ACL NAT usa wildcard identiche a OSPF:
/24 β 0.0.0.255
/16 β 0.0.255.255
host esatto β 0.0.0.0
any β 255.255.255.255
π Teoria β Bug 1: ip nat inside mancante
Come funziona il processo NAT
Quando un pacchetto arriva su un'interfaccia marcata ip nat inside, IOS sa che deve controllare se l'indirizzo sorgente corrisponde alla ACL NAT. Se corrisponde, traduce l'IP privato in pubblico. Senza il tag inside, IOS non sa che quel traffico va tradotto β lo forwardizza normalmente con l'IP privato sorgente, che Internet scarta perchΓ© non Γ¨ instradabile pubblicamente.
π Teoria β Bug 2: wildcard 0.0.0.0 nella ACL
Il significato di wildcard 0.0.0.0
Una wildcard di tutti zeri significa "tutti i bit devono corrispondere esattamente" β Γ¨ equivalente a specificare un singolo host. Quindi permit 192.168.1.0 0.0.0.0 permette solo il pacchetto con IP sorgente esattamente 192.168.1.0, che Γ¨ l'indirizzo di rete β nessun host reale ha quell'indirizzo. Risultato: zero match, zero traduzioni.
Importante: i contatori match in show ip access-lists sono il modo piΓΉ rapido per scoprire questo problema β se sono a zero dopo che gli host hanno provato a navigare, la wildcard Γ¨ sicuramente sbagliata.
π Teoria β Bug 3: outside sull'interfaccia sbagliata
Cosa succede con inside/outside invertiti
IOS usa i tag inside/outside per determinare la direzione della traduzione. Con
outside sulla LAN e nessun tag sulla WAN, il router non ha un'interfaccia outside verso cui instradare il traffico tradotto. Le traduzioni vengono create nella tabella NAT ma i pacchetti non escono correttamente verso Internet. Il sintomo tipico Γ¨:
show ip nat translations mostra entry ma il ping continua a fallire.
Corretto: Gi0/0 (LAN) β inside | Gi0/1 (WAN) β outside
Sbagliato: Gi0/0 (LAN) β outside | Gi0/1 (WAN) β (nessun tag)
show ip nat translations β tabella traduzioni attive
show ip nat statistics β inside/outside, contatori
show run | section nat β ip nat inside source list
show ip access-lists β match counter = 0? wildcard errata
show run | section interface β inside/outside su ogni interfaccia
show ip route β default route verso ISP presente?
π¬π§ English version β Cisco official terminology for CCNA exam preparation.
BUG 1
Gi0/0 (LAN) β missing ip nat inside
π How to identify:
R1# show ip nat statistics
Total active translations: 0
Inside interfaces: (none!)
Outside interfaces: GigabitEthernet0/0 (wrong β see bug 3)
π§ Fix:
R1# configure terminal
R1(config)# interface GigabitEthernet0/0
R1(config-if)# ip nat inside
Why this works: NAT requires both an inside and an outside interface to function. Without ip nat inside on the LAN interface, the router does not know which traffic needs to be translated β it forwards packets with the private source IP, which is dropped by Internet routers.
π Key concept β NAT inside/outside
β’ Inside interface: faces the private network (LAN) β ip nat inside
β’ Outside interface: faces the public network (WAN/Internet) β ip nat outside
β’ Both are mandatory β NAT will not work without both configured
β’ Verify with: show ip nat statistics
BUG 2
ACL 10 β wrong wildcard mask, no hosts matched
π How to identify:
R1# show ip access-lists
Standard IP access list 10
10 permit 192.168.1.0, wildcard bits 0.0.0.0
(0 matches) β zero matches = no host qualifies
π§ Fix:
R1# configure terminal
R1(config)# no access-list 10
R1(config)# access-list 10 permit 192.168.1.0 0.0.0.255
Why this works: Wildcard mask 0.0.0.0 means "match this exact IP address only" β equivalent to a host statement. It matched only 192.168.1.0 (the network address, not a real host). The correct wildcard for /24 is 0.0.0.255, which matches all 254 usable hosts.
π Key concept β NAT ACL wildcard
The NAT ACL defines which source IPs are eligible for translation:
β’ 0.0.0.255 = entire /24 subnet β
β’ 0.0.0.0 = exact host match only β (common mistake)
β’ Match counter = 0 in show ip access-lists β wrong wildcard
BUG 3
Gi0/0 (LAN) has ip nat outside β should be on Gi0/1 (WAN)
π How to identify:
R1# show run | section interface
interface GigabitEthernet0/0
ip address 192.168.1.1 255.255.255.0
ip nat outside β wrong! LAN should be inside
!
interface GigabitEthernet0/1
ip address 203.0.113.2 255.255.255.252
(no nat config) β WAN missing ip nat outside
π§ Fix:
R1# configure terminal
R1(config)# interface GigabitEthernet0/0
R1(config-if)# no ip nat outside
R1(config-if)# interface GigabitEthernet0/1
R1(config-if)# ip nat outside
Why this works: The outside tag must be on the interface facing the public Internet (WAN). With outside on the LAN, the router attempted reverse NAT translation on incoming LAN traffic, causing translation failures even if entries appeared in the NAT table.
π―
Exam Practice β NAT/PAT Troubleshooting
3 questions Β· CCNA 200-301 style Β· answer before checking
0/3
Q1.
A network administrator runs show ip nat statistics and sees "Inside interfaces: none". What is the most likely cause?
A) The NAT ACL is missing from the configuration
B) No interface has been configured with the ip nat inside command
C) The ip nat inside source list command is pointing to the wrong interface
D) The default route is missing from the routing table
Q2.
After verifying that NAT is configured, a technician runs show ip access-lists and sees the NAT ACL with 0 matches after several ping attempts. What is the problem?
A) The ACL is applied in the wrong direction (in vs out)
B) The ACL wildcard mask does not match the source IP addresses of the inside hosts
C) The ACL number does not match the one referenced in the ip nat inside source command
D) NAT overload requires an extended ACL, not a standard ACL
Q3.
Which command correctly configures PAT (NAT overload) so that all hosts in 192.168.1.0/24 share the router's WAN IP address 203.0.113.2?
A) ip nat inside source list 10 pool MYPOOL overload
B) ip nat inside source list 10 interface GigabitEthernet0/1 overload
C) ip nat outside source list 10 interface GigabitEthernet0/1 overload
D) ip nat inside source static 192.168.1.0 203.0.113.2