HPE Juniper Networking SRX Series Firewa·续

  1. Create a Forwarding Routing Instance
  2. Think of the Routing Instance as a "bucket" containing an alternate routing table
  3. The Routing Instance contains the destination prefix(es) and next hop addresses (VTI on Cloudflare side of the tunnels)
  4. Create a Firewall Filter
  5. Think of a Firewall Filter as the "brain" that determines which packets to send to the "bucket"
  6. The Firewall Filter acts as a "classifier" that identifies the traffic you want to divert to the Routing Instance
  7. Configure the RIB Group and Bind Routes
  8. Think of this as the "bridge" that copies interface routes to the "bucket"
  9. The Routing Instance is not part of the default routing table.
  10. This step instructs the SRX how to reach directly connected networks and resolve next-hops found in the main table ( inet.0) and the Cloudflare WAN Routing Instance's routing table CF_WAN_RI.inet.0
  11. Apply the Firewall Filter to the ingress traffic interface(s)
  12. Think of this as the "trigger" that starts processing packets as they enter the ingress interface
  13. As traffic ingresses the interface(s) to which it is applied, traffic is processed in a top-down fashion

Define a Routing Instance

The Routing Instance defines the destination for your steered traffic. Unlike a standard VRF, FBF typically uses an instance type of forwarding.

This example effectively sets the default gateway (0.0.0.0/0) for any traffic landing on this Routing Instance to get routed to the IP address of the VTIs on the Cloudflare side of the IPsec tunnels:

set routing-instances CF_WAN_RI instance-type forwarding
set routing-instances CF_WAN_RI routing-options static route 0.0.0.0/0 next-hop 169.254.250.0
set routing-instances CF_WAN_RI routing-options static route 0.0.0.0/0 next-hop 169.254.250.2

Create a Firewall Filter

Add a firewall filter called CF_WAN_FBF_ALL with two terms (rules):

The first term CF_WAN_FWD_RI ensures any traffic originating from the LAN subnet (192.168.125.0/24) to any destination address (0.0.0.0/0) is processed against the CF_WAN_RI routing instance.

The second term EVERYTHING_ELSE effectively instructs the SRX to continue processing any traffic not matching the term CF_WAN_FWD_RI via the default routing table (inet.0).

Note the addition of the action count in both statements. This option defines a counter you can view to determine how many packets are processed on each term.

set firewall family inet filter CF_WAN_FBF_ALL term CF_WAN_FWD_RI from source-address 192.168.125.0/24
set firewall family inet filter CF_WAN_FBF_ALL term CF_WAN_FWD_RI from destination-address 0.0.0.0/0
set firewall family inet filter CF_WAN_FBF_ALL term CF_WAN_FWD_RI then count CF_WAN_FWD_RI_count
set firewall family inet filter CF_WAN_FBF_ALL term CF_WAN_FWD_RI then routing-instance CF_WAN_RI
set firewall family inet filter CF_WAN_FBF_ALL term EVERYTHING_ELSE then count EVERYTHING_ELSE_count
set firewall family inet filter CF_WAN_FBF_ALL term EVERYTHING_ELSE then accept

Configure the RIB Group and Bind Interface Routes

Create a RIB Group and import both the default route table (inet.0) and the route table associated with the newly created Forwarding Routing Instance:

set routing-options rib-groups CF_WAN_RG import-rib inet.0
set routing-options rib-groups CF_WAN_RG import-rib CF_WAN_RI.inet.0

Bind the RIB Group to the Interface Routes:

set routing-options interface-routes rib-group inet CF_WAN_RG

Apply the Firewall Filter to the Ingress Interface

  • Traffic originating on the LAN subnet will ingress interface ge-0/0/1.0
  • Apply the Firewall Filter CF_WAN_FBF_ALL as an input filter
set interfaces ge-0/0/1 unit 0 family inet filter input CF_WAN_FBF_ALL

Commit changes, then test traffic from a host on the 192.168.125.0/24 subnet to ensure it is forwarded through the Cloudflare WAN IPsec Tunnels.

Note

If you have Cloudflare One configured to perform HTTPS traffic inspection, ensure that you install the Root CA certificate prior to testing connectivity to any HTTPS-based sites, otherwise you will receive untrusted certificate warning messages.

Troubleshooting

Common issues

  • Always check IKE Phase 1 & IPsec Phase 2 negotiated successfully - look for "no proposal chosen" in logs
  • Verify Pre-Shared-Key and/or Local-Identity values are accurate and assigned to the correct tunnel
  • Use ping to determine reachability between the CPE and Cloudflare sides of the VTI
  • Tunnel 1: CPE VTI to Cloudflare VTI: ping source 169.254.250.1 169.254.250.0
  • Tunnel 2: CPE VTI to Cloudflare VTI: ping source 169.254.250.3 169.254.250.2

View IKE Security Associations

Perform in Operational Mode

