Video 24 - VPN Site to Site | Prof. Giagnotti
🎥 VIDEO 24 · PACKET TRACER · VPN SITE-TO-SITE IPSEC
✍ Autore: profgiagnotti

Video 24 - VPN Site-to-Site IPsec in Packet Tracer

Tunnel IPsec tra sedi: ISAKMP Phase 1 e 2, transform-set, crypto map, ACL interesting traffic e tunnel sicuro tra LAN private su Internet.

Video 24 Packet Tracer IPsec Site-to-Site ~40 min di video 📑 Stampa → ▶ YouTube Aggiornata 2025/26

2. Di cosa parla questo video

In questo tutorial ti guiderò nella realizzazione di una VPN Site-to-Site IPsec per interconnettere in modo sicuro due sedi aziendali remote attraverso Internet, creando un tunnel cifrato tra LAN private come se fossero una unica rete geografica protetta.

Implementiamo una VPN Site-to-Site tra Sede A 192.168.1.0/26 e Sede B 192.168.2.0/26 con router di frontiera R1 203.0.113.2/30 e R2 203.0.114.2/30 su Internet 10.0.0.0/30. Configuriamo ISAKMP Phase 1: crypto isakmp policy 10 con aes 256, sha, dh 5, pre-share key cisco123, Phase 2: crypto ipsec transform-set TSET esp-aes 256 esp-sha-hmac, ACL interesting traffic 100 permit ip 192.168.1.0 0.0.0.63 192.168.2.0 0.0.0.63, crypto map MAP 10 ipsec-isakmp con set peer, set transform-set, match address 100, applicata su Outside. Escludiamo NAT per traffico VPN con deny ip 192.168.1.0 0.0.0.63 192.168.2.0 0.0.0.63 in ACL NAT. Test ping Inside→Inside cifrato e show crypto isakmp sa QM_IDLE e show crypto ipsec sa con pkts encaps/decaps.

💬 Nota del docente - Perché ho fatto questo video

VPN Site-to-Site è il cuore di ogni azienda multi-sede. Nel video al minuto 15 mostro l'errore che blocca il tunnel al 100%: dimenticate di escludere il traffico interesting dalla NAT. Se la ACL NAT fa permit ip 192.168.1.0 0.0.0.63 any con overload, il traffico verso 192.168.2.0 viene nattato e non entra mai nel tunnel IPsec. Dovete mettere deny ip 192.168.1.0 0.0.0.63 192.168.2.0 0.0.0.63 prima del permit any nella ACL NAT. Al minuto 22 mostro pre-share key mismatch: R1 cisco123 e R2 cisco124 → Phase 1 MM_NO_STATE, debug crypto isakmp mostra key mismatch. E al minuto 28 transform-set mismatch aes vs 3des → Phase 2 fallisce.

3. Obiettivi di apprendimento

  • ✅ Realizzare una rete VPN Site-to-Site tra due sedi aziendali
  • ✅ Simulare la rete in Packet Tracer con tunnel IPsec
  • ✅ Implementare le policy di sicurezza ISAKMP Phase 1 e 2
  • ✅ Implementare i parametri per la realizzazione del tunnel IPsec con crypto map
🎯 Cosa saprai fare dopo questo video

Alla fine configurerai crypto isakmp policy 10 con encryption aes 256, hash sha, dh group 5, lifetime, key cisco123 address peer, crypto ipsec transform-set con esp-aes e esp-sha-hmac, ACL interesting traffic mirrorata su entrambi i lati, crypto map con peer, transform-set e match address, applicazione su interfaccia Outside, esclusione NAT per VPN, verifica con show crypto isakmp sa, show crypto ipsec sa, ping cifrato tra LAN e debug.

4. Perché VPN Site-to-Site - Da DMZ a interconnessione sicura

DMZ Video 22-23 proteggeva una sede. VPN collega due sedi sicure su Internet:

Senza VPN (Video 22-23)Con VPN Site-to-Site (questo video)
Sede A e Sede B isolate su InternetSede A e B come unica LAN via tunnel IPsec
Traffico 192.168.1.0 → 192.168.2.0 in chiaro su Internet → intercettabileTraffico cifrato AES 256 + SHA in tunnel IPsec
No tunnel, routing pubblicoTunnel IPsec con crypto map su Outside
NAT per tuttoNAT escluso per VPN + PAT per Internet
2 reti private separate1 rete logica geografica, ping privato sicuro
Costo linee dedicate MPLSCosto Internet + IPsec sicuro, soluzione enterprise
🎯 Domanda da colloquio CCNA

