You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a `POST` request [using the API](/api/resources/magic_transit/subresources/gre_tunnels/methods/create/) to create a GRE tunnel. You will need your [API Key](/fundamentals/api/get-started/keys/#view-your-global-api-key).
85
+
Create a `POST` request [using the API](/api/resources/magic_transit/subresources/gre_tunnels/methods/create/) to create a GRE tunnel.
1. Create a `POST` request [using the API](/api/resources/magic_transit/subresources/ipsec_tunnels/methods/create/) to create an IPsec tunnel. You will need your [API Key](/fundamentals/api/get-started/keys/#view-your-global-api-key).
111
-
112
-
Note that in example below, replay protection is disabled by default. You can enable it with the flag `"replay_protection": true` for each IPsec tunnel, if the devices you use do not support disabling this feature. If you have already created IPsec tunnels, update them with a [`PUT` request](https://developers.cloudflare.com/api/resources/magic_transit/subresources/ipsec_tunnels/methods/update/). <br/> Refer to <ahref={props.antiReplayPagePath}>Anti-replay protection</a> for more information on this topic.
1. Create a `POST` request [using the API](/api/resources/magic_transit/subresources/ipsec_tunnels/methods/create/) to create an IPsec tunnel.
141
+
142
+
Note that in example below, replay protection is disabled by default. You can enable it with the flag `"replay_protection": true` for each IPsec tunnel, if the devices you use do not support disabling this feature. If you have already created IPsec tunnels, update them with a [`PUT` request](/api/resources/magic_transit/subresources/ipsec_tunnels/methods/update/). Refer to <ahref={props.antiReplayPagePath}>Anti-replay protection</a> for more information on this topic.
143
+
144
+
<APIRequest
145
+
path="/accounts/{account_id}/magic/ipsec_tunnels"
146
+
method="POST"
147
+
json={{
148
+
"name": "<TUNNEL_NAME>",
149
+
"description": "<TUNNEL_DESCRIPTION>",
150
+
"interface_address": "<INTERFACE_ADDRESS>",
151
+
"cloudflare_endpoint": "<CLOUDFLARE_ENDPOINT>",
152
+
"customer_endpoint": "<CUSTOMER_ENDPOINT>"
153
+
}}
154
+
/>
155
+
156
+
```json output
157
+
{
158
+
"errors": [
139
159
{
140
-
"id": "<YOUR_TUNNEL_ID>",
141
-
"interface_address": "<INTERFACE_ADDRESS>",
142
-
"created_on": "2023-04-21T10:42:22.138586Z",
143
-
"modified_on": "2023-04-21T10:42:22.138586Z",
144
-
"name": "<TUNNEL_NAME>",
145
-
"cloudflare_endpoint": "<CLOUDFLARE_ENDPOINT>",
146
-
"customer_endpoint": "<CUSTOMER_ENDPOINT>",
147
-
"remote_identities": {
148
-
"hex_id": "<HEX_ID>",
149
-
"fqdn_id": "<FQDN_ID>.ipsec.cloudflare.com",
150
-
"user_id": "ipsec@<USER_ID>.ipsec.cloudflare.com"
151
-
},
152
-
"description": " test",
153
-
"health_check": {
154
-
"enabled": true,
155
-
"target": "<TARGET>",
156
-
"type": "reply",
157
-
"rate": "mid"
160
+
"code": 1000,
161
+
"message": "message"
162
+
}
163
+
],
164
+
"messages": [
165
+
{
166
+
"code": 1000,
167
+
"message": "message"
168
+
}
169
+
],
170
+
"result": {
171
+
"ipsec_tunnels": [
172
+
{
173
+
"id": "<IPSEC_TUNNEL_ID>",
174
+
"interface_address": "<INTERFACE_CIDR>",
175
+
"name": "<TUNNEL_NAME>",
176
+
"cloudflare_endpoint": "<IP_ADDRESS>",
177
+
"customer_endpoint": "<IP_ADDRESS>",
178
+
"description": "<TUNNEL_DESCRIPTION>",
179
+
"health_check": {
180
+
"direction": "unidirectional",
181
+
"enabled": true,
182
+
"rate": "low",
183
+
"type": "reply"
184
+
},
185
+
"psk_metadata": {},
186
+
"replay_protection": false
158
187
}
188
+
]
189
+
},
190
+
"success": true
191
+
}
192
+
```
193
+
194
+
Take note of the tunnel `id` value. We will use it to generate a pre-shared key (PSK).
195
+
196
+
2. Create a `POST`[request](/api/resources/magic_transit/subresources/ipsec_tunnels/methods/psk_generate/) to generate a PSK. Use the tunnel `id` value you received from the previous command.
3. Use the above `psk` value to configure the IPsec tunnel on your equipment. You do not need to take further action to use the PSK on Cloudflare's side, as this value is automatically set.
267
+
4. Use the `psk` value from step 3 to configure the IPsec tunnel on your equipmentas well.
194
268
195
269
</Details>
196
270
197
271
<Detailsheader="Configure bidirectional health checks">
198
272
199
-
Bidirectional health checks are available for GRE and IPsec tunnels. For Magic WAN this option defaults to bidirectional, while for Magic Transit it defaults to unidirectional.
273
+
Bidirectional health checks are available for GRE and IPsec tunnels. {props.biVsUniHealthCheckDefaults}.
200
274
201
-
You can enable bidirectional health checks via the API with `--data '{"health_check": {"direction": "bidirectional"}}'`. For example:
275
+
You can change this setting via the API with `"bidirectional"` or `"unidirectional"`:
0 commit comments