Skip to content

Commit 86921f9

Browse files
Apply suggestions from code review
1 parent 95aada3 commit 86921f9

File tree

1 file changed

+55
-56
lines changed
  • src/content/docs/magic-wan/configuration/manually/third-party

1 file changed

+55
-56
lines changed

src/content/docs/magic-wan/configuration/manually/third-party/juniper.mdx

Lines changed: 55 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,37 @@ pcx_content_type: integration-guide
33
title: Juniper Networks SRX Series Firewalls
44
---
55

6-
This tutorial provides information and examples of configuring Juniper Networks SRX Series Firewalls with Magic WAN.
6+
This tutorial provides information and examples of how to configure Juniper Networks SRX Series Firewalls with Magic WAN.
77

88
The configuration settings in this document are based on JUNOS 23.4R2.13.
99

1010
## Prerequisites
1111

12-
Confirm that you have the two Cloudflare anycast IPs allocated to your account. You will establish IPsec tunnels to the two anycast IPs irrespective of the location of your Juniper SRX devices (hereon in "endpoint") - traffic will be naturally attracted to the closest Cloudflare colocation facility via BGP anycast.
12+
Confirm that you have two Cloudflare anycast IPs allocated to your account. You will establish IPsec tunnels to the two anycast IPs irrespective of the location of your Juniper SRX devices (from now on referred to as endpoint) — traffic will be naturally attracted to the closest Cloudflare colocation facility via BGP anycast.
1313

14-
Cloudflare recommends customers configure two IPsec tunnels (one to each of the two anycast IPs allocated to you Cloudflare account) per Internet Service Provider per endpoint. This provides tunnel redundancy diversity.
14+
Cloudflare recommends that customers configure two IPsec tunnels (one to each of the two anycast IPs allocated to you Cloudflare account) per Internet service provider per endpoint. This provides tunnel redundancy.
1515

16-
Equal Cost Multipath Routing (ECMP) ensures traffic is load-balanced across the tunnels, and you can control traffic steering across the tunnels through route prioritization.
16+
Equal-cost multi-path routing (ECMP) ensures traffic is load-balanced across the tunnels, and you can control traffic steering across the tunnels through route prioritization.
1717

18-
Cloudflare supports Route-Based site-to-site IPsec tunnels, which require the creation of Virtual Tunnel Interfaces (VTIs). We recommend you select one subnet per Magic IPsec Tunnel with either a /30 or /31 netmask.
18+
Cloudflare supports route-based site-to-site IPsec tunnels, which require the creation of virtual tunnel interfaces (VTIs). We recommend you select one subnet per Magic IPsec tunnel with either a `/30` or `/31` netmask.
1919