Se vi chiedono "Come configuri VPN Site-to-Site IPsec?", rispondete: "Fase 1 ISAKMP: crypto isakmp policy 10 encryption aes 256 hash sha group 5 lifetime 86400, crypto isakmp key cisco123 address peer. Fase 2 IPsec: crypto ipsec transform-set TSET esp-aes 256 esp-sha-hmac, ACL interesting 100 permit ip 192.168.1.0/26 192.168.2.0/26 mirrorata, crypto map MAP 10 ipsec-isakmp set peer X, set transform-set TSET, match address 100, applicata su Outside. Escludo NAT per VPN con deny interesting in ACL NAT. Verifico con show crypto isakmp sa QM_IDLE e show crypto ipsec sa con encaps/decaps". È risposta da network engineer.

5. Concetti chiave - IPsec, ISAKMP, transform-set, crypto map, interesting traffic

Cuore del video, minuto 8-26:

VPN SITE-TO-SITE - CONCETTI CHIAVE
IPsec: suite protocolli per cifratura, autenticazione, integrità Modalità: Tunnel (tra router) vs Transport (host-to-host) → noi Tunnel Protocolli: ESP 50 (cifra+autentica) vs AH 51 (solo autentica) → noi ESP ISAKMP Phase 1 - IKE SA: negozia tunnel di gestione, policy 10 encryption aes 256 (o aes 128, 3des), hash sha (sha256), authentication pre-share, DH group 5 (1536 bit), lifetime 86400 crypto isakmp policy 10 → encr aes 256 → hash sha → auth pre-share → group 5 → lifetime 86400 crypto isakmp key cisco123 address 203.0.114.2 → PSK deve coincidere su entrambi ISAKMP Phase 2 - IPsec SA: negozia tunnel dati, transform-set crypto ipsec transform-set TSET esp-aes 256 esp-sha-hmac → ESP cifra AES + HMAC SHA Mode tunnel default Interesting traffic ACL 100: cosa va nel tunnel access-list 100 permit ip 192.168.1.0 0.0.0.63 192.168.2.0 0.0.0.63 → Sede A access-list 100 permit ip 192.168.2.0 0.0.0.63 192.168.1.0 0.0.0.63 → Sede B mirrorata Solo traffico matchato entra in IPsec, resto va Internet normale Crypto map: lega peer + transform-set + ACL + interfaccia crypto map MAP 10 ipsec-isakmp → 10 sequence number set peer 203.0.114.2 → peer remoto set transform-set TSET match address 100 → lega ACL interesting interface S0/0/0 → crypto map MAP → applica su Outside NAT exclusion: NAT non deve nattare traffico VPN access-list 1 NAT → deny ip 192.168.1.0 0.0.0.63 192.168.2.0 0.0.0.63 → escludi VPN permit ip 192.168.1.0 0.0.0.63 any → PAT resto Internet ip nat inside source list 1 interface S0/0/0 overload Verifica: show crypto isakmp sa → QM_IDLE = Phase 1 OK show crypto ipsec sa → pkts encaps/decaps incrementano = tunnel attivo show crypto map, debug crypto isakmp, debug crypto ipsec
VPN SITE-TO-SITE (QUESTO VIDEO)
Router-to-router, sempre attiva, collega 2 LAN 192.168.1.0/26 ↔ 192.168.2.0/26, interesting traffic, crypto map su Outside, tunnel permanente tra sedi.
VPN REMOTE ACCESS (PROSSIMO VIDEO)
Client-to-site, on-demand, PC singolo con VPN client Cisco, user + password, pool IP VPN, client si connette da casa a LAN aziendale.

6. Lab in Packet Tracer - VPN Site-to-Site tra due sedi

Nel video (minuto 4-36):

  • Topologia: Sede A: R1 G0/0 192.168.1.1/26 LAN 192.168.1.0/26 PC 192.168.1.2, S0/0/0 203.0.113.2/30 Outside. Internet: R-ISP 10.0.0.1/30 e 10.0.0.2/30. Sede B: R2 G0/0 192.168.2.1/26 LAN 192.168.2.0/26 PC 192.168.2.2, S0/0/0 203.0.114.2/30 Outside. Routing statico default verso ISP
  • Phase 1 R1: crypto isakmp policy 10 encr aes 256 hash sha auth pre-share group 5 lifetime 86400, crypto isakmp key cisco123 address 203.0.114.2
  • Phase 2 R1: crypto ipsec transform-set MYSET esp-aes 256 esp-sha-hmac, access-list 100 permit ip 192.168.1.0 0.0.0.63 192.168.2.0 0.0.0.63, crypto map MYMAP 10 ipsec-isakmp set peer 203.0.114.2 set transform-set MYSET match address 100, int S0/0/0 crypto map MYMAP
  • NAT exclusion R1: access-list 1 deny ip 192.168.1.0 0.0.0.63 192.168.2.0 0.0.0.63, permit 192.168.1.0 0.0.0.63 any, ip nat inside source list 1 interface S0/0/0 overload, ip nat inside su G0/0, outside su S0/0/0
  • R2 mirror: isakmp policy 10 identica, key cisco123 address 203.0.113.2, transform-set identico, ACL 100 permit ip 192.168.2.0 0.0.0.63 192.168.1.0 0.0.0.63, crypto map MYMAP 10 peer 203.0.113.2, NAT exclusion mirrorata
  • Verifica: PC 192.168.1.2 ping 192.168.2.2 → attiva tunnel, R1 show crypto isakmp sa → QM_IDLE, show crypto ipsec sa → #pkts encaps 5 decaps 5, show crypto map, debug. Traffico cifrato, su ISP visibile solo ESP 50, non IP privati
