Skip to content
Start here

IPSEC Tunnels

List IPsec tunnels
GET/accounts/{account_id}/magic/ipsec_tunnels
List IPsec tunnel details
GET/accounts/{account_id}/magic/ipsec_tunnels/{ipsec_tunnel_id}
Create an IPsec tunnel
POST/accounts/{account_id}/magic/ipsec_tunnels
Update IPsec Tunnel
PUT/accounts/{account_id}/magic/ipsec_tunnels/{ipsec_tunnel_id}
Delete IPsec Tunnel
DELETE/accounts/{account_id}/magic/ipsec_tunnels/{ipsec_tunnel_id}
Update multiple IPsec tunnels
PUT/accounts/{account_id}/magic/ipsec_tunnels
Generate Pre-Shared Key (PSK) for IPsec tunnels
POST/accounts/{account_id}/magic/ipsec_tunnels/{ipsec_tunnel_id}/psk_generate
Set Pre-Shared Keys (PSK) for IPsec tunnels
POST/accounts/{account_id}/magic/ipsec_tunnels/psk
ModelsExpand Collapse
PSKMetadata object { last_generated_on }

The PSK metadata that includes when the PSK was generated.

last_generated_on: optional string

The date and time the tunnel was last modified.

formatdate-time
IPSECTunnelListResponse object { ipsec_tunnels }
ipsec_tunnels: optional array of object { id, cloudflare_endpoint, interface_address, 14 more }
id: string

Identifier

maxLength32
cloudflare_endpoint: string

The IP address assigned to the Cloudflare side of the IPsec tunnel.

interface_address: string

A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.

name: string

The name of the IPsec tunnel. The name cannot share a name with other tunnels.

allow_null_cipher: optional boolean

When true, the tunnel can use a null-cipher (ENCR_NULL) in the ESP tunnel (Phase 2).

automatic_return_routing: optional boolean

True if automatic stateful return routing should be enabled for a tunnel, false otherwise. Requires the coupler_integration account flag to be enabled; requests setting this to true without that flag will be rejected.

bgp: optional object { customer_asn, export_filter_id, extra_prefixes, 2 more }
customer_asn: number

ASN used on the customer end of the BGP session

formatint32
minimum0
export_filter_id: optional string

ID of the BGP filter profile applied to routes advertised to the customer.

extra_prefixes: optional array of string

Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table.

import_filter_id: optional string

ID of the BGP filter profile applied to routes received from the customer.

md5_key: optional string

MD5 key to use for session authentication.

Note that this is not a security measure. MD5 is not a valid security mechanism, and the key is not treated as a secret value. This is only supported for preventing misconfiguration, not for defending against malicious attacks.

The MD5 key, if set, must be of non-zero length and consist only of the following types of character:

  • ASCII alphanumerics: [a-zA-Z0-9]
  • Special characters in the set '!@#$%^&*()+[]{}<>/.,;:_-~= |`

In other words, MD5 keys may contain any printable ASCII character aside from newline (0x0A), quotation mark ("), vertical tab (0x0B), carriage return (0x0D), tab (0x09), form feed (0x0C), and the question mark (?). Requests specifying an MD5 key with one or more of these disallowed characters will be rejected.

bgp_status: optional object { state, tcp_established, updated_at, 5 more }
state: "BGP_DOWN" or "BGP_UP" or "BGP_ESTABLISHING"
One of the following:
"BGP_DOWN"
"BGP_UP"
"BGP_ESTABLISHING"
tcp_established: boolean