Use the CLI to verify IKE (Phase 1) and IPsec (Phase 2) security associations established.

admin@srx> show security ike security-associations
Index   State  Initiator cookie  Responder cookie  Mode           Remote Address
403838  UP     a2d16e54c9d83ad5  873b1da714f0ca8f  IKEv2          162.159.135.1
403839  UP     476288ac95d878e2  e72ef64e00b623e6  IKEv2          172.64.135.1

View IPsec Security Associations

Perform in Operational Mode

admin@srx> show ipsec security associations
  Total active tunnels: 2
  ID    Algorithm       SPI      Life:sec/kb  Mon lsys Port  Gateway
  <131073 ESP:aes-cbc-256/sha256-96 9b429dd3 27739/unlim - root 500 162.159.135.1
  >131073 ESP:aes-cbc-256/sha256-96 28931d57 27739/unlim - root 500 162.159.135.1
  <131074 ESP:aes-cbc-256/sha256-96 eb2a275e 27739/unlim - root 500 172.64.135.1
  >131074 ESP:aes-cbc-256/sha256-96 4134d7a8 27739/unlim - root 500 172.64.135.1

Enable Debug Logging (traceoptions) for IKE (Phase 1) and IPsec (Phase 2)

In the event you encounter issues with IPsec tunnel negotiation, you can enable traceoptions for IKE and/or IPsec.

Note

Debug logging can create significant overhead on firewalls with high utilization. Ensure you monitor CPU and memory utilization closely and only enable debug logging when it is needed.

Enable IKE Traceoptions

Perform in Configuration Mode

set security ike traceoptions file ike-debug.log
set security ike traceoptions file size 1m
set security ike traceoptions file files 3
set security ike traceoptions file world-readable
set security ike traceoptions flag all

View IKE Debug Log

Perform in Operational Mode

View the log with the following command:

admin@srx> show log ike-debug.log

Press CTRL + C to stop viewing the log.

Disable IKE Traceoptions

Perform in Configuration Mode

delete security ike traceoptions
commit

Enable IPsec Traceoptions

Perform in Configuration Mode

set security ipsec traceoptions file ipsec-debug.log
set security ipsec traceoptions file size 1m
set security ipsec traceoptions file files 3
set security ipsec traceoptions file world-readable
set security ipsec traceoptions flag all

View IPsec Debug Logging

Perform in Operational Mode

View the log with the following command:

admin@srx> show log ipsec-debug.log

Press CTRL + C to stop viewing the log.

Disable IPsec Debug Logging

Perform in Configuration Mode

delete security ipsec traceoptions
commit

Disable/Enable IKE Gateways and/or IPsec VPN Tunnels

Perform in Configuration Mode

Junos provides the ability to administratively enable/disable IKE gateways and IPsec tunnels independently. This allows you to forcefully set up and tear down VPN tunnels which can be very useful during troubleshooting.

Deactivate IKE Gateway

deactivate security ike gateway cf-wan-ike-gw-01

Deactivate IPsec VPN

deactivate security ipsec vpn cf-wan-ipsec-vpn-01

Perform a commit to ensure the IKE Gateway and IPSec VPN objects are disabled.

Verify Inactive State

Note the presence of inactive: security ike gateway cf-wan-ike-gw-01 at the top of the IKE gateway stanza:

admin@srx# show security ike gateway cf-wan-ike-gw-01
##
## inactive: security ike gateway cf-wan-ike-gw-01
##
ike-policy cf-wan-ike-pol-01;
address 162.159.135.1;
local-identity hostname bf6c493d03<REDACTED>.ipsec.cloudflare.com;
external-interface ge-0/0/0.0;
local-address 203.0.113.100;
version v2-only;

Note the presence of inactive: security ipsec vpn cf-wan-ike-gw-01 at the top of the IPsec VPN stanza:

[edit]
admin@srx# show security ipsec vpn cf-wan-ipsec-vpn-01
##
## inactive: security ipsec vpn cf-wan-ipsec-vpn-01
##
bind-interface st0.1;
ike {
    gateway cf-wan-ike-gw-01;
    no-anti-replay;
    ipsec-policy ipsec-aes256cbc-sha256-128-dh20;
}
establish-tunnels immediately;

Activate IKE Gateway and IPsec VPN Objects

Reverse the process with the activate command:

activate security ike gateway cf-wan-ike-gw-01

activate security ipsec vpn cf-wan-ipsec-vpn-01

commit

Restart IPsec Daemon

Perform in Operational Mode

The IKE and IPsec lifetimes are set to 28800 seconds (8 hours). You can force tunnel establishment by restarting the IPsec daemon (kmd). This will invalidate the IKE and IPsec security associations and forcefully reconnect the IPsec VPN tunnels.

This can be accomplished with the following command:

admin@srx> restart ipsec-key-management

Ensure Reachability Across IPsec Tunnels

Perform in Operational Mode