CISCO IOS - VPN SITE-TO-SITE IPSEC
! R1 SEDE A - 192.168.1.0/26 <-> 192.168.2.0/26 R1# conf t ! ISAKMP Phase 1 R1(config)# crypto isakmp policy 10 R1(config-isakmp)# encryption aes 256 R1(config-isakmp)# hash sha R1(config-isakmp)# authentication pre-share R1(config-isakmp)# group 5 R1(config-isakmp)# lifetime 86400 R1(config-isakmp)# exit R1(config)# crypto isakmp key cisco123 address 203.0.114.2 ! IPsec Phase 2 R1(config)# crypto ipsec transform-set MYSET esp-aes 256 esp-sha-hmac ! ACL Interesting Traffic R1(config)# access-list 100 permit ip 192.168.1.0 0.0.0.63 192.168.2.0 0.0.0.63 ! Crypto Map R1(config)# crypto map MYMAP 10 ipsec-isakmp R1(config-crypto-map)# set peer 203.0.114.2 R1(config-crypto-map)# set transform-set MYSET R1(config-crypto-map)# match address 100 R1(config-crypto-map)# exit R1(config)# interface S0/0/0 R1(config-if)# crypto map MYMAP R1(config-if)# exit ! NAT Exclusion + PAT R1(config)# ip access-list standard NAT-ACL R1(config-std-nacl)# deny 192.168.1.0 0.0.0.63 192.168.2.0 0.0.0.63 R1(config-std-nacl)# permit 192.168.1.0 0.0.0.63 R1(config-std-nacl)# exit ! Per Packet Tracer usa access-list numerata: R1(config)# access-list 1 deny 192.168.1.0 0.0.0.63 192.168.2.0 0.0.0.63 R1(config)# access-list 1 permit 192.168.1.0 0.0.0.63 R1(config)# ip nat inside source list 1 interface S0/0/0 overload R1(config)# int g0/0 R1(config-if)# ip nat inside R1(config-if)# exit R1(config)# int s0/0/0 R1(config-if)# ip nat outside R1(config-if)# exit ! R2 SEDE B - MIRROR R2(config)# crypto isakmp policy 10 R2(config-isakmp)# encryption aes 256 R2(config-isakmp)# hash sha R2(config-isakmp)# authentication pre-share R2(config-isakmp)# group 5 R2(config-isakmp)# exit R2(config)# crypto isakmp key cisco123 address 203.0.113.2 R2(config)# crypto ipsec transform-set MYSET esp-aes 256 esp-sha-hmac R2(config)# access-list 100 permit ip 192.168.2.0 0.0.0.63 192.168.1.0 0.0.0.63 R2(config)# crypto map MYMAP 10 ipsec-isakmp R2(config-crypto-map)# set peer 203.0.113.2 R2(config-crypto-map)# set transform-set MYSET R2(config-crypto-map)# match address 100 R2(config-crypto-map)# exit R2(config)# int s0/0/0 R2(config-if)# crypto map MYMAP ! Verifica R1# show crypto isakmp sa IPv4 Crypto ISAKMP SA dst src state conn-id slot status 203.0.114.2 203.0.113.2 QM_IDLE 1001 0 ACTIVE R1# show crypto ipsec sa interface: S0/0/0 Crypto map tag: MYMAP, local addr 203.0.113.2 local ident (addr/mask/prot/port): (192.168.1.0/255.255.255.192/0/0) remote ident (addr/mask/prot/port): (192.168.2.0/255.255.255.192/0/0) #pkts encaps: 10, #pkts encrypt: 10, #pkts digest: 10 #pkts decaps: 10, #pkts decrypt: 10, #pkts verify: 10 R1# show crypto map R1# show access-lists 100 PC> ping 192.168.2.2 → SUCCESS cifrato
🔧 VPN Site-to-Site cheat sheet

