Use Site-to-Site VPN when two networks must be connected securely over the internet with an IPsec tunnel between gateways; prefer route-based VTI.
Site-to-Site VPN
A site-to-site VPN connects whole networks through an encrypted tunnel between two gateways, so hosts communicate without VPN software of their own.
1. Site-to-site VPN connects networks over untrusted transport.
2. Policy-based (crypto map) or route-based (VTI).
3. Prefer route-based.
4. Match selectors, proposals and keys.
5. Test from LAN interfaces.
IKE → IPsec SAs → encrypted LAN-to-LAN traffic
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
ip address 172.16.10.1 255.255.255.252Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification & troubleshooting Narrow the fault
| Symptom | Command | Look for | Next check |
|---|---|---|---|
| Tunnel never comes up | show crypto ikev2 sa | Status READY | No SA: UDP 500/4500 reachability, peer address, proposal or key mismatch (debug crypto ikev2 in a maintenance window) |
| IKE up, no traffic | show crypto ipsec sa peer 203.0.113.2 | #pkts encaps and #pkts decaps increase on both peers | Encaps only: remote side or its return route. Neither: routing does not send traffic into Tunnel10 |
| Tunnel interface down | show ip interface brief | Tunnel10 up/up | Tunnel source/destination reachability, IPsec profile |
| Large packets fail | ping <remote-lan> size 1400 df-bit | Success with DF set | ip mtu and ip tcp adjust-mss on the tunnel |
Step 2 Common mistakes Narrow the fault
- Mismatched protected subnets (proxy IDs) between peers.
- Overlapping LAN subnets at the two sites without NAT.
- No route for the remote subnet pointing into the tunnel/crypto interface.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- IKE SA and IPsec child SA are separate evidence boundaries
- Proxy identities/selectors must agree at both peers
- ESP commonly carries protected data; NAT traversal can encapsulate it in UDP 4500
- Encaps and decaps counters must be interpreted with generated interesting traffic and the return path.
show crypto session— site tunnelsshow crypto ipsec sa peer <ip>— countersping <remote-lan-ip> source <local-lan-if>— interesting traffic
ReferenceWhat it is1 section · depth on demand
What it is
A site-to-site VPN joins two networks over an untrusted network with an IPsec tunnel between two gateways. IKE (IKEv2 for new designs) authenticates the peers with a pre-shared key or certificates and negotiates the IPsec SAs; ESP then encrypts the traffic.
Cisco IOS XE offers two models:
- Crypto map on the physical interface, with a crypto ACL selecting the protected traffic (policy-based).
- Virtual Tunnel Interface (VTI) with
tunnel mode ipsec ipv4: routing decides what enters the tunnel (route-based), and dynamic routing protocols can run over it.
ReferenceWhy it matters1 section · depth on demand
When to use it
Use it to connect branch sites, partners or a cloud VPC/VNet over the internet. Prefer route-based VTI for new designs: simpler to troubleshoot, routing-protocol friendly, and no mirrored crypto ACLs to keep in sync.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
Site-to-site VPN: connecting two networks over the Internet
A site-to-site VPN joins two sites' networks through an encrypted tunnel between their edge routers or firewalls. Cisco's IOS XE VTI guide describes the static VTI as the choice for always-on connectivity between two sites, and a dynamic VTI on a hub for many remote peers.
Two configuration models
| Model | Traffic selection | Best for |
|---|---|---|
| Policy-based (crypto map) | Crypto ACL lists the networks to protect | Interoperability with peers that require narrow selectors |
| Route-based (VTI) | Routing into the tunnel interface | Dynamic routing, several prefixes, failover |
R1(config)# interface Tunnel100
R1(config-if)# ip address 172.31.100.1 255.255.255.252
R1(config-if)# tunnel source GigabitEthernet0/0/0
R1(config-if)# tunnel mode ipsec ipv4
R1(config-if)# tunnel destination 203.0.113.2
R1(config-if)# tunnel protection ipsec profile VTI-PROF
R1(config)# ip route 10.2.0.0 255.255.0.0 Tunnel100
R1# ping 10.2.0.1 source Vlan10
!!!!!
R1# show crypto ipsec sa interface Tunnel100
interface: Tunnel100
Crypto map tag: Tunnel100-head-0, local addr 198.51.100.2
protected vrf: (none)
local ident (addr/mask/prot/port): (0.0.0.0/0.0.0.0/0/0)
remote ident (addr/mask/prot/port): (0.0.0.0/0.0.0.0/0/0)
current_peer 203.0.113.2 port 500
#pkts encaps: 1882231, #pkts encrypt: 1882231, #pkts digest: 1882231
#pkts decaps: 1794410, #pkts decrypt: 1794410, #pkts verify: 1794410
#send errors 0, #recv errors 0
inbound esp sas:
spi: 0x8C1F22A1(2350850721)
transform: esp-gcm 256 ,
in use settings ={Tunnel, }
sa timing: remaining key lifetime (k/sec): (4607612/2311)
replay detection support: Y
outbound esp sas:
spi: 0x4D02B7E3(1292023779)
What both sides must agree on
| Item | Must match |
|---|---|
| IKE version and proposals | Encryption, integrity or PRF, Diffie-Hellman group |
| Authentication | Pre-shared key or trusted certificates; identities |
| IPsec transform | ESP algorithms, PFS group, lifetimes (lifetimes can differ; the lower is used) |
| Traffic selectors | Any/any for VTIs (the guide's default), or the same network pairs for crypto maps |
Design points
| Point | Recommendation |
|---|---|
| Redundancy | Two tunnels over two ISPs with a routing protocol or tracked static routes |
| NAT | Exempt VPN traffic from Internet NAT; with NAT between the peers, NAT traversal (UDP 4500) is used automatically |
| MTU | ip mtu and ip tcp adjust-mss on the tunnel; the guide states fragmentation isn't supported over the IPsec tunnel |
| Monitoring | Alert on tunnel interface state and on IKE SA flaps |
Hub-and-spoke at scale
With many branches, a hub with a dynamic VTI (or DMVPN/FlexVPN) avoids configuring one tunnel per branch at the hub. The guide states that IKEv2 dynamic VTIs are supported in FlexVPN.
Documented example, not captured output.
Quick reference
A site-to-site VPN connects networks at different locations over the internet or another untrusted network, using IPsec between gateway routers or firewalls. Users at each site reach the other site transparently.
| Design | Notes |
|---|---|
| Policy-based (crypto map) | Crypto ACL decides what is encrypted |
| Route-based (VTI) | Routing decides; supports dynamic routing |
| DMVPN / FlexVPN | Scalable hub-and-spoke with dynamic spoke-to-spoke |
| SD-WAN | Controller-managed IPsec overlay |
Prefer IKEv2, AES-GCM and DH group 19 or higher, and monitor tunnels with DPD and routing protocol adjacencies.
ReferenceConfiguration & state1 section · depth on demand
Configuration example: IKEv2 with VTI (Cisco IOS XE)
crypto ikev2 proposal PROP-1
encryption aes-gcm-256
prf sha384
group 20
crypto ikev2 policy POL-1
proposal PROP-1
crypto ikev2 keyring KR
peer SITE-B
address 203.0.113.2
pre-shared-key <secret>
crypto ikev2 profile IKEV2-SITE-B
match identity remote address 203.0.113.2 255.255.255.255
authentication remote pre-share
authentication local pre-share
keyring local KR
crypto ipsec transform-set TS esp-gcm 256
mode tunnel
crypto ipsec profile IPSEC-SITE-B
set transform-set TS
set ikev2-profile IKEV2-SITE-B
!
interface Tunnel10
ip address 172.16.10.1 255.255.255.252
ip mtu 1400
ip tcp adjust-mss 1360
tunnel source GigabitEthernet0/0/0
tunnel destination 203.0.113.2
tunnel mode ipsec ipv4
tunnel protection ipsec profile IPSEC-SITE-B
!
ip route 10.20.0.0 255.255.0.0 Tunnel10
Documented example, not captured output. Both peers need mirrored settings.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Virtualization & Overlays → IPsec → Site-to-Site VPN. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc4301.html · confidence 94%