Skip to content
Start here

IPSEC Tunnels

List IPsec tunnels
client.magicTransit.ipsecTunnels.list(IPSECTunnelListParams { account_id, xMagicNewHcTarget } params, RequestOptionsoptions?): IPSECTunnelListResponse { ipsec_tunnels }
GET/accounts/{account_id}/magic/ipsec_tunnels
List IPsec tunnel details
client.magicTransit.ipsecTunnels.get(stringipsecTunnelId, IPSECTunnelGetParams { account_id, xMagicNewHcTarget } params, RequestOptionsoptions?): IPSECTunnelGetResponse { ipsec_tunnel }
GET/accounts/{account_id}/magic/ipsec_tunnels/{ipsec_tunnel_id}
Create an IPsec tunnel
client.magicTransit.ipsecTunnels.create(IPSECTunnelCreateParams { account_id, cloudflare_endpoint, interface_address, 11 more } params, RequestOptionsoptions?): IPSECTunnelCreateResponse { id, cloudflare_endpoint, interface_address, 14 more }
POST/accounts/{account_id}/magic/ipsec_tunnels
Update IPsec Tunnel
client.magicTransit.ipsecTunnels.update(stringipsecTunnelId, IPSECTunnelUpdateParams { account_id, cloudflare_endpoint, interface_address, 11 more } params, RequestOptionsoptions?): IPSECTunnelUpdateResponse { modified, modified_ipsec_tunnel }
PUT/accounts/{account_id}/magic/ipsec_tunnels/{ipsec_tunnel_id}
Delete IPsec Tunnel
client.magicTransit.ipsecTunnels.delete(stringipsecTunnelId, IPSECTunnelDeleteParams { account_id, xMagicNewHcTarget } params, RequestOptionsoptions?): IPSECTunnelDeleteResponse { deleted, deleted_ipsec_tunnel }
DELETE/accounts/{account_id}/magic/ipsec_tunnels/{ipsec_tunnel_id}
Update multiple IPsec tunnels
client.magicTransit.ipsecTunnels.bulkUpdate(IPSECTunnelBulkUpdateParams { account_id, body, xMagicNewHcTarget } params, RequestOptionsoptions?): IPSECTunnelBulkUpdateResponse { modified, modified_ipsec_tunnels }
PUT/accounts/{account_id}/magic/ipsec_tunnels
Generate Pre Shared Key (PSK) for IPsec tunnels
client.magicTransit.ipsecTunnels.pskGenerate(stringipsecTunnelId, IPSECTunnelPSKGenerateParams { account_id, body } params, RequestOptionsoptions?): IPSECTunnelPSKGenerateResponse { ipsec_tunnel_id, psk, psk_metadata }
POST/accounts/{account_id}/magic/ipsec_tunnels/{ipsec_tunnel_id}/psk_generate
ModelsExpand Collapse
PSKMetadata { last_generated_on }

The PSK metadata that includes when the PSK was generated.

last_generated_on?: string

The date and time the tunnel was last modified.

formatdate-time
IPSECTunnelListResponse { ipsec_tunnels }
ipsec_tunnels?: Array<IPSECTunnel>
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?: boolean

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

automatic_return_routing?: boolean

True if automatic stateful return routing should be enabled for a tunnel, false otherwise.

bgp?: BGP { customer_asn, extra_prefixes, md5_key }
customer_asn: number

ASN used on the customer end of the BGP session

formatint32
minimum0
extra_prefixes?: Array<string>

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

md5_key?: 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?: BGPStatus { state, tcp_established, updated_at, 5 more }
state: "BGP_DOWN" | "BGP_UP" | "BGP_ESTABLISHING"
One of the following:
"BGP_DOWN"
"BGP_UP"
"BGP_ESTABLISHING"
tcp_established: boolean
updated_at: string
formatdate-time
bgp_state?: string
cf_speaker_ip?: string
formatipv4
cf_speaker_port?: number
maximum65535
minimum1
customer_speaker_ip?: string
formatipv4
customer_speaker_port?: number
maximum65535
minimum1
created_on?: string

The date and time the tunnel was created.