Ordine: 1) ISAKMP policy 10 aes 256 sha group 5, 2) key cisco123 address peer, 3) transform-set MYSET esp-aes 256 esp-sha-hmac, 4) ACL 100 permit ip LAN-A LAN-B mirrorata su R2, 5) crypto map MYMAP 10 peer + transform-set + match address 100, 6) crypto map su Outside, 7) NAT exclusion deny interesting prima di permit any. Verifica QM_IDLE = Phase 1 OK, encaps/decaps >0 = Phase 2 OK. Debug crypto isakmp per PSK mismatch, debug crypto ipsec per transform mismatch. Nel video al minuto 34 mostro Wireshark con ESP 50.

7. Errori comuni da evitare

  • NAT non esclusa per VPN: ACL NAT permit ip 192.168.1.0 0.0.0.63 any con overload natted traffico VPN → tunnel non si attiva, show crypto ipsec sa 0 encaps. Metti deny 192.168.1.0/26 to 192.168.2.0/26 prima di permit any in ACL NAT.
  • Pre-share key mismatch: R1 key cisco123 address 203.0.114.2 e R2 key cisco124 → Phase 1 MM_NO_STATE, debug crypto isakmp: peer not authentic. Chiavi identiche su entrambi.
  • Interesting traffic non mirrorata: R1 ACL 100 permit ip 192.168.1.0/26 192.168.2.0/26 ma R2 ACL 100 permit ip 192.168.1.0/26 192.168.2.0/26 uguale invece di mirror → Phase 2 no SA, proxy identities not supported. R2 deve essere invertita.
  • Transform-set mismatch: R1 esp-aes 256 esp-sha-hmac e R2 esp-3des esp-sha-hmac → Phase 2 fail, no transform set match. Identico su entrambi.
  • Crypto map non applicata: configuri crypto map MYMAP ma dimentichi crypto map MYMAP su S0/0/0 → show crypto isakmp sa vuoto, tunnel mai negoziato. Sempre applica su Outside.
  • ISAKMP policy mismatch: R1 encryption aes 256 e R2 aes 128 → Phase 1 non forma QM_IDLE, debug mostra no suitable policy. Policy 10 identica su entrambi i peer.
  • Peer IP errato: set peer 203.0.114.1 invece di .2 → ISAKMP tenta peer inesistente, timeout, MM_NO_STATE. Verifica IP Outside peer.
⚠️ Errore che blocca VPN al 100%

NAT overload su traffico interesting + PSK mismatch. Sintomo: ping 192.168.1.2 → 192.168.2.2 fallisce, show crypto isakmp sa vuoto o MM_NO_STATE, show crypto ipsec sa 0 encaps, show ip nat translations mostra 192.168.1.2 nattato a 203.0.113.2 anche verso 192.168.2.0. Soluzione: ACL NAT con deny 192.168.1.0 0.0.0.63 192.168.2.0 0.0.0.63 prima, clear ip nat trans *, verifica PSK identica con show crypto isakmp key, debug crypto isakmp. Nel video al minuto 15 mostro NAT che uccide tunnel.

8. Approfondimento: Site-to-Site vs Remote Access

Differenze fondamentali per CCNA:

VPN Site-to-Site (questo video)VPN Remote Access (prossimo)
Router-to-router, sempre attivaClient-to-router, on-demand da PC
Collega 2 LAN 192.168.1.0/26 ↔ 192.168.2.0/26Collega singolo PC nomade a LAN aziendale
Interesting traffic ACL 100Pool VPN 192.168.10.0/24 + user/pass
Crypto map su Outside staticaEasy VPN server + client Cisco VPN Client
Tunnel permanente tra sediTunnel temporaneo client
IPsec con PSKIPsec + XAUTH user authentication
CCNA RoutingCCNA Security + telelavoro

Prossimo video: VPN Remote Access con client VPN e autenticazione utente.

📚 Compito per casa

Crea rete: Sede A R1 G0/0 192.168.1.1/26 LAN .0/26 PC .2, S0/0/0 203.0.113.2/30, ISP R-ISP 10.0.0.1/30, Sede B R2 S0/0/0 203.0.114.2/30 G0/0 192.168.2.1/26 PC .2. Configura R1 e R2: crypto isakmp policy 10 aes 256 sha group 5 lifetime 86400, key cisco123 address peer, transform-set MYSET esp-aes 256 esp-sha-hmac, ACL 100 permit ip 192.168.1.0/26 to 192.168.2.0/26 su R1 e mirror su R2, crypto map MYMAP 10 peer + transform-set + match address 100 su Outside, NAT exclusion ACL 1 deny interesting + permit LAN any + overload, ip nat inside/outside. Verifica ping 192.168.1.2→192.168.2.2 attiva tunnel, show crypto isakmp sa QM_IDLE, show crypto ipsec sa encaps/decaps >0, show crypto map, clear crypto sa e riprova ping. Screenshot isakmp sa + ipsec sa + ping cifrato. Mandamelo prima di Remote Access.

9. Risorse correlate