Skip to content

Commit 7e33ef9

Browse files
Lots of changes
1 parent df050f7 commit 7e33ef9

File tree

1 file changed

+38
-23
lines changed
  • src/content/docs/magic-wan/configuration/manually/third-party

1 file changed

+38
-23
lines changed

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

Lines changed: 38 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ 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 routed via BGP Anycast to the closest Cloudflare Point-of-Presence.
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.
1313

14-
Cloudflare recommends customers configure two IPsec tunnels per Internet Service Provider per endpoint. This provides tunnel redundancy and tunnel diversity. 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.
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.
1515

16-
Cloudflare supports Route-Based site-to-site IPsec tunnels, which require the creation of Virtual Tunnel Interfaces (VTIs). We recommend you select one subnet with either a /30 or /31 netmask (the latter makes more efficient use of IP addresses).
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.
1717

18-
The interface naming convention for VTI interfaces in Junos is st0.x.
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.
19+
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).
1921

2022
## Cloudflare Magic WAN configuration
2123

@@ -24,6 +26,15 @@ This section of the document will cover the configuration of:
2426
- Magic IPsec Tunnels
2527
- Magic Static Routes
2628

29+
### Magic WAN Topology
30+
31+
This documentation assumes there are two locations connected via Magic WAN:
32+
33+
| Site | Local/Remote | Security Zone | Subnet |
34+
| ---- | ------------ | ------------- | ------------- |
35+
| A | Local | trust | 10.1.20.0/24 |
36+
| B | Remote | cloudflare | 10.1.100.0/24 |
37+
2738
### Magic IPsec tunnels
2839