20-
Using a /31 netmask makes more efficient use of IP addresses as it doubles the number of available subnets as it is unnecessary to reserve IPs for the subnet and broadcast addreses as there would be if you opt to use a /30 netmask. Additional details can be found in [RFC3021 - Using 31-Bit Prefixes on IPv4 Point-to-Point Links](https://datatracker.ietf.org/doc/html/rfc3021).
20+
Using a `/31` netmask is a more efficient use of IP addresses as it doubles the number of available subnets compared to a `/30`netmask. This is possible because with a `/31`netmask there is no need to reserve IP addresses for the subnet and broadcast addresses, as there would be if you opt to use a `/30` netmask. Additional details can be found in [RFC 3021 - Using 31-Bit Prefixes on IPv4 Point-to-Point Links](https://datatracker.ietf.org/doc/html/rfc3021).
2121

2222
## Cloudflare Magic WAN configuration
2323

2424
This section of the document will cover the configuration of:
2525

26-
- Magic IPsec Tunnels
27-
- Magic Static Routes
26+
- Magic IPsec tunnels
27+
- Magic static routes
2828

29-
### Magic WAN Topology
29+
### Magic WAN topology
3030

3131
This documentation assumes there are two locations connected via Magic WAN:
3232

3333
| Site | Local/Remote | Security Zone | Subnet |
3434
| ---- | ------------ | ------------- | ------------- |
35-
| A | Local | trust | 10.1.20.0/24 |
36-
| B | Remote | Cloudflare | 10.1.100.0/24 |
35+
| A | Local | trust | `10.1.20.0/24` |
36+
| B | Remote | Cloudflare | `10.1.100.0/24` |
3737

3838
### Magic IPsec tunnels
3939

@@ -45,7 +45,7 @@ This documentation assumes there are two locations connected via Magic WAN:
4545
- **Cloudflare endpoint**: One of the two Cloudflare anycast IP addresses.
4646
- **Pre-shared key**: Choose **Add pre-shared key later**.
4747
2. Select **Add IPsec Tunnel** and fill in the values for the second tunnel to the same Juniper SRX:
48-
- Ensure you use a unique RFC1918 IP address for the Interface Address (`/31` or `/30`).
48+
- Ensure you use a unique RFC 1918 IP address for the Interface Address (`/31` or `/30`).
4949
- Once again, specify the Internet IP address on the untrust side of the SRX firewall for the **Customer Endpoint**.
5050
- The **Cloudflare Endpoint** for the second tunnel will be the second Cloudflare anycast IP provisioned for your account.
5151
3. Select **Add Tunnels**. We also recommend selecting **Test Tunnels** to ensure that the settings do not conflict with any other tunnels defined in your account and that you specified the correct anycast IP addresses.
@@ -62,15 +62,15 @@ This documentation assumes there are two locations connected via Magic WAN:
6262
The **Tunnel ID** and **FQDN ID** values are unique per tunnel and remain unchanged unless you delete and recreate the tunnel. Generating a new Pre-Shared Key will not change the values.
6363
:::
6464

65-
### Magic Static Routes
65+
### Magic static routes
6666

6767
Refer to the Magic WAN Topology section above for more details on the IP subnet scheme.
6868

69-
[Magic Static Routes](/magic-wan/configuration/manually/how-to/configure-static-routes/) effectively tell Magic WAN which tunnels to route traffic destined for a given Magic WAN site.
69+
[Magic static routes](/magic-wan/configuration/manually/how-to/configure-static-routes/) effectively tell Magic WAN which tunnels to route traffic destined for a given Magic WAN site.
7070

7171
Since two tunnels are configured to each endpoint, it is necessary to configure two static routes.
7272

73-
Cloudflare leverages [Equal-Cost Multi-Path](/magic-wan/reference/traffic-steering/) routing to control traffic steering across the tunnels. The default priority for each route is 100 — traffic will be load-balanced across the two tunnels equally via ECMP. You can modify the priorities as needed, however best practices dictate leaving the default values in place.
73+
Cloudflare leverages [equal-cost multi-path](/magic-wan/reference/traffic-steering/) routing to control traffic steering across the tunnels. The default priority for each route is 100 — traffic will be load-balanced across the two tunnels equally via ECMP. You can modify the priorities as needed, however best practices dictate leaving the default values in place.
7474

7575
1. Create a static route with the following values. Make sure you select the first tunnel in **Tunnel/Next hop**:
7676
- **Description:** The description for the static route assigned to your first tunnel.
@@ -82,23 +82,23 @@ Cloudflare leverages [Equal-Cost Multi-Path](/magic-wan/reference/traffic-steeri
8282
3. Select **Test Routes** to ensure the settings are accepted, then select **Add Routes**.
8383
4. Confirm the routes were added correctly in **Magic WAN** > **Configuration** > **Static Routes**.
8484

85-
## Juniper SRX Configuration
85+
## Juniper SRX configuration
8686

87-
There may be some differences in the syntax of the commands in the version on your SRX devices; however, the principles are the same. Please refer to the Juniper product documentation for more information.
87+
There may be some differences in the syntax of the commands in the version on your SRX devices. However, the principles are the same. Refer to the Juniper product documentation for more information.
8888

89-
The interface naming convention for VTI interfaces (aka Secure Tunnel Interfaces) in Junos is st0.x.
89+
The interface naming convention for VTI interfaces (also known as Secure Tunnel Interfaces) in Junos is `st0.x`.
9090

9191
[Secure Tunnel Interface in a Virtual Router - Juniper IPsec VPN User Guide](https://www.juniper.net/documentation/us/en/software/junos/vpn-ipsec/topics/topic-map/security-secure-tunnel-interface-in-a-virtual-router.html)
9292

9393
The following elements will be configured on the Juniper SRX firewall(s):
9494

95-
- Ensure the LAN interface is in the `trust` zone ()
96-
- Add Virtual Tunnel Interfaces (`st0.0` and `st0.1`)
95+
- Ensure the LAN interface is in the `trust` zone
96+
- Add virtual tunnel Interfaces (`st0.0` and `st0.1`)
9797
- Assign tunnel interfaces to the `cloudflare` security zone
9898
- Allow required protocols to both the tunnel and untrust security zones
9999
- IKE configuration
100100
- IPsec configuration
101-
- Policy-Based Routing (Filter-Based Forwarding)
101+
- Policy-based routing (filter-based forwarding)
102102
- Security policies
103103

104104
### Tunnel interfaces
@@ -167,7 +167,7 @@ interfaces {
167167

168168
### Security zone (untrust) - `host-inbound-traffic`
169169

170-
Add ping and ike to the security zone containing the external interface used to establish the IPsec tunnels to Cloudflare.
170+
Add `ping` and `ike` to the security zone containing the external interface used to establish the IPsec tunnels to Cloudflare.
171171

172172
```txt
173173
set security zones security-zone untrust interfaces ge-0/0/0.0 host-inbound-traffic system-services ike
@@ -338,7 +338,7 @@ admin@srx300> show configuration security ipsec policy cf_magic_wan_ipsec_pol
338338
proposals cf_magic_wan_ipsec_prop;
339339
```
340340

341-
#### **IPsec VPN Tunnels**
341+
#### IPsec VPN tunnels
342342

343343
Define two IPsec policies - one for each of the two Magic IPsec tunnels. It is crucial to ensure that:
344344

@@ -397,24 +397,24 @@ establish-tunnels immediately;
397397

398398
### Policy-Based Routing
399399

400-
The SRX platform provides policy-based routing functionality, which Juniper refers to as filter-based forwarding.
401-
402-
[Filter-Based Forwarding Overview](https://www.juniper.net/documentation/us/en/software/junos/routing-policy/topics/concept/firewall-filter-option-filter-based-forwarding-overview.html)
400+
The SRX platform provides policy-based routing functionality, which Juniper refers to as [filter-based forwarding](https://www.juniper.net/documentation/us/en/software/junos/routing-policy/topics/concept/firewall-filter-option-filter-based-forwarding-overview.html).
403401

404402
Filter-based forwarding is implemented by configuring the following:
405403

406-
1. Routing Instance: Specify the routing table(s) to which a packet is forwarded and the destination to which the packet is forwarded at the [edit routing-instances] hierarchy level.
407-
2. Firewall Filter: Use a stateless firewall filter to specify the source and destination addresses in conjunction with a routing instance that forwards traffic across the Magic IPsec Tunnels, then bind the firewall filter to the ingress interface (trust zone).
408-
3. RIB Group: Share interface routes with the forwarding routing instances used in filter-based forwarding (FBF).
404+
1. **Routing Instance**: Specify the routing table(s) to which a packet is forwarded and the destination to which the packet is forwarded at the [edit routing-instances] hierarchy level.
405+
2. **Firewall Filter**: Use a stateless firewall filter to specify the source and destination addresses in conjunction with a routing instance that forwards traffic across the Magic IPsec tunnels, then bind the firewall filter to the ingress interface (trust zone).
406+
3. **RIB Group**: Share interface routes with the forwarding routing instances used in filter-based forwarding (FBF).
409407

410-
Note: Firewall filters must incorporate at least two terms:
408+
:::note
409+
Firewall filters must incorporate at least two terms:
411410

412-
1. Term 1: Classify the traffic to forward to Magic WAN
413-
2. Term 2: Permit all other traffic - otherwise, the firewall filters will discard any traffic not intended for Magic WAN destinations.
411+
- **Term 1**: Classify the traffic to forward to Magic WAN
412+
- **Term 2**: Permit all other traffic — otherwise, the firewall filters will discard any traffic not intended for Magic WAN destinations.
413+
:::
414414

415-
This configuration only factors in one local site (10.1.20.0/24). In this example, we assume devices in the trust zone must route traffic to a remote subnet at another Magic WAN-protected site (10.1.100.0/24).
415+
This configuration only factors in one local site (`10.1.20.0/24`). In this example, we assume devices in the trust zone must route traffic to a remote subnet at another Magic WAN-protected site (`10.1.100.0/24`).
416416

417-
Define a static route on the SRX to route traffic to 10.1.100.0/24 with redundant routes referencing each of the two tunnels.
417+
Define a static route on the SRX to route traffic to `10.1.100.0/24` with redundant routes referencing each of the two tunnels.
418418

419419
**Routing Instance:**
420420

@@ -424,9 +424,9 @@ As mentioned earlier, any traffic destined for other Magic WAN protected sites m
424424

425425
The example includes two static routes - one to each of the two VTIs on the Cloudflare side of the Magic IPsec Tunnels (`10.252.2.20` and `10.252.2.22`).
426426

427-
While it is possible to be more prescriptive in terms of the destination subnets, we simply use 0.0.0.0/0 as the Firewall Filter ensures only traffic destined for 10.1.100.0/24 will be forwarded to the Routing Instance. Any other traffic not destined for 10.1.100.0/24 will continue to the Primary Routing Table (`inet.0`) as it falls outside the scope of the Firewall Filter configured in the next section below.
427+
While it is possible to be more prescriptive in terms of the destination subnets, we simply use `0.0.0.0/0` as the firewall filter ensures only traffic destined for `10.1.100.0/24` will be forwarded to the routing instance. Any other traffic not destined for `10.1.100.0/24` will continue to the primary routing table (`inet.0`) as it falls outside the scope of the firewall filter configured in the next section below.
428428

429-
Leaving the destination subnet as 0.0.0.0/0 eases some administrative burden as you only need to modify the Firewall Filter to specify which traffic is destined for Magic WAN.
429+
Leaving the destination subnet as `0.0.0.0/0` eases some administrative burden as you only need to modify the firewall filter to specify which traffic is destined for Magic WAN.
430430

431431
```txt
432432
set routing-instances MAGIC_WAN_RI instance-type forwarding
@@ -450,11 +450,10 @@ MAGIC_WAN_RI {
450450

451451
**Firewall Filter:**
452452

453-
In this step, we create a stateless firewall filter to ensure only packets from 10.1.20.0/24 destined for 10.1.100.0/24 are sent to the `MAGIC_WAN_RI` Routing Instance.
454-
455-
- Term 1 - `MAGIC_WAN_NETS` ensures only packets from 10.1.20.0/24 destined for 10.1.100.0/24 are sent to the `MAGIC_WAN_RI` Routing Instance. Take note of the `count` statement defined in this term. [Count](https://www.juniper.net/documentation/us/en/software/junos/routing-policy/topics/example/firewall-filter-stateless-example-act-on-sampling.html) allows you to view how many packets are processed by this term in the Firewall Filter. An example of how to view the Counter is included below.
453+
In this step, we create a stateless firewall filter to ensure only packets from `10.1.20.0/24` destined for `10.1.100.0/24` are sent to the `MAGIC_WAN_RI` routing instance.
456454

457-
- Term 2 - `ALLOW_EVERYTHING_ELSE` ensures all other traffic continues to the Primary Routing Table (`inet.0`).
455+
- **Term 1** - `MAGIC_WAN_NETS` ensures only packets from `10.1.20.0/24` destined for `10.1.100.0/24` are sent to the `MAGIC_WAN_RI` routing instance. Take note of the `count` statement defined in this term. [Count](https://www.juniper.net/documentation/us/en/software/junos/routing-policy/topics/example/firewall-filter-stateless-example-act-on-sampling.html) allows you to view how many packets are processed by this term in the firewall filter. An example of how to view the Counter is included below.
456+
- **Term 2** - `ALLOW_EVERYTHING_ELSE` ensures all other traffic continues to the primary routing table (`inet.0`).
458457

459458
```txt
460459
set firewall family inet filter MAGIC_WAN_FBF term MAGIC_WAN_NETS from source-address 10.1.20.0/24
@@ -528,7 +527,7 @@ family inet {
528527

529528
**RIB Group:**
530529

531-
RIB Groups allow you to concatenate the contents of multiple routing tables into a Routing Table Group.
530+
RIB Groups allow you to concatenate the contents of multiple routing tables into a routing table group.
532531

533532
The primary routing table in the RIB group should be `inet.0` followed by the secondary routing table `MAGIC_WAN_RI.inet.0` which is the `MAGIC_WAN_RI` routing-instance created above.
534533

@@ -628,11 +627,11 @@ policy trust_to_cloudflare_permit {
628627

629628
There are several diagnostic commands available to view the status of IPsec tunnels.
630629

631-
#### **Ping Across Virtual Tunnel Interfaces**
630+
#### Ping across virtual tunnel interfaces
632631

633-
Use ping to test connectivity from the SRX side of the tunnel to the Cloudflare side of the tunnel. Ensure you use the source option to specify the IP address associated with tunnel interfaces st0.0 and st0.1, respectively:
632+
Use ping to test connectivity from the SRX side of the tunnel to the Cloudflare side of the tunnel. Ensure you use the source option to specify the IP address associated with tunnel interfaces `st0.0` and `st0.1`, respectively:
634633

635-
Tunnel 1 - `st0.0 - 10.252.2.21`
634+
**Tunnel 1** - `st0.0 - 10.252.2.21`
636635

637636
```txt
638637
admin@srx300> ping source 10.252.2.21 10.252.2.20
@@ -646,7 +645,7 @@ PING 10.252.2.20 (10.252.2.20): 56 data bytes
646645
64 bytes from 10.252.2.20: icmp_seq=4 ttl=64 time=3.811 ms
647646
```
648647

649-
Tunnel 2 - `st0.1 - 10.252.2.23`
648+
**Tunnel 2** - `st0.1 - 10.252.2.23`
650649

651650
```txt
652651
admin@srx300> ping source 10.252.2.23 10.252.2.22
@@ -754,11 +753,11 @@ file ike-debug.log size 1m files 3 world-readable;
754753
flag all;
755754
```
756755

757-
### **IPsec** **traceoptions**
756+
### IPsec `traceoptions`
758757

759-
[traceoptions (Security IPsec)](https://www.juniper.net/documentation/us/en/software/junos/cli-reference/topics/ref/statement/security-edit-traceoptions-ipsec.html)
758+
Refer to [traceoptions (Security IPsec)](https://www.juniper.net/documentation/us/en/software/junos/cli-reference/topics/ref/statement/security-edit-traceoptions-ipsec.html) for more information on this topic.
760759

761-
#### **Enable IPsec** **traceoptions**
760+
#### Enable IPsec `traceoptions`
762761

763762
```txt
764763
set security ipsec traceoptions file ipsec-debug.log
@@ -768,29 +767,29 @@ set security ipsec traceoptions file world-readable
768767
set security ipsec traceoptions flag all
769768
```
770769

771-
The log file can be viewed by doing the following:
770+
To view the log file:
772771

773-
1. From an operational mode, run **start shell**.
772+
1. From an operational mode, run `start shell`.
774773
2. Use the tail command to view the contents of the log file in real time:
775774
`tail -f /var/log/ipsec-debug.log`
776-
3. Press CTRL + C when finished.
777-
4. Type exit to return to the operational mode prompt.
775+
3. Press `CTRL + C` when finished.
776+
4. Type `exit` to return to the operational mode prompt.
778777

779-
Either deactivate traceoptions or delete traceoptions once debugging is complete.
778+
Either deactivate `traceoptions` or delete `traceoptions` once debugging is complete.
780779

781-
#### **Delete IPsec** **traceoptions**
780+
#### Delete IPsec `traceoptions`
782781

783782
```txt
784783
delete security ipsec traceoptions
785784
```
786785

787-
#### **Deactivate IPsec** **traceoptions**
786+
#### Deactivate IPsec `traceoptions`
788787

789788
```txt
790789
deactivate security ipsec traceoptions
791790
```
792791

793-
Confirm traceoptions is deactivated:
792+
Confirm `traceoptions` is deactivated:
794793

795794
```txt
796795
admin@srx300> show configuration security ipsec traceoptions

0 commit comments

Comments
 (0)