Video 23 - DMZ con firewall ASA 5506, ACL, NAT e PAT
Firewall stateful Cisco ASA 5506-X: security level, object network, ACL estese, NAT, inspection e isolamento reale Inside-DMZ-Outside.
2. Di cosa parla questo video
In questo tutorial ti guiderò nella realizzazione di una rete LAN con DMZ controllata dal firewall ASA 5506-X, implementando security level, ACL estese stateful, NAT/PAT e inspection per una sicurezza perimetrale enterprise reale.
Evolviamo la DMZ su router del Video 22 verso firewall dedicato Cisco ASA 5506-X. Topologia a 3 zone: Inside G1/1 192.168.1.1/26 security-level 100 LAN aziendale, DMZ G1/2 192.168.2.1/26 security-level 50 con server web 192.168.2.10, Outside G1/3 203.0.113.2/30 security-level 0 verso ISP. Configuriamo object network INSIDE, DMZ-SERVER, OUTSIDE, nat (Inside,Outside) dynamic interface PAT, nat (DMZ,Outside) static 203.0.113.2 service tcp 80 80 port-forwarding, access-list OUTSIDE_TO_DMZ extended permit tcp any host 192.168.2.10 eq 80, access-group OUTSIDE_TO_DMZ in interface Outside, inspection default. Test stateful: Inside→Outside automatico, Outside→DMZ solo 80, DMZ→Inside deny by security level.
ASA 5506 è dove capite la differenza tra ACL e firewall stateful. Nel video al minuto 12 mostro l'errore che manda in crisi tutti: dimenticate security level. Se mettete Inside 0 e Outside 100 invertiti, Inside non esce più perché ASA blocca da livello basso ad alto senza ACL. Security level 100 Inside high, 50 DMZ medium, 0 Outside low è la regola d'oro. Al minuto 18 mostro object network: se fate NAT senza object, Packet Tracer non lo prende. E al minuto 26 mostro inspection: senza inspect http, il ritorno di una pagina complessa può essere bloccato. ASA è stateful, il ritorno è automatico se permesso in uscita.
3. Obiettivi di apprendimento
- ✅ Realizzare una rete con accessi controllati dal firewall ASA 5506
- ✅ Simulare la rete in Packet Tracer con ASA 5506-X
- ✅ Implementare le ACL Estese con ASA 5506 e security level
- ✅ Implementare NAT, PAT in Packet Tracer con object NAT
Alla fine configurerai ASA 5506 con 3 interfacce, security-level 100/50/0, nameif Inside/DMZ/Outside, object network per Inside e DMZ server, nat dynamic PAT per Inside→Outside e static port-forwarding per DMZ→Outside 80/443, access-list estese per Outside→DMZ, access-group in interface, verifica con show xlate, show nat, show access-list, show conn, e test browser Outside→DMZ via IP pubblico e ping Inside→Internet stateful.
4. Perché ASA 5506 - Da router ACL a firewall stateful
DMZ su router Video 22 era stateless. ASA è enterprise:
| DMZ Router (Video 22) | DMZ ASA 5506 (questo video) |
|---|---|
| ACL stateless, ritorno manuale | Stateful: ritorno automatico se uscita permessa |
| ip access-group in/out manuale | Security level 100>50>0 + ACL |
| ip nat inside/outside + list | object network + nat (Inside,Outside) dynamic |
| No inspection | Inspection http, ftp, dns, icmp |
| Show ip nat translations | Show xlate, show conn, show nat |
| Low-cost, CCNA base | Enterprise, CCNA Security, produzione reale |
Se vi chiedono "Come funziona ASA 5506?", rispondete: "ASA usa security level 100 Inside trusted, 50 DMZ semi-trusted, 0 Outside untrusted. Da livello alto a basso permesso di default stateful, da basso ad alto deny di default serve ACL. Configuro object network per Inside e server DMZ, nat (Inside,Outside) dynamic interface per PAT, nat (DMZ,Outside) static con service tcp 80 per port-forwarding, access-list OUTSIDE_TO_DMZ permit tcp any host DMZ eq 80, access-group in interface Outside, inspection con policy-map global. Verifica con show xlate e show conn". Risposta da firewall admin.
5. Concetti chiave - Security level, object, NAT, ACL, inspection
Cuore del video, minuto 8-24:
6. Lab in Packet Tracer - LAN con DMZ controllata da ASA
Nel video (minuto 4-34):
- Topologia: ASA 5506-X: G1/1 Inside 192.168.1.1/26 → Switch + PC Inside 192.168.1.2, G1/2 DMZ 192.168.2.1/26 → Server web 192.168.2.10 HTTP/HTTPS, G1/3 Outside 203.0.113.2/30 → R2 ISP 203.0.113.1/30 → Cloud Internet + PC Outside 203.0.113.10
- ASA base: interface G1/1 nameif Inside security-level 100 ip 192.168.1.1 255.255.255.192 no shutdown, G1/2 nameif DMZ sec 50 ip 192.168.2.1 255.255.255.192, G1/3 nameif Outside sec 0 ip 203.0.113.2 255.255.255.252
- Object + NAT: object network INSIDE-NET subnet 192.168.1.0 255.255.255.192 nat (Inside,Outside) dynamic interface (PAT), object network DMZ-WEB host 192.168.2.10 nat (DMZ,Outside) static 203.0.113.2 service tcp www www e https https
- ACL: access-list OUTSIDE_TO_DMZ extended permit tcp any host 192.168.2.10 eq 80, permit tcp any host 192.168.2.10 eq 443, access-group OUTSIDE_TO_DMZ in interface Outside. ACL opzionale DMZ_TO_INSIDE deny ma già security level blocca DMZ→Inside senza ACL
- Inspection: policy-map global_policy class inspection_default inspect http, inspect ftp, inspect dns già default
- Verifica: PC Inside ping 8.8.8.8 OK (PAT), browser Inside http://192.168.2.10 OK (Inside→DMZ high→low permesso), PC Outside browser http://203.0.113.2 OK → nattato a DMZ, Outside ping Inside KO (low→high deny), show xlate mostra PAT e static, show conn mostra connessioni stateful, show access-list hit
Security level: 100 Inside, 50 DMZ, 0 Outside. High→Low permesso stateful senza ACL, Low→High serve ACL. NAT: object network + nat (Inside,Outside) dynamic interface per PAT, static con service tcp per port-forwarding. ACL: access-list + access-group in interface Outside. Verifica: show xlate per NAT, show conn per connessioni stateful, packet-tracer input Outside tcp ... 80 detailed per simulare. Nel video al minuto 31 mostro packet-tracer che mostra allow/deny.
7. Errori comuni da evitare
- Security level invertito: Inside sec 0 e Outside sec 100 → Inside non esce, Outside entra ovunque. Sempre Inside 100, DMZ 50, Outside 0.
- Object senza NAT: crei object network DMZ-WEB host 192.168.2.10 ma dimentichi nat (DMZ,Outside) static → Outside non raggiunge DMZ, xlate vuota. Sempre nat dentro object.
- NAT ordine sbagliato: nat (Outside,DMZ) invece di (DMZ,Outside) → traduzione invertita, show nat failed. Prima interfaccia sorgente reale, seconda destinazione tradotta: (DMZ,Outside).
- ACL dimenticata su Outside: NAT static ok ma nessun access-list → Outside→DMZ bloccato da security level 0→50 deny default. Serve access-group OUTSIDE_TO_DMZ in interface Outside.
- Manca route default: ASA senza route Outside 0.0.0.0 0.0.0.0 203.0.113.1 → Inside non raggiunge Internet anche con PAT, ping fallisce. Sempre route default verso ISP.
- Access-group direzione errata: access-group OUTSIDE_TO_DMZ out interface Outside invece di in → filtra uscita da Outside, non ingresso, web Outside→DMZ KO.
- Confusione ASA vs Router NAT: usi ip nat inside su ASA → comando non esiste, ASA usa solo object nat. Sintassi diversa da router IOS.
Security level Inside 0 e ACL permit any any su Outside. Sintomo: Outside pinga Inside 192.168.1.2 OK, Outside accede a PC aziendali, show conn mostra conn Outside→Inside ESTABLISHED. ASA compromesso. Soluzione: verifica nameif Inside security-level 100, Outside 0, no access-list permit ip any any su Outside, solo permit tcp any host DMZ eq 80/443, show interface ip brief + show access-list. Nel video al minuto 33 mostro exploit con sec level invertito.
8. Approfondimento: ASA vs Router firewall
Da Video 22 a Video 23 - salto a firewall enterprise:
| Router ACL (Video 22) | ASA 5506 (questo video) |
|---|---|
| ip access-group + ip nat | object + nat (Inside,Outside) + access-group |
| Stateless, no security level | Security level 100/50/0 stateful |
| Ritorno manuale | Ritorno automatico stateful, show conn |
| No packet-tracer | packet-tracer input simula flusso con fasi |
| Config semplice, low-cost | Config enterprise, object-oriented, CCNA Security |
| OK lab base | Produzione DMZ, VPN, inspection avanzata |
Prossimo video: VPN Site to Site con IPsec tra due sedi.
📚 Compito per casa
Crea rete ASA 5506: G1/1 Inside 192.168.1.1/26 PC 192.168.1.2, G1/2 DMZ 192.168.2.1/26 server web 192.168.2.10, G1/3 Outside 203.0.113.2/30 verso ISP 203.0.113.1/30 PC Outside 203.0.113.10. Configura security-level 100 Inside, 50 DMZ, 0 Outside, object INSIDE-NET subnet 192.168.1.0/26 nat (Inside,Outside) dynamic interface PAT, object DMZ-WEB host 192.168.2.10 nat (DMZ,Outside) static 203.0.113.2 service tcp 80 80 e 443 443, access-list OUTSIDE_TO_DMZ permit tcp any host 192.168.2.10 eq 80/443 access-group in Outside, route Outside 0.0.0.0 0.0.0.0 203.0.113.1. Verifica show xlate, show nat, show access-list, show conn, packet-tracer input Outside tcp 203.0.113.10 1234 192.168.2.10 80 detailed allow, PC Inside ping 8.8.8.8 OK, Outside browser http://203.0.113.2 OK, Outside ping Inside KO, DMZ ping Inside KO. Screenshot xlate + access-list + packet-tracer + browser. Mandamelo prima della VPN Site to Site.