Palo Alto IPsec VPN configuration: site-to-site example for PAN-OS 11
Every object a Palo Alto firewall needs for a route-based IKEv2 site-to-site tunnel, with the GUI path and the matching set commands for each.
The short answer
A Palo Alto IPsec VPN configuration is always route-based at heart. You create an IKE crypto profile, an IPsec crypto profile, an IKE gateway, a tunnel interface placed in a security zone and attached to a virtual router (or a logical router with Advanced Routing), and an IPsec tunnel that ties the gateway, profile and interface together. Then a static route and security policies in both directions. Proxy IDs are only needed when the peer is policy-based.
This guide gives a complete PAN-OS 11.x example for a firewall at a branch office connecting to an IPsec VPN server, with the GUI path for each object and the matching set commands for the CLI. For background, see what IPsec is and IKEv1 or IKEv2.
The example network and the values that must match
The firewall has the public address 198.51.100.20 on ethernet1/1 (zone untrust) and the LAN 192.168.10.0/24 on ethernet1/2 (zone trust, firewall address 192.168.10.1). The VPN server is at 203.0.113.10 with 10.10.0.0/16 behind it.
| Setting | Palo Alto firewall (branch) | VPN server |
|---|---|---|
| Public IP / IKE identity | 198.51.100.20 | 203.0.113.10 |
| Networks behind it | 192.168.10.0/24 | 10.10.0.0/16 |
| Tunnel inside address | 169.254.100.2/30 | 169.254.100.1/30 |
| IKE version | IKEv2 only | IKEv2 |
| IKE proposal | AES-256-CBC, SHA-256, DH group 20 | AES-256-CBC, SHA-256, DH group 20 |
| ESP proposal | AES-256-GCM, PFS group 20 | AES-256-GCM, PFS group 20 |
| Lifetimes | IKE 28800 s, child SA 3600 s | IKE 28800 s, child SA 3600 s |
| Authentication | Pre-shared key | Pre-shared key |
| Traffic selectors | 0.0.0.0/0 (no proxy IDs) | 0.0.0.0/0 (route-based) |
| Dead peer detection | On | On |
Why AES-256-CBC with SHA-256 for IKE rather than GCM? PAN-OS does support AES-256-GCM in the IKE crypto profile for IKEv2 (with DH group 20 and the authentication set to non-auth), but CBC with SHA-256 is the combination you can rely on matching almost any peer. If both sides support it, IKE with GCM is a fine choice; just set it identically on both. For ESP, AES-256-GCM is well supported and is what the example uses.
Generate a long random pre-shared key (32 characters or more) for each tunnel and use the same key on both sides in place of the pre-shared-key placeholder below. Never reuse a key between tunnels.
Full example configuration for PAN-OS 11.x
Each step names the GUI location, followed by the CLI equivalent. Enter the set commands in configuration mode (configure) on a single-vsys firewall, then commit once at the end. Object names such as IKE-HUB are labels; rename them as you like.
1. IKE crypto profile
GUI: Network > Network Profiles > IKE Crypto. Add a profile with DH group group20, authentication sha256, encryption aes-256-cbc and a key lifetime of 8 hours (28800 seconds).
# Example configuration for a Palo Alto Networks firewall, PAN-OS 11.x (branch side)
# --- IKE crypto profile (phase 1) ---
set network ike crypto-profiles ike-crypto-profiles IKE-HUB dh-group group20
set network ike crypto-profiles ike-crypto-profiles IKE-HUB hash sha256
set network ike crypto-profiles ike-crypto-profiles IKE-HUB encryption aes-256-cbc
set network ike crypto-profiles ike-crypto-profiles IKE-HUB lifetime seconds 28800
2. IPsec crypto profile
GUI: Network > Network Profiles > IPSec Crypto. IPSec protocol ESP, encryption aes-256-gcm, authentication none (GCM provides integrity itself), DH group group20 for PFS, lifetime 1 hour (3600 seconds).
# --- IPsec crypto profile (phase 2) ---
set network ike crypto-profiles ipsec-crypto-profiles IPSEC-HUB esp encryption aes-256-gcm
set network ike crypto-profiles ipsec-crypto-profiles IPSEC-HUB esp authentication none
set network ike crypto-profiles ipsec-crypto-profiles IPSEC-HUB dh-group group20
set network ike crypto-profiles ipsec-crypto-profiles IPSEC-HUB lifetime seconds 3600
3. Tunnel interface, zone and router
GUI: Network > Interfaces > Tunnel. Add tunnel.1, assign it to the virtual router default and a new zone vpn, and on the IPv4 tab add 169.254.100.2/30. A separate zone for the tunnel lets you write explicit policies for VPN traffic. The MTU of 1400 leaves room for the IPsec overhead.
# --- Tunnel interface and zone ---
set network interface tunnel units tunnel.1 ip 169.254.100.2/30
set network interface tunnel units tunnel.1 mtu 1400
set network profiles interface-management-profile allow-ping ping yes
set network interface tunnel units tunnel.1 interface-management-profile allow-ping
set zone vpn network layer3 tunnel.1
set network virtual-router default interface tunnel.1
4. IKE gateway
GUI: Network > Network Profiles > IKE Gateways. On the General tab: version IKEv2 only mode, interface ethernet1/1, peer IP address 203.0.113.10, authentication pre-shared key, and local and peer identification set to the two IP addresses. On the Advanced Options tab: IKEv2 crypto profile IKE-HUB and liveness check (DPD) enabled. Tick NAT Traversal under Common Options if either side is behind NAT.
# --- IKE gateway ---
set network ike gateway GW-HUB protocol version ikev2
set network ike gateway GW-HUB protocol ikev2 ike-crypto-profile IKE-HUB
set network ike gateway GW-HUB protocol ikev2 dpd enable yes
set network ike gateway GW-HUB local-address interface ethernet1/1
set network ike gateway GW-HUB peer-address ip 203.0.113.10
set network ike gateway GW-HUB authentication pre-shared-key key
set network ike gateway GW-HUB local-id type ipaddr id 198.51.100.20
set network ike gateway GW-HUB peer-id type ipaddr id 203.0.113.10
set network ike gateway GW-HUB protocol-common nat-traversal enable yes
5. IPsec tunnel
GUI: Network > IPSec Tunnels. Add TUN-HUB with tunnel interface tunnel.1, type Auto Key, IKE gateway GW-HUB and IPsec crypto profile IPSEC-HUB. Leave the Proxy IDs tab empty for a route-based peer: PAN-OS then negotiates 0.0.0.0/0 for both sides.
# --- IPsec tunnel ---
set network tunnel ipsec TUN-HUB tunnel-interface tunnel.1
set network tunnel ipsec TUN-HUB auto-key ike-gateway GW-HUB
set network tunnel ipsec TUN-HUB auto-key ipsec-crypto-profile IPSEC-HUB
6. Routing: virtual router or logical router
PAN-OS 11.x has two routing engines. The legacy engine uses virtual routers (Network > Virtual Routers > default > Static Routes). If Advanced Routing is enabled (under Device > Setup > Management > General Settings, which needs a commit and a restart), virtual routers are replaced by logical routers (Network > Routing > Logical Routers), and both the interface assignment from step 3 and the static route go there instead. In both cases the route has destination 10.10.0.0/16, interface tunnel.1 and next hop None.
# --- Static route, legacy routing engine (virtual router) ---
set network virtual-router default routing-table ip static-route to-hub destination 10.10.0.0/16
set network virtual-router default routing-table ip static-route to-hub interface tunnel.1
# --- Same route with Advanced Routing (logical router "default", VRF "default") ---
# set network logical-router default vrf default interface tunnel.1
# set network logical-router default vrf default routing-table ip static-route to-hub \
# destination 10.10.0.0/16 interface tunnel.1
The logical router lines are commented out so the block can be pasted on a legacy-engine firewall. Use one engine's commands, not both, and if your CLI rejects the logical router path, create the route in the GUI.
7. Security policies (both directions) and NAT
GUI: Policies > Security. One rule from trust to vpn and one from vpn to trust. Traffic between zones is denied by default, so without the second rule the server side cannot open connections to the branch.
# --- Security policies ---
set rulebase security rules lan-to-hub from trust to vpn
set rulebase security rules lan-to-hub source 192.168.10.0/24 destination 10.10.0.0/16
set rulebase security rules lan-to-hub application any service any action allow
set rulebase security rules hub-to-lan from vpn to trust
set rulebase security rules hub-to-lan source 10.10.0.0/16 destination 192.168.10.0/24
set rulebase security rules hub-to-lan application any service any action allow
commit
Make sure the two rules sit above any broader deny rule, and narrow application and service for production. No NAT exemption is needed if your outbound source NAT rule is written, as usual, from trust to untrust: VPN traffic leaves through the vpn zone and never matches it. Check any NAT rule that uses any as the destination zone. IKE and ESP arriving on untrust for the firewall's own address are normally covered by the default intrazone rule; if you have replaced that with a deny, allow the ike and ipsec-esp applications from 203.0.113.10.
Proxy IDs for a policy-based peer
If the VPN server (or another peer) is policy-based, it will reject 0.0.0.0/0 and expect exact subnets. Add a proxy ID on the IPsec tunnel (GUI: Network > IPSec Tunnels > TUN-HUB > Proxy IDs) that mirrors the peer's configuration. The route and policies stay as they are.
set network tunnel ipsec TUN-HUB auto-key proxy-id HUB-LAN local 192.168.10.0/24
set network tunnel ipsec TUN-HUB auto-key proxy-id HUB-LAN remote 10.10.0.0/16
set network tunnel ipsec TUN-HUB auto-key proxy-id HUB-LAN protocol any
Each proxy ID creates its own child SA, so one subnet pair per entry. IPsec VPN configuration examples shows the same tunnel on other platforms.
Verify the tunnel
In the GUI, Network > IPSec Tunnels shows a status icon for the tunnel, the IKE info and the tunnel info; green means up. On the CLI (operational mode), bring the tunnel up and check each layer:
test vpn ike-sa gateway GW-HUB
test vpn ipsec-sa tunnel TUN-HUB
show vpn ike-sa gateway GW-HUB
show vpn ipsec-sa tunnel TUN-HUB
show vpn flow
ping source 192.168.10.1 host 10.10.0.1
show routing route destination 10.10.0.0/16
show vpn ike-sa: an established IKEv2 SA forGW-HUBwith peer 203.0.113.10 and the negotiated algorithms (AES-256-CBC, SHA-256, group 20).show vpn ipsec-sa: a child SA forTUN-HUBwith inbound and outbound SPIs, ESP with AES-256-GCM, and the remaining lifetime.show vpn flow: the tunnel in stateactivewith encapsulated and decapsulated packet counters. Encapsulated packets rising with no decapsulated packets means nothing comes back from the server.- Routes: 10.10.0.0/16 via
tunnel.1. With Advanced Routing, useshow advanced-routing route logical-router defaultinstead.
For negotiation details, look at the system log (Monitor > Logs > System) or, on the CLI, less mp-log ikemgr.log.
Common problems
Proposal mismatch
The system log shows that no suitable proposal was found during IKE_SA_INIT (IKE crypto profile) or IKE_AUTH / CREATE_CHILD_SA (IPsec crypto profile). Compare the values in the table side by side: a different DH group, PFS (DH group) set on one side and no-pfs on the other, or GCM on one side and CBC with SHA-256 on the other are the usual causes. If you switch IKE to GCM, remember PAN-OS needs non-auth as the authentication in that profile.
Proxy ID or traffic selector mismatch
Phase 1 comes up, phase 2 fails with TS_UNACCEPTABLE or a proxy ID error. Either the peer is policy-based and needs proxy IDs, or proxy IDs are configured but do not mirror the peer's subnets exactly.
Identity mismatch
Authentication fails although the key is right. The local and peer IDs on the IKE gateway must match what the server sends and expects. Behind NAT, the firewall's address on ethernet1/1 is private, so the explicit local-id of 198.51.100.20 in the example matters.
NAT in front of the firewall
Enable NAT Traversal on the IKE gateway (as in the example) and make sure the upstream device forwards UDP 500 and 4500 to the firewall. IKEv2 then moves to UDP 4500 by itself.
MTU and MSS
Pings work, large transfers stall. PAN-OS adjusts the TCP MSS for traffic it sends into an IPsec tunnel based on the tunnel interface MTU, which is why the example sets mtu 1400 on tunnel.1. You can also clamp explicitly on the LAN-facing interface with Adjust TCP MSS (GUI: the interface's Advanced > Other Info tab):
set network interface tunnel units tunnel.1 mtu 1400
set network interface ethernet ethernet1/2 layer3 adjust-tcp-mss enable yes
set network interface ethernet ethernet1/2 layer3 adjust-tcp-mss ipv4-mss-adjustment 140
The adjustment is the number of bytes subtracted from the interface MTU, so 140 gives an MSS of 1360 on a 1500-byte interface; raise it further if the WAN uses PPPoE. The IPsec troubleshooting guide has more on fragmentation symptoms.
The other end of the tunnel
This Palo Alto site-to-site VPN configuration works with any standards-based IKEv2 peer. If the peer is a TunnelYard server, you get a dedicated IPsec server with its own static public IP, policy-based tunnels (add the Proxy IDs shown above), and a guided tunnel setup with a Palo Alto preset that exports a matching peer configuration to check against the steps above. Live tunnel status and per-tunnel logs show the server side of each negotiation. See features and one static IP for every branch.