2940
1. Start by [creating the IPsec tunnels](/magic-wan/configuration/manually/how-to/configure-tunnels/#add-tunnels) in the Cloudflare dashboard with the following values:
@@ -48,17 +59,18 @@ This section of the document will cover the configuration of:
4859
8. Expand the first tunnel's properties and note the **Tunnel ID** and **FQDN ID** values.
4960
9. Repeat the previous steps for the second tunnel.
5061
:::note
51-
These values are unique per tunnel and remain the same even if you update the pre-shared key. These values change only if you delete and recreate the tunnel.
62+
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.
5263
:::
5364

54-
### Magic static routes
65+
### Magic Static Routes
5566

56-
This document assumes that the **trust zone** behind the Juniper SRX firewall has a single subnet:
57-
- `10.1.20.0/24`
67+
Refer to the Magic WAN Topology section above for more details on the IP subnet scheme.
5868

59-
[Magic Static Routes](/magic-wan/configuration/manually/how-to/configure-static-routes/) define which tunnel(s) to route traffic through for a subnet. Since two tunnels are configured to each endpoint, it is necessary to configure two static routes.
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.
6070

61-
Cloudflare leverages [Equal-Cost Multi-Path](/magic-wan/reference/traffic-steering/#equal-cost-multi-path-routing) 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.
71+
Since two tunnels are configured to each endpoint, it is necessary to configure two static routes.
72+
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.
6274

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

73-
## Juniper SRX configuration
85+
## Juniper SRX Configuration
7486

7587
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.
7688

89+
The interface naming convention for VTI interfaces (aka Secure Tunnel Interfaces) in Junos is st0.x.
90+
91+
[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)
92+
7793
The following elements will be configured on the Juniper SRX firewall(s):
7894

79-
- Add tunnel interfaces (`st0.x`)
80-
- Assign tunnel interfaces to a security zone
95+
- Ensure the LAN interface is in the `trust` zone ()
96+
- Add Virtual Tunnel Interfaces (`st0.0` and `st0.1`)
97+
- Assign tunnel interfaces to the `cloudflare` security zone
8198
- Allow required protocols to both the tunnel and untrust security zones
8299
- IKE configuration
83100
- IPsec configuration
@@ -93,8 +110,6 @@ set interfaces st0 unit 0 family inet address 10.252.2.21/31
93110
set interfaces st0 unit 1 family inet address 10.252.2.23/31
94111
```
95112

96-
2. Confirm settings:
97-
98113
```txt
99114
admin@srx300> show configuration interfaces st0
100115
```
@@ -113,7 +128,7 @@ unit 1 {
113128

114129
### Security Zone (Cloudflare) - tunnel interfaces
115130

116-
Define a security zone and add both tunnel interfaces to it. At a minimum, the interfaces should allow ping, but this zone only contains point-to-point connections between the firewall and the customer network namespace. You can always set the values for system services and protocols to all, as the intrazone traffic is from a trusted network.
131+
Define a security zone and add both tunnel interfaces to it. At a minimum, the interfaces should allow `ping`, but this zone only contains point-to-point connections between the firewall and the customer network namespace. Setting it to `all` for system-services and protocols should be fine.
117132

118133
```txt
119134
set security zones security-zone cloudflare interfaces st0.0 host-inbound-traffic system-services all
@@ -123,7 +138,7 @@ set security zones security-zone cloudflare interfaces st0.1 host-inbound-traffi
123138
```
124139

125140
```txt
126-
admin@srx300> show configuration security zones security-zone cloudflare
141+
admin@srx220> show configuration security zones security-zone cloudflare
127142
```
128143
```txt output
129144
interfaces {
@@ -152,7 +167,7 @@ interfaces {
152167

153168
### Security zone (untrust) - `host-inbound-traffic`
154169

155-
Add 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.
156171

157172
```txt
158173
set security zones security-zone untrust interfaces ge-0/0/0.0 host-inbound-traffic system-services ike
@@ -203,7 +218,7 @@ lifetime-seconds 28800;
203218

204219
Define two IKE policies — one for each of the two Magic IPsec tunnels:
205220

206-
**Tunnel 1 (SRX300_IPSEC_01)**
221+
***Tunnel 1 (SRX300_IPSEC_01)**
207222

208223
```txt
209224
set security ike policy cf_magic_wan_tun_01_pol mode main
@@ -289,6 +304,8 @@ version v2-only;
289304

290305
Add an IPsec proposal that specifies the [Phase 2 Configuration Parameters](/magic-wan/reference/tunnels/#supported-configuration-parameters):
291306

307+
Add an IPsec proposal that specifies the [Phase 2 Configuration Parameters](/magic-wan/reference/tunnels/#supported-configuration-parameters):
308+
292309
```txt
293310
set security ipsec proposal cf_magic_wan_ipsec_prop protocol esp
294311
set security ipsec proposal cf_magic_wan_ipsec_prop authentication-algorithm hmac-sha-256-128
@@ -328,7 +345,7 @@ Define two IPsec policies — one for each of the two Magic IPsec tunnels. It is
328345
- [Anti-replay](/magic-wan/reference/anti-replay-protection/) protection is disabled.
329346
- Use the [`no-anti-replay`](https://www.juniper.net/documentation/us/en/software/junos/interfaces-adaptive-services/topics/ref/statement/no-anti-replay-edit-services.html) option.
330347
- The SRX is the tunnel initiator:
331-
- Cloudflare will not initiate the tunnel
348+
- Cloudflare will not instantiate the tunnel
332349
- If the SRX does not initiate the tunnel, then the tunnel will not be established until there is an attempt to connect to resources through the tunnel
333350
- Use [`establish-tunnels immediately`](https://www.juniper.net/documentation/us/en/software/junos/interfaces-adaptive-services/topics/ref/statement/establish-tunnels-edit-services-ipsec-vpn.html) to ensure the SRX is the tunnel initiator.
334351

@@ -380,8 +397,7 @@ establish-tunnels immediately;
380397

381398
### Policy-Based Routing
382399

383-
384-
The SRX platform allows policy-based routing, which Juniper refers to as filter-based forwarding.
400+
The SRX platform provides policy-based routing functionality, which Juniper refers to as filter-based forwarding.
385401

386402
[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)
387403

@@ -412,7 +428,6 @@ While it is possible to be more prescriptive in terms of the destination subnets
412428

413429
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.
414430

415-
416431
```txt
417432
set routing-instances MAGIC_WAN_RI instance-type forwarding
418433
set routing-instances MAGIC_WAN_RI routing-options static route 0.0.0.0/0 next-hop 10.252.2.20

0 commit comments

Comments
 (0)