srx-ipsec-hub-spoke

Design and troubleshoot Juniper SRX static route-based IPsec hub-and-spoke VPNs with full-tunnel backhaul.

9|Updated Mar 7, 2026
One-click install
npx skills add https://github.com/fastrevmd-lab/fwskillsshare --skill srx-ipsec-hub-spoke-fastrevmd-lab
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: srx-ipsec-hub-spoke
Source: https://github.com/fastrevmd-lab/fwskillsshare/tree/main/skills/srx-ipsec-hub-spoke
Command: npx skills add https://github.com/fastrevmd-lab/fwskillsshare --skill srx-ipsec-hub-spoke-fastrevmd-lab

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Configuring Juniper SRX static route-based IPsec hub-and-spoke VPNs is error-prone: missing anti-recursion routes black-hole tunnels, management-default ECMP leaks traffic out fxp0, and absent VPN-zone policies silently drop backhauled traffic. This Skill pins the agent to a validated design covering per-spoke IKE gateways, st0 allocation, static routing, source NAT, and security policies. ## Core Features & Use Cases - Design and configuration: Produces Junos set-format config skeletons for hub and spokes, including IKEv2/IPsec proposals, per-spoke gateways, unnumbered st0 units, and static routes. - Full-tunnel backhaul: Implements centralized egress with hub source NAT (VPN-to-untrust), VPN-to-VPN hairpin policies for spoke-to-spoke traffic, and anti-recursion host routes. - Troubleshooting and verification: Provides a stage-by-stage troubleshooting matrix (underlay, IKE, IPsec, routing, NAT, recursion) plus verification commands and a checklist. - Use Case: A network engineer needs to backhaul three branch offices' internet traffic through a central SRX hub for inspection. The Skill generates the hub config with three st0 units, per-spoke static routes, the SNAT-INTERNET rule-set, and spoke configs with the critical anti-recursion route. ## Quick Start Use the srx-ipsec-hub-spoke skill to design a static route-based IPsec hub-and-spoke VPN with full-tunnel backhaul for my SRX hub and three spokes.

Frequently Asked Questions about srx-ipsec-hub-spoke

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure a route-based IPsec hub-and-spoke VPN on Juniper SRX?

Configure one IKE gateway per spoke pinned by the spoke's WAN IP, bind each IPsec VPN to a dedicated st0 unit, place all st0 units in a single VPN zone, and add explicit static routes to each spoke LAN. Routing alone scopes what each tunnel carries since there are no traffic selectors.

When should I use static hub-and-spoke vs AutoVPN on SRX?

Use static point-to-point tunnels for a few small, stable sites where every peer, st0 unit, and route must be explicit. Switch to AutoVPN when spoke count grows or churns, since AutoVPN adds spokes with zero hub changes using a dynamic group-ike-id gateway and Auto Route Insertion.

Why does my SRX full-tunnel VPN black-hole traffic?

The most common cause is a missing anti-recursion route: the spoke default points into st0, so ESP packets to the hub WAN IP follow the default into the tunnel and recurse. Add a host route HUB_WAN/32 via the underlay next-hop, more specific than the default.

Why does SRX internet traffic leak out fxp0 instead of the tunnel?

vSRX images often carry a management default route via fxp0, and adding a second 0.0.0.0/0 creates ECMP rather than overriding it, so half the traffic bypasses NAT and policy. Fix it by placing fxp0 in a management routing-instance or using more-specific routes.

How do I allow spoke-to-spoke traffic through an SRX hub?

Place all hub st0 units in one VPN zone so the hairpin is an intra-zone VPN-to-VPN flow, then add a single VPN-to-VPN permit policy. The hub also needs an explicit static route to each spoke LAN via the correct st0 unit; return traffic is stateful.

Does this SRX IPsec design support certificate authentication?

The lab-validated baseline uses a shared pre-shared key for simplicity, but the Skill explicitly recommends certificate-based PKI authentication with per-device identity for production, or at minimum strong unique per-tunnel PSKs stored in a secrets manager with rotation.