HPE Juniper Networking SRX Series Firewalls

Last updated Oct 12, 2026

Overview

This guide provides step-by-step instructions for configuring HPE Juniper Networking SRX Series Firewalls to establish IPsec VPN tunnels to Cloudflare WAN. It is intended for network engineers who are familiar with HPE Juniper Networking SRX Series Firewalls administration and have an active Cloudflare WAN subscription.

Test Environment

Field Value
Vendor HPE Juniper Networking
Model SRX 320
Release JUNOS 23.4R2-S3.9
Date Tested March 2026

IKE/IPsec Crypto & Relevant Settings

Field Value
Traffic Selection Criteria Route-Based VPN
Routing Static
Redundant Tunnels Yes
Tunnel Load Balancing Active/Active
IKE Version IKEv2
Authentication Pre-Shared Key
Anti-Replay Protection Disabled
NAT Traversal (NAT-T) Not Tested
NAT-T Port Not Applicable
Phase 1 - DH-Group Group 20
Phase 1 - Encryption AES-256-CBC
Phase 1 - Authentication/Integrity SHA-256
Phase 2 - DH-Group Group 20
Phase 2 - Transport ESP
Phase 2 - Encryption AES-256-CBC

Cloudflare WAN and HPE Juniper Networking SRX Series Firewalls - Configuration Settings

  • While following these steps, ensure you update all object names and IP addresses to match your environment.
  • Aligning these elements with your actual naming conventions and network scheme ensures the configuration works correctly in your production setup.
  • Use Find and Replace to parse the examples below, update the names and addresses accordingly, and maintain consistency.

Cloudflare WAN - Tunnel 01 of 02

Attribute Value/Address
Name (required) CF_WAN_TUN_01
Description ---
IPv4 Interface Address (required) 169.254.250.0/31
IPv6 Interface Address ---
Customer Endpoint 203.0.113.100
Cloudflare Endpoint 162.159.135.1
Tunnel health checks True
Rate Medium
Type Request
Direction Bidirectional
Target Default
--- ---
Turn on replay protection False
Automatic return routing True
  • IKE Identity and Pre-shared Key (obtained after tunnel creation):
Attribute Value/Address
FQDN ID bf6c493d03<REDACTED>.ipsec.cloudflare.com
Pre-shared key Cloudflare-WAN-T1-PSK-1234!

Cloudflare WAN - Tunnel 02 of 02

Attribute Value/Address
Name (required) CF_WAN_TUN_02
Description ---
IPv4 Interface Address (required) 169.254.250.2/31
IPv6 Interface Address ---
Customer Endpoint 203.0.113.100
Cloudflare Endpoint 172.64.135.1
Tunnel health checks True
Rate Medium
Type Request
Direction Bidirectional
Target Default
--- ---
Turn on replay protection False
Automatic return routing True
  • IKE Identity and Pre-shared Key (obtained after tunnel creation):
Attribute Value/Address
FQDN ID 0287844e9d<REDACTED>.ipsec.cloudflare.com
Pre-shared key Cloudflare-WAN-T2-PSK-1234!

Customer Premise Equipment - HPE Juniper Networking

WAN Interface Tunnel 01 of 02 Tunnel 02 of 02
WAN Interface ge-0/0/0.0 ge-0/0/0.0
IP Address 203.0.113.100/24 203.0.113.100/24
Security Zone untrust untrust
Virtual Tunnel Interface (VTI) Tunnel 01 of 02 Tunnel 02 of 02
Tunnel interface st0.1 st0.2
IP Address 169.254.250.1/31 169.254.250.3/31
Security Zone cloudflare cloudflare
LAN Interface Tunnel 01 of 02 Tunnel 02 of 02
LAN Interface ge-0/0/1.0 ge-0/0/1.0
IP Address 192.168.125.1/24 192.168.125.1/24
Security Zone trust trust

HPE Juniper Networking SRX Object Names