formatdate-time
custom_remote_identities?: CustomRemoteIdentities { fqdn_id }
fqdn_id?: string

A custom IKE ID of type FQDN that may be used to identity the IPsec tunnel. The generated IKE IDs can still be used even if this custom value is specified.

Must be of the form <custom label>.<account ID>.custom.ipsec.cloudflare.com.

This custom ID does not need to be unique. Two IPsec tunnels may have the same custom fqdn_id. However, if another IPsec tunnel has the same value then the two tunnels cannot have the same cloudflare_endpoint.

customer_endpoint?: string

The IP address assigned to the customer side of the IPsec tunnel. Not required, but must be set for proactive traceroutes to work.

description?: string

An optional description forthe IPsec tunnel.

health_check?: HealthCheck { direction, enabled, rate, 2 more }
direction?: "unidirectional" | "bidirectional"

The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.

One of the following:
"unidirectional"
"bidirectional"
enabled?: boolean

Determines whether to run healthchecks for a tunnel.

How frequent the health check is run. The default value is mid.

target?: MagicHealthCheckTarget { effective, saved } | string

The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to customer_gre_endpoint address. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false.

One of the following:
MagicHealthCheckTarget { effective, saved }

The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to customer_gre_endpoint address. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target.

effective?: string

The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests.

saved?: string

The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used.

string

The type of healthcheck to run, reply or request. The default value is reply.

interface_address6?: string

A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127

modified_on?: string

The date and time the tunnel was last modified.

formatdate-time
psk_metadata?: PSKMetadata { last_generated_on }

The PSK metadata that includes when the PSK was generated.

replay_protection?: boolean

If true, then IPsec replay protection will be supported in the Cloudflare-to-customer direction.

