Lab Objective
Configure a complete site-to-site IPsec VPN between two routers across a simulated public network, verify IKE Phase 1 and Phase 2 both establish successfully, and confirm traffic between each site's LAN is encrypted as it crosses the intermediate network.
Lab Purpose
This lab ties together every concept covered earlier in this series regarding IPsec VPNs — the two-phase IKE negotiation, the transform set, and interesting traffic ACL — into one complete, working configuration from start to finish.
Lab Topology
R1 (Site A) ---- Gi0/1 ---- ISP ---- Gi0/1 ---- R2 (Site B)
R1: Gi0/0 (LAN) 192.168.130.0/24, Gi0/1 (WAN) 203.0.113.1/30
R2: Gi0/0 (LAN) 192.168.140.0/24, Gi0/1 (WAN) 203.0.113.5/30
ISP router simply routes between the two WAN
addresses and requires no VPN awarenessTask 1: Configure Basic Addressing
Configure both routers' LAN and WAN interfaces.
Task 2: Configure IKE Phase 1 on Both Routers
Configure matching ISAKMP policy and a pre-shared key on both routers.
Task 3: Configure IKE Phase 2 on Both Routers
Configure a matching transform set and an ACL identifying interesting traffic (LAN-to-LAN) on both routers.
Task 4: Configure and Apply the Crypto Map
Create a crypto map referencing the peer, transform set, and interesting traffic ACL, and apply it to each router's WAN interface.
Task 5: Verify the Tunnel Establishes
Generate LAN-to-LAN traffic and confirm both Phase 1 and Phase 2 security associations are active.
Solution and Verification
R1(config)# interface gigabitethernet0/0
R1(config-if)# ip address 192.168.130.1 255.255.255.0
R1(config-if)# no shutdown
R1(config-if)# exit
R1(config)# interface gigabitethernet0/1
R1(config-if)# ip address 203.0.113.1 255.255.255.252
R1(config-if)# no shutdownR2(config)# interface gigabitethernet0/0
R2(config-if)# ip address 192.168.140.1 255.255.255.0
R2(config-if)# no shutdown
R2(config-if)# exit
R2(config)# interface gigabitethernet0/1
R2(config-if)# ip address 203.0.113.5 255.255.255.252
R2(config-if)# no shutdownR1(config)# crypto isakmp policy 10
R1(config-isakmp)# encryption aes 256
R1(config-isakmp)# hash sha256
R1(config-isakmp)# authentication pre-share
R1(config-isakmp)# group 14
R1(config)# crypto isakmp key VpnSharedKey2026 address 203.0.113.5R2(config)# crypto isakmp policy 10
R2(config-isakmp)# encryption aes 256
R2(config-isakmp)# hash sha256
R2(config-isakmp)# authentication pre-share
R2(config-isakmp)# group 14
R2(config)# crypto isakmp key VpnSharedKey2026 address 203.0.113.1R1(config)# crypto ipsec transform-set VPN-SET esp-aes 256 esp-sha256-hmac
R1(config)# access-list 101 permit ip 192.168.130.0 0.0.0.255 192.168.140.0 0.0.0.255R2(config)# crypto ipsec transform-set VPN-SET esp-aes 256 esp-sha256-hmac
R2(config)# access-list 101 permit ip 192.168.140.0 0.0.0.255 192.168.130.0 0.0.0.255
-- Note: each router's ACL is mirrored --
-- source and destination reversed relative
-- to that router's own perspectiveR1(config)# crypto map SITE-VPN 10 ipsec-isakmp
R1(config-crypto-map)# set peer 203.0.113.5
R1(config-crypto-map)# set transform-set VPN-SET
R1(config-crypto-map)# match address 101
R1(config)# interface gigabitethernet0/1
R1(config-if)# crypto map SITE-VPNR2(config)# crypto map SITE-VPN 10 ipsec-isakmp
R2(config-crypto-map)# set peer 203.0.113.1
R2(config-crypto-map)# set transform-set VPN-SET
R2(config-crypto-map)# match address 101
R2(config)# interface gigabitethernet0/1
R2(config-if)# crypto map SITE-VPNLAN-A-PC (192.168.130.10)> ping 192.168.140.10
!!!!!
Success rate is 100 percent (5/5)R1# show crypto isakmp sa
dst src state conn-id
203.0.113.5 203.0.113.1 QM_IDLE 1001
R1# show crypto ipsec sa
local ident: (192.168.130.0/255.255.255.0/0/0)
remote ident: (192.168.140.0/255.255.255.0/0/0)
#pkts encaps: 5, #pkts encrypt: 5
#pkts decaps: 5, #pkts decrypt: 5
-- Both phases confirmed active, with actual
-- encrypted traffic counted in both directionsKey Takeaway
The interesting traffic ACLs on each router must be mirror images of each other — R1's ACL says "traffic from my LAN to R2's LAN," while R2's ACL says "traffic from my LAN to R1's LAN" — since each router evaluates the ACL from its own local perspective, and mismatching this mirroring is a common configuration error that silently results in a tunnel that establishes Phase 1 but never actually encrypts the intended traffic.