Element Object Hierarchy Name
Security Zone - Trust [ security zones security-zone ] trust
Security Zone - Untrust [ security zones security-zone ] untrust
Security Zone - Cloudflare WAN [ security zones security-zone ] cloudflare
IKE Proposal (only one required) [ security ike proposal ] ike-aes256cbc-sha256-dh20
IKE Policy - Tunnel 1 [ security ike policy ] cf-wan-ike-pol-01
IKE Policy - Tunnel 2 [ security ike policy ] cf-wan-ike-pol-02
IKE Gateway - Tunnel 1 [ security ike gateway ] cf-wan-ike-gw-01
IKE Gateway - Tunnel 2 [ security ike gateway ] cf-wan-ike-gw-02
IPsec Proposal (only one required) [ security ipsec proposal ] esp-aes256cbc-sha256-128
IPsec Policy (only one required) [ security ipsec policy ] ipsec-aes256cbc-sha256-128-dh20
IPsec Tunnel - Tunnel 1 [ security ipsec vpn ] cf-wan-ipsec-vpn-01
IPsec Tunnel - Tunnel 2 [ security ipsec vpn ] cf-wan-ipsec-vpn-02

Assumptions

This guide assumes the following apply:

  • Already configured IPsec tunnels and static routes in the Cloudflare dashboard
  • Used the Cloudflare Dashboard to obtain the Local Identifier (FQDN/hostname) and generate a Pre-Shared Key for each of the IPsec tunnels
  • Understand the importance of MSS clamping and adjusting it based on the traffic flows traversing the Cloudflare WAN IPsec Tunnels

High-Level Steps

  • Add Virtual Tunnel Interfaces
  • Create a Security Zone (Recommended)
  • Add VTIs to Security Zone
  • Define IKE Policy and Proposals (Phase 1)
  • Add IKE Gateways
  • IPsec Policy and Proposal (Phase 2)
  • IPsec Tunnel Configuration
  • Define Security policy to permit traffic to/from Cloudflare WAN
  • Define Policy-Based Forwarding rules to selectively route traffic across the IPsec tunnels

HPE Juniper Networking SRX - Configuration

All examples are provided via the Junos Command-Line Interface (CLI). J-Web examples are not provided.

Junos Modes

Junos OS operates with two main command-line interface (CLI) modes, Operational Mode and Configuration Mode, which serve distinct purposes in managing Juniper network devices.

Operational Mode (>)

Operational mode ↗︎ is the default state upon logging into a Junos device, used for monitoring, troubleshooting, and displaying device status.

  • Prompt: user@host>
  • Purpose: View real-time information, check interface status, view routing tables, test connectivity (ping/traceroute), and restart processes.
  • Key Commands: show, monitor, ping, traceroute, request.
  • Action: Changes made here do not affect the persistent device configuration.