IPSECTunnelGetResponse { ipsec_tunnel }
ipsec_tunnel?: IPSECTunnel { 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?: boolean

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

automatic_return_routing?: boolean

True if automatic stateful return routing should be enabled for a tunnel, false otherwise.

bgp?: BGP { customer_asn, extra_prefixes, md5_key }
customer_asn: number

ASN used on the customer end of the BGP session

formatint32
minimum0
extra_prefixes?: Array<string>

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

md5_key?: 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?: BGPStatus { state, tcp_established, updated_at, 5 more }
state: "BGP_DOWN" | "BGP_UP" | "BGP_ESTABLISHING"
One of the following:
"BGP_DOWN"
"BGP_UP"
"BGP_ESTABLISHING"
tcp_established: boolean
updated_at: string
formatdate-time
bgp_state?: string
cf_speaker_ip?: string
formatipv4
cf_speaker_port?: number
maximum65535
minimum1
customer_speaker_ip?: string
formatipv4
customer_speaker_port?: number
maximum65535
minimum1
created_on?: string

The date and time the tunnel was created.

formatdate-time
custom_remote_identities?: CustomRemoteIdentities { fqdn_id }
fqdn_id?: string

A custom IKE ID of type FQDN that may be used to identity the IPsec tunnel. The generated IKE IDs can still be used even if this custom value is specified.

Must be of the form <custom label>.<account ID>.custom.ipsec.cloudflare.com.

This custom ID does not need to be unique. Two IPsec tunnels may have the same custom fqdn_id. However, if another IPsec tunnel has the same value then the two tunnels cannot have the same cloudflare_endpoint.

customer_endpoint?: string

The IP address assigned to the customer side of the IPsec tunnel. Not required, but must be set for proactive traceroutes to work.

description?: string

An optional description forthe IPsec tunnel.

health_check?: HealthCheck { direction, enabled, rate, 2 more }
direction?: "unidirectional" | "bidirectional"

The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.

One of the following:
"unidirectional"
"bidirectional"
enabled?: boolean

Determines whether to run healthchecks for a tunnel.

How frequent the health check is run. The default value is mid.

target?: MagicHealthCheckTarget { effective, saved } | string

The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to customer_gre_endpoint address. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false.

One of the following:
MagicHealthCheckTarget { effective, saved }

The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to customer_gre_endpoint address. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target.

effective?: string

The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests.

saved?: string

The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used.

string

The type of healthcheck to run, reply or request. The default value is reply.

interface_address6?: string

A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127

modified_on?: string

The date and time the tunnel was last modified.

formatdate-time
psk_metadata?: PSKMetadata { last_generated_on }

The PSK metadata that includes when the PSK was generated.

replay_protection?: boolean

If true, then IPsec replay protection will be supported in the Cloudflare-to-customer direction.

IPSECTunnelCreateResponse { 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?: boolean

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

automatic_return_routing?: boolean

True if automatic stateful return routing should be enabled for a tunnel, false otherwise.

bgp?: BGP { customer_asn, extra_prefixes, md5_key }
customer_asn: number

ASN used on the customer end of the BGP session

formatint32
minimum0
extra_prefixes?: Array<string>

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

md5_key?: 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?: BGPStatus { state, tcp_established, updated_at, 5 more }
state: "BGP_DOWN" | "BGP_UP" | "BGP_ESTABLISHING"
One of the following:
"BGP_DOWN"
"BGP_UP"
"BGP_ESTABLISHING"
tcp_established: boolean
updated_at: string
formatdate-time
bgp_state?: string
cf_speaker_ip?: string
formatipv4
cf_speaker_port?: number
maximum65535
minimum1
customer_speaker_ip?: string
formatipv4
customer_speaker_port?: number
maximum65535
minimum1
created_on?: string

The date and time the tunnel was created.

formatdate-time
custom_remote_identities?: CustomRemoteIdentities { fqdn_id }
fqdn_id?: string

A custom IKE ID of type FQDN that may be used to identity the IPsec tunnel. The generated IKE IDs can still be used even if this custom value is specified.

Must be of the form <custom label>.<account ID>.custom.ipsec.cloudflare.com.

This custom ID does not need to be unique. Two IPsec tunnels may have the same custom fqdn_id. However, if another IPsec tunnel has the same value then the two tunnels cannot have the same cloudflare_endpoint.

customer_endpoint?: string

The IP address assigned to the customer side of the IPsec tunnel. Not required, but must be set for proactive traceroutes to work.

description?: string

An optional description forthe IPsec tunnel.

health_check?: HealthCheck { direction, enabled, rate, 2 more }
direction?: "unidirectional" | "bidirectional"

The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.

One of the following:
"unidirectional"
"bidirectional"
enabled?: boolean

Determines whether to run healthchecks for a tunnel.

How frequent the health check is run. The default value is mid.

target?: MagicHealthCheckTarget { effective, saved } | string

The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to customer_gre_endpoint address. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false.

One of the following:
MagicHealthCheckTarget { effective, saved }

The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to customer_gre_endpoint address. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target.

effective?: string

The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests.

saved?: string

The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used.

string

The type of healthcheck to run, reply or request. The default value is reply.

interface_address6?: string

A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127

modified_on?: string

The date and time the tunnel was last modified.

formatdate-time
psk_metadata?: PSKMetadata { last_generated_on }

The PSK metadata that includes when the PSK was generated.

replay_protection?: boolean

If true, then IPsec replay protection will be supported in the Cloudflare-to-customer direction.

IPSECTunnelUpdateResponse { modified, modified_ipsec_tunnel }
modified?: boolean
modified_ipsec_tunnel?: ModifiedIPSECTunnel { 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?: boolean

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

automatic_return_routing?: boolean

True if automatic stateful return routing should be enabled for a tunnel, false otherwise.

bgp?: BGP { customer_asn, extra_prefixes, md5_key }
customer_asn: number

ASN used on the customer end of the BGP session

formatint32
minimum0
extra_prefixes?: Array<string>

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

md5_key?: 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?: BGPStatus { state, tcp_established, updated_at, 5 more }
state: "BGP_DOWN" | "BGP_UP" | "BGP_ESTABLISHING"
One of the following:
"BGP_DOWN"
"BGP_UP"
"BGP_ESTABLISHING"
tcp_established: boolean
updated_at: string
formatdate-time
bgp_state?: string
cf_speaker_ip?: string
formatipv4
cf_speaker_port?: number
maximum65535
minimum1
customer_speaker_ip?: string
formatipv4
customer_speaker_port?: number
maximum65535
minimum1
created_on?: string

The date and time the tunnel was created.

formatdate-time
custom_remote_identities?: CustomRemoteIdentities { fqdn_id }
fqdn_id?: string

A custom IKE ID of type FQDN that may be used to identity the IPsec tunnel. The generated IKE IDs can still be used even if this custom value is specified.

Must be of the form <custom label>.<account ID>.custom.ipsec.cloudflare.com.

This custom ID does not need to be unique. Two IPsec tunnels may have the same custom fqdn_id. However, if another IPsec tunnel has the same value then the two tunnels cannot have the same cloudflare_endpoint.

customer_endpoint?: string

The IP address assigned to the customer side of the IPsec tunnel. Not required, but must be set for proactive traceroutes to work.

description?: string

An optional description forthe IPsec tunnel.

health_check?: HealthCheck { direction, enabled, rate, 2 more }
direction?: "unidirectional" | "bidirectional"

The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.

One of the following:
"unidirectional"
"bidirectional"
enabled?: boolean

Determines whether to run healthchecks for a tunnel.

How frequent the health check is run. The default value is mid.

target?: MagicHealthCheckTarget { effective, saved } | string

The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to customer_gre_endpoint address. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false.

One of the following:
MagicHealthCheckTarget { effective, saved }

The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to customer_gre_endpoint address. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target.

effective?: string

The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests.

saved?: string

The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used.

string

The type of healthcheck to run, reply or request. The default value is reply.

interface_address6?: string

A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127

modified_on?: string

The date and time the tunnel was last modified.

formatdate-time
psk_metadata?: PSKMetadata { last_generated_on }

The PSK metadata that includes when the PSK was generated.

replay_protection?: boolean

If true, then IPsec replay protection will be supported in the Cloudflare-to-customer direction.

IPSECTunnelDeleteResponse { deleted, deleted_ipsec_tunnel }
deleted?: boolean
deleted_ipsec_tunnel?: DeletedIPSECTunnel { 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?: boolean

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

automatic_return_routing?: boolean

True if automatic stateful return routing should be enabled for a tunnel, false otherwise.

bgp?: BGP { customer_asn, extra_prefixes, md5_key }
customer_asn: number

ASN used on the customer end of the BGP session

formatint32
minimum0
extra_prefixes?: Array<string>

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

md5_key?: 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?: BGPStatus { state, tcp_established, updated_at, 5 more }
state: "BGP_DOWN" | "BGP_UP" | "BGP_ESTABLISHING"
One of the following:
"BGP_DOWN"
"BGP_UP"
"BGP_ESTABLISHING"
tcp_established: boolean
updated_at: string
formatdate-time
bgp_state?: string
cf_speaker_ip?: string
formatipv4
cf_speaker_port?: number
maximum65535
minimum1
customer_speaker_ip?: string
formatipv4
customer_speaker_port?: number
maximum65535
minimum1
created_on?: string

The date and time the tunnel was created.

formatdate-time
custom_remote_identities?: CustomRemoteIdentities { fqdn_id }
fqdn_id?: string

A custom IKE ID of type FQDN that may be used to identity the IPsec tunnel. The generated IKE IDs can still be used even if this custom value is specified.

Must be of the form <custom label>.<account ID>.custom.ipsec.cloudflare.com.

This custom ID does not need to be unique. Two IPsec tunnels may have the same custom fqdn_id. However, if another IPsec tunnel has the same value then the two tunnels cannot have the same cloudflare_endpoint.

customer_endpoint?: string

The IP address assigned to the customer side of the IPsec tunnel. Not required, but must be set for proactive traceroutes to work.

description?: string

An optional description forthe IPsec tunnel.

health_check?: HealthCheck { direction, enabled, rate, 2 more }
direction?: "unidirectional" | "bidirectional"

The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.

One of the following:
"unidirectional"
"bidirectional"
enabled?: boolean

Determines whether to run healthchecks for a tunnel.

How frequent the health check is run. The default value is mid.

target?: MagicHealthCheckTarget { effective, saved } | string

The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to customer_gre_endpoint address. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false.

One of the following:
MagicHealthCheckTarget { effective, saved }

The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to customer_gre_endpoint address. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target.

effective?: string

The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests.

saved?: string

The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used.

string

The type of healthcheck to run, reply or request. The default value is reply.

interface_address6?: string

A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127

modified_on?: string

The date and time the tunnel was last modified.

formatdate-time
psk_metadata?: PSKMetadata { last_generated_on }

The PSK metadata that includes when the PSK was generated.

replay_protection?: boolean

If true, then IPsec replay protection will be supported in the Cloudflare-to-customer direction.

IPSECTunnelBulkUpdateResponse { modified, modified_ipsec_tunnels }
modified?: boolean
modified_ipsec_tunnels?: Array<ModifiedIPSECTunnel>
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?: boolean

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

automatic_return_routing?: boolean

True if automatic stateful return routing should be enabled for a tunnel, false otherwise.

bgp?: BGP { customer_asn, extra_prefixes, md5_key }
customer_asn: number

ASN used on the customer end of the BGP session

formatint32
minimum0
extra_prefixes?: Array<string>

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

md5_key?: 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?: BGPStatus { state, tcp_established, updated_at, 5 more }
state: "BGP_DOWN" | "BGP_UP" | "BGP_ESTABLISHING"
One of the following:
"BGP_DOWN"
"BGP_UP"
"BGP_ESTABLISHING"
tcp_established: boolean
updated_at: string
formatdate-time
bgp_state?: string
cf_speaker_ip?: string
formatipv4
cf_speaker_port?: number
maximum65535
minimum1
customer_speaker_ip?: string
formatipv4
customer_speaker_port?: number
maximum65535
minimum1
created_on?: string

The date and time the tunnel was created.

formatdate-time
custom_remote_identities?: CustomRemoteIdentities { fqdn_id }
fqdn_id?: string

A custom IKE ID of type FQDN that may be used to identity the IPsec tunnel. The generated IKE IDs can still be used even if this custom value is specified.

Must be of the form <custom label>.<account ID>.custom.ipsec.cloudflare.com.

This custom ID does not need to be unique. Two IPsec tunnels may have the same custom fqdn_id. However, if another IPsec tunnel has the same value then the two tunnels cannot have the same cloudflare_endpoint.

customer_endpoint?: string

The IP address assigned to the customer side of the IPsec tunnel. Not required, but must be set for proactive traceroutes to work.

description?: string

An optional description forthe IPsec tunnel.

health_check?: HealthCheck { direction, enabled, rate, 2 more }
direction?: "unidirectional" | "bidirectional"

The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.

One of the following:
"unidirectional"
"bidirectional"
enabled?: boolean

Determines whether to run healthchecks for a tunnel.

How frequent the health check is run. The default value is mid.

target?: MagicHealthCheckTarget { effective, saved } | string

The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to customer_gre_endpoint address. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false.

One of the following:
MagicHealthCheckTarget { effective, saved }

The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to customer_gre_endpoint address. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target.

effective?: string

The effective health check target. If 'saved' is empty, then this field will be populated with the calculated default value on GET requests. Ignored in POST, PUT, and PATCH requests.

saved?: string

The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used.

string

The type of healthcheck to run, reply or request. The default value is reply.

interface_address6?: string

A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127

modified_on?: string

The date and time the tunnel was last modified.

formatdate-time
psk_metadata?: PSKMetadata { last_generated_on }

The PSK metadata that includes when the PSK was generated.

replay_protection?: boolean

If true, then IPsec replay protection will be supported in the Cloudflare-to-customer direction.

IPSECTunnelPSKGenerateResponse { ipsec_tunnel_id, psk, psk_metadata }
ipsec_tunnel_id?: string

Identifier

maxLength32
psk?: string

A randomly generated or provided string for use in the IPsec tunnel.

psk_metadata?: PSKMetadata { last_generated_on }

The PSK metadata that includes when the PSK was generated.