Use ping to verify connectivity to the Cloudflare side of the Virtual Tunnel Interface

admin@srx> ping 169.254.250.0 source 169.254.250.1
admin@srx> ping 169.254.250.2 source 169.254.250.3

Show Tunnel Event Statistics

Perform in Operational Mode

admin@srx> show security ipsec tunnel-events-statistics

Resulting output:

External interface's zone received. Information updated                     : 2
Bind-interface's zone received. Information updated                         : 2
Bind-interface's address received. Information updated                      : 2
IKE SA negotiation successfully completed                                   : 2
IPSec SA negotiation successfully completed                                 : 2
Tunnel is ready. Waiting for trigger event or peer to trigger negotiation   : 2

Display Route Tables

Perform in Operational Mode

Default Route Table - inet.0

show route table inet.0

inet.0: 11 destinations, 11 routes (11 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

169.254.247.0/31   *[Direct/0] 00:02:10
                    > via st0.1
169.254.247.1/32   *[Local/0] 1d 05:35:54
                      Local via st0.1
169.254.247.2/31   *[Direct/0] 00:02:09
                    > via st0.2
169.254.247.3/32   *[Local/0] 1d 05:35:54
                      Local via st0.2
169.254.250.0/31   *[Direct/0] 00:02:09
                    > via st0.1
169.254.250.1/32   *[Local/0] 00:02:09
                      Local via st0.1
169.254.250.2/31   *[Direct/0] 00:02:09
                    > via st0.2
169.254.250.3/32   *[Local/0] 00:02:09
                      Local via st0.2
192.168.125.0/24   *[Direct/0] 00:02:10
                    > via ge-0/0/1.0
192.168.125.1/32   *[Local/0] 00:02:10
                      Local via ge-0/0/1.0
203.0.113.100/32   *[Local/0] 00:02:10
                      Reject

Routing Instance Route Table (CF_WAN_RI.inet.0)

show route table CF_WAN_RI.inet.0

CF_WAN_RI.inet.0: 12 destinations, 12 routes (12 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

0.0.0.0/0          *[Static/5] 00:01:04
                    > to 169.254.250.0 via st0.1
                      to 169.254.250.2 via st0.2
169.254.247.0/31   *[Direct/0] 00:02:58
                    > via st0.1
169.254.247.1/32   *[Local/0] 00:02:58
                      Local via st0.1
169.254.247.2/31   *[Direct/0] 00:02:57
                    > via st0.2
169.254.247.3/32   *[Local/0] 00:02:57
                      Local via st0.2
169.254.250.0/31   *[Direct/0] 00:02:57
                    > via st0.1
169.254.250.1/32   *[Local/0] 00:02:57
                      Local via st0.1
169.254.250.2/31   *[Direct/0] 00:02:57
                    > via st0.2
169.254.250.3/32   *[Local/0] 00:02:57
                      Local via st0.2
192.168.125.0/24   *[Direct/0] 00:02:58
                    > via ge-0/0/1.0
192.168.125.1/32   *[Local/0] 00:02:58
                      Local via ge-0/0/1.0
203.0.113.100/32   *[Local/0] 00:02:58
                      Reject

Display Firewall Filter Counters

admin@srx> show firewall counter filter CF_WAN_FBF_ALL CF_WAN_FWD_RI_count

Filter: CF_WAN_FBF_ALL
Counters:
Name                                Bytes              Packets
CF_WAN_FWD_RI_count                 14855935          189746
admin@srx> show firewall counter filter CF_WAN_FBF_ALL EVERYTHING_ELSE_count

Filter: CF_WAN_FBF_ALL
Counters:
Name                                Bytes              Packets
EVERYTHING_ELSE_count               4371377            18732

Resources - Juniper Product Documentation

Refer to the CLI Reference Guide for further details on each command referenced within this document:

Resources - Juniper Knowledge Base

Valid support credentials may be required to view some/all of the following documents:

Was this helpful?

YesNo

On this page

HPE Juniper Networking SRX Series Firewa·续 - 图1Docs

{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/cloudflare-wan/configuration/third-party/juniper/#page","headline":"HPE Juniper Networking SRX Series Firewalls","description":"Connect HPE Juniper SRX to Cloudflare WAN.","url":"https://developers.cloudflare.com/cloudflare-wan/configuration/third-party/juniper/","inLanguage":"en","image":"https://developers.cloudflare.com/cloudflare-wan/configuration/third-party/juniper/og.png?v=0c37195c3d52a33b","dateModified":"2026-10-12","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"},"keywords":["IPsec"]}


description: Connect Oracle Cloud to Cloudflare WAN. title: Oracle Cloud image: https://developers.cloudflare.com/cloudflare-wan/configuration/third-party/oracle/og.png?v=eb0007fe05a6a4cc


Skip to content

Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/cloudflare-wan/llms.txt
Use this file to discover all available pages before exploring further.