Configuration Mode (#)

Configuration mode ↗︎ is used to make changes to the device's configuration, such as defining interfaces, routing protocols, and system properties.

  • Prompt: user@host#
  • Purpose: Edit, add, or remove configuration statements.
  • Key Commands: edit, set, delete, commit, rollback.
  • Action: Changes are made to a "candidate configuration" and are not active until explicitly committed at which point they become part of the "running configuration".

Each section will indicate whether the commands are applicable to configuration mode or operational mode.

Virtual Tunnel Interfaces

Perform in Configuration Mode

set interfaces st0 unit 1 family inet address 169.254.250.1/31
set interfaces st0 unit 2 family inet address 169.254.250.3/31

Security Zone

Perform in Configuration Mode

Add st0.1 and st0.2 to the Security Zone cloudflare and permit system-services ping. This is required to ensure the Cloudflare WAN IPsec Tunnel Health Checks are able to verify reachability across the Virtual Tunnel Interfaces.

set security zones security-zone cloudflare interfaces st0.1 host-inbound-traffic system-services ping
set security zones security-zone cloudflare interfaces st0.2 host-inbound-traffic system-services ping

IKE - Phase 1

Perform in Configuration Mode

Configure the following:

  • IKE Proposal
  • IKE Policies (one required per Cloudflare WAN IPsec Tunnel)
  • IKE Gateways (one required per Cloudflare WAN IPsec Tunnel)

IKE Proposal

Define an IKE Proposal with the following settings:

Attribute Value
authentication-method pre-shared-keys
dh-group group20
authentication-algorithm sha256
encryption-algorithm aes-256-cbc
lifetime-seconds 28800
set security ike proposal ike-aes256cbc-sha256-dh20 authentication-method pre-shared-keys
set security ike proposal ike-aes256cbc-sha256-dh20 dh-group group20
set security ike proposal ike-aes256cbc-sha256-dh20 authentication-algorithm sha-256
set security ike proposal ike-aes256cbc-sha256-dh20 encryption-algorithm aes-256-cbc
set security ike proposal ike-aes256cbc-sha256-dh20 lifetime-seconds 28800

IKE Policies

Configure one IKE policy per IPsec tunnel:

Attribute Value
mode main
proposals ike-aes256cbc-sha256-dh20
pre-shared-key ascii-text specify pre-shared-key
set security ike policy cf-wan-ike-pol-01 mode main
set security ike policy cf-wan-ike-pol-01 proposals ike-aes256cbc-sha256-dh20
set security ike policy cf-wan-ike-pol-01 pre-shared-key ascii-text "Cloudflare-WAN-T1-PSK-1234!"

set security ike policy cf-wan-ike-pol-02 mode main
set security ike policy cf-wan-ike-pol-02 proposals ike-aes256cbc-sha256-dh20
set security ike policy cf-wan-ike-pol-02 pre-shared-key ascii-text "Cloudflare-WAN-T2-PSK-1234!"

IKE Gateways

Configure one IKE Gateway per IPsec tunnel:

set security ike gateway cf-wan-ike-gw-01 ike-policy cf-wan-ike-pol-01
set security ike gateway cf-wan-ike-gw-01 address 162.159.135.1
set security ike gateway cf-wan-ike-gw-01 local-identity hostname bf6c493d03<REDACTED>.ipsec.cloudflare.com
set security ike gateway cf-wan-ike-gw-01 external-interface ge-0/0/0.0
set security ike gateway cf-wan-ike-gw-01 local-address 203.0.113.100
set security ike gateway cf-wan-ike-gw-01 version v2-only

set security ike gateway cf-wan-ike-gw-02 ike-policy cf-wan-ike-pol-02
set security ike gateway cf-wan-ike-gw-02 address 172.64.135.1
set security ike gateway cf-wan-ike-gw-02 local-identity hostname 0287844e9d<REDACTED>.ipsec.cloudflare.com
set security ike gateway cf-wan-ike-gw-02 external-interface ge-0/0/0.0
set security ike gateway cf-wan-ike-gw-02 local-address 203.0.113.100
set security ike gateway cf-wan-ike-gw-02 version v2-only

IPsec - Phase 2

Perform in Configuration Mode

Configure the following:

  • IPsec Proposal
  • IPsec Policy
  • IPsec Tunnels (one required per Cloudflare WAN IPsec Tunnel)

IPsec Proposal

Define an IPsec Proposal with the following settings:

Attribute Value
protocol esp
authentication-algorithm hmac-sha-256-128
encryption-algorithm aes-256-cbc
lifetime-seconds 28800
set security ipsec proposal esp-aes256cbc-sha256-128 protocol esp
set security ipsec proposal esp-aes256cbc-sha256-128 authentication-algorithm hmac-sha-256-128
set security ipsec proposal esp-aes256cbc-sha256-128 encryption-algorithm aes-256-cbc
set security ipsec proposal esp-aes256cbc-sha256-128 lifetime-seconds 28800

IPsec Policy

set security ipsec policy ipsec-aes256cbc-sha256-128-dh20 perfect-forward-secrecy keys group20
set security ipsec policy ipsec-aes256cbc-sha256-128-dh20 proposals esp-aes256cbc-sha256-128

IPsec VPN Tunnels

Create two IPsec VPN tunnels - each corresponding to its respective IKE Gateway.

set security ipsec vpn cf-wan-ipsec-vpn-01 bind-interface st0.1
set security ipsec vpn cf-wan-ipsec-vpn-01 ike gateway cf-wan-ike-gw-01
set security ipsec vpn cf-wan-ipsec-vpn-01 ike no-anti-replay
set security ipsec vpn cf-wan-ipsec-vpn-01 ike ipsec-policy ipsec-aes256cbc-sha256-128-dh20
set security ipsec vpn cf-wan-ipsec-vpn-01 establish-tunnels immediately

set security ipsec vpn cf-wan-ipsec-vpn-02 bind-interface st0.2
set security ipsec vpn cf-wan-ipsec-vpn-02 ike gateway cf-wan-ike-gw-02
set security ipsec vpn cf-wan-ipsec-vpn-02 ike no-anti-replay
set security ipsec vpn cf-wan-ipsec-vpn-02 ike ipsec-policy ipsec-aes256cbc-sha256-128-dh20
set security ipsec vpn cf-wan-ipsec-vpn-02 establish-tunnels immediately

Note

Enabling establish-tunnels-immediately ensures the SRX is always the tunnel initiator. This is crucial as Cloudflare will never initiate the IPsec tunnel. If you do not enable this option, you will need to generate some traffic that will traverse the IPsec tunnels at which point the SRX will initiate the tunnel in an on-demand fashion.

MSS Clamping

Perform in Configuration Mode

The SRX platform is unique in that it allows you to configure MSS Clamping that only applies to IPsec tunnels as opposed to per interface or globally.

This ensures the overhead associated with IKE/IPsec packet headers is factored in and will minimize opportunities for fragmentation as traffic ingresses and egresses the IPsec tunnels.

Note

The recommended MSS value 1360 may need to be adjusted based on the nature of the traffic traversing the Cloudflare WAN IPsec Tunnels.

set security flow tcp-mss ipsec-vpn mss 1360

See How to change the MSS of TCP traffic passing through an IPsec VPN ↗︎ for more details.

Security Policies

Perform in Configuration Mode

  • Security policies are required to permit traffic between zones
  • The Ethernet interface ge-0/0/1.0 is in the trust security zone
  • The tunnel interfaces st0.1 and st0.2 are in the cloudflare security zone

The following example allows all source & destination IPs, ports, and protocols/services between cloudflare and trust as well as between trust and cloudflare.

Attribute Value
source-address any
destination-address any
application any
action permit
log session-close
set security policies from-zone cloudflare to-zone trust policy cloudflare-to-trust-permit match source-address any
set security policies from-zone cloudflare to-zone trust policy cloudflare-to-trust-permit match destination-address any
set security policies from-zone cloudflare to-zone trust policy cloudflare-to-trust-permit match application any
set security policies from-zone cloudflare to-zone trust policy cloudflare-to-trust-permit then permit
set security policies from-zone cloudflare to-zone trust policy cloudflare-to-trust-permit then log session-close

set security policies from-zone trust to-zone cloudflare policy trust-to-cloudflare-permit match source-address any
set security policies from-zone trust to-zone cloudflare policy trust-to-cloudflare-permit match destination-address any
set security policies from-zone trust to-zone cloudflare policy trust-to-cloudflare-permit match application any
set security policies from-zone trust to-zone cloudflare policy trust-to-cloudflare-permit then permit
set security policies from-zone trust to-zone cloudflare policy trust-to-cloudflare-permit then log session-close

Filter-Based Forwarding - Policy-Based Routing

Perform in Configuration Mode

HPE Juniper Networking provides multiple methods for performing Policy-Based Routing. Filter-Based Forwarding ↗︎ is the preferred method as it permits selectively routing traffic based on source, destination, protocol (and a wide variety of other matching criteria) through Cloudflare WAN or local Internet breakout with ease.

This example assumes traffic originating from 192.168.125.0/24 (ingress interface ge-0/0/1.0 zone trust) to any destination will be routed via the Cloudflare WAN IPsec Tunnels.

Implementing Filter-Based Forwarding (FBF) requires four steps: