All Products
Search
Document Center

VPN Gateway:ModifyVpnConnectionAttribute

Last Updated:Oct 08, 2026

Modifies the configurations of an IPsec-VPN connection.

Operation description

  • To modify an IPsec-VPN connection in dual-tunnel mode, you can configure the following request parameters in addition to the required parameters when you call the ModifyVpnConnectionAttribute operation:

    ClientToken, Name, LocalSubnet, RemoteSubnet, EffectImmediately, AutoConfigRoute, TunnelOptionsSpecification array, and EnableTunnelsBgp.

  • To modify an IPsec-VPN connection in single-tunnel mode, you can configure the following request parameters in addition to the required parameters when you call the ModifyVpnConnectionAttribute operation:

    ClientToken, Name, LocalSubnet, RemoteSubnet, EffectImmediately, IkeConfig, IpsecConfig, HealthCheckConfig, AutoConfigRoute, EnableDpd, EnableNatTraversal, BgpConfig, and RemoteCaCertificate.

  • The ModifyVpnConnectionAttribute operation is asynchronous. After you send the request, the system returns a request ID, but the configurations of the IPsec-VPN connection are not immediately modified. The modification node is still running in the background. You can invoke the DescribeVpnGateway operation to query the instance status of the VPN gateway instance and check the modification status of the IPsec-VPN connection configurations:

    • If the VPN gateway is in the updating state, the configurations of the IPsec-VPN connection are being modified.

    • If the VPN gateway is in the active state, the configurations of the IPsec-VPN connection are modified.

  • The ModifyVpnConnectionAttribute operation does not support concurrent modification of IPsec-VPN connection configurations under the same VPN gateway.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

vpc:ModifyVpnConnectionAttribute

update

*VpnConnection

acs:vpc:{#regionId}:{#accountId}:vpnconnection/{#VpnConnectionId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID of the IPsec-VPN connection.

You can call the DescribeRegions operation to query region IDs.

cn-shanghai

ClientToken

string

No

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must ensure that it is unique among different requests. The client token can contain only ASCII characters.

Note

If you do not specify this parameter, the system automatically uses the RequestId of the API request as the ClientToken. The RequestId of each API request is unique.

02fb3da4-130e-11e9-8e44-0016e04115b

VpnConnectionId

string

Yes

The ID of the IPsec-VPN connection.

vco-bp1bbi27hojx80nck****

Name

string

No

The name of the IPsec-VPN connection.

The name must be 1 to 100 characters in length, and cannot start with http:// or https://.

nametest

LocalSubnet

string

No

The CIDR block on the VPC side that needs to communicate with the data center. This parameter is used for Phase 2 negotiations.

Separate multiple CIDR blocks with commas (,). Example: 192.168.1.0/24,192.168.2.0/24.

Routing modes of the IPsec-VPN connection:

  • If both LocalSubnet and RemoteSubnet are set to 0.0.0.0/0, the destination routing mode is used.

  • If both LocalSubnet and RemoteSubnet are set to specific CIDR blocks, the interested traffic mode is used.

10.1.1.0/24,10.1.2.0/24

RemoteSubnet

string

No

The CIDR block on the data center side. This parameter is used for Phase 2 negotiations.

Separate multiple CIDR blocks with commas (,). Example: 192.168.3.0/24,192.168.4.0/24.

Routing modes of the IPsec-VPN connection:

  • If both LocalSubnet and RemoteSubnet are set to 0.0.0.0/0, the destination routing mode is used.

  • If both LocalSubnet and RemoteSubnet are set to specific CIDR blocks, the interested traffic mode is used.

10.2.1.0/24,10.2.2.0/24

EffectImmediately

boolean

No

Specifies whether the configurations of the IPsec-VPN connection take effect immediately. Valid values:

  • true: Yes. The system immediately initiates IPsec negotiations after the configurations are completed.

  • false: No. The system initiates IPsec negotiations only when traffic is detected.

false

IkeConfig

string

No

This parameter is supported when you modify an IPsec-VPN connection in single-tunnel mode.

The configurations for Phase 1 negotiations:

  • IkeConfig.Psk: The pre-shared key used for authentication between the VPN gateway and the data center.

    • The key must be 1 to 100 characters in length and can contain digits, letters, and the following special characters: ~!`@#$%^&*()_-+={}[]|;:',.<>/? It cannot contain spaces.

    • If you do not specify a pre-shared key, the system randomly generates a 16-character string as the pre-shared key. You can call the DescribeVpnConnection operation to query the automatically generated pre-shared key.

    Note

    The pre-shared key on the IPsec-VPN connection side must be the same as the authentication key on the data center side. Otherwise, the connection between the data center and the VPN gateway cannot be established.

  • IkeConfig.IkeVersion: The version of the IKE protocol. Valid values: ikev1 and ikev2.

    Compared with IKEv1, IKEv2 simplifies the SA negotiation process and provides better support for multi-CIDR block scenarios.

  • IkeConfig.IkeMode: The negotiation mode of the IKE version. Valid values: main and aggressive.

    • main: The main mode. The negotiation process is highly secure.

    • aggressive: The aggressive mode. The negotiation process is fast and has a high success rate.

  • IkeConfig.IkeEncAlg: The encryption algorithm used in Phase 1 negotiations.

    Valid values: aes, aes192, aes256, des, and 3des.

  • IkeConfig.IkeAuthAlg: The authentication algorithm used in Phase 1 negotiations.

    Valid values: md5, sha1, sha256, sha384, and sha512.

  • IkeConfig.IkePfs: The Diffie-Hellman key exchange algorithm used in Phase 1 negotiations. Valid values: group1, group2, group5, and group14.

  • IkeConfig.IkeLifetime: The SA lifetime determined by Phase 1 negotiations. Unit: seconds. Valid values: 0 to 86400.

  • IkeConfig.LocalId: The identifier of the VPN gateway. The identifier can be up to 100 characters in length and cannot contain spaces. The default value is the IP address of the VPN gateway.

  • IkeConfig.RemoteId: The identifier of the customer gateway. The identifier can be up to 100 characters in length and cannot contain spaces. The default value is the IP address of the customer gateway.

{"Psk":"pgw6dy7d1i8i****","IkeVersion":"ikev1","IkeMode":"main","IkeEncAlg":"aes","IkeAuthAlg":"sha1","IkePfs":"group2","IkeLifetime":86400,"LocalId":"116.64.XX.XX","RemoteId":"139.18.XX.XX"}

IpsecConfig

string

No

This parameter is supported when you modify an IPsec-VPN connection in single-tunnel mode.

The configurations for Phase 2 negotiations:

  • IpsecConfig.IpsecEncAlg: The encryption algorithm used in Phase 2 negotiations.

    Valid values: aes, aes192, aes256, des, and 3des.

  • IpsecConfig.IpsecAuthAlg: The authentication algorithm used in Phase 2 negotiations.

    Valid values: md5, sha1, sha256, sha384, and sha512.

  • IpsecConfig.IpsecPfs: The Diffie-Hellman key exchange algorithm used in Phase 1 negotiations for forwarding packets of all protocols. Valid values: disabled, group1, group2, group5, and group14.

  • IpsecConfig.IpsecLifetime: The SA lifetime determined by Phase 2 negotiations. Unit: seconds. Valid values: 0 to 86400.

{"IpsecEncAlg":"aes","IpsecAuthAlg":"sha1","IpsecPfs":"group2","IpsecLifetime":86400}

HealthCheckConfig

string

No

This parameter is supported when you modify an IPsec-VPN connection in single-tunnel mode.

The health check configurations:

  • HealthCheckConfig.enable: Specifies whether to enable health checks. Valid values: true and false.

  • HealthCheckConfig.dip: The destination IP address for health checks.

  • HealthCheckConfig.sip: The source IP address for health checks.

  • HealthCheckConfig.interval: The retry interval for health checks. Unit: seconds.

  • HealthCheckConfig.retry: The maximum number of health check retries.

{"enable":"true","dip":"192.168.1.1","sip":"10.1.1.1","interval":"3","retry":"3"}

AutoConfigRoute

boolean

No

Specifies whether to automatically publish route entry. Valid values:

  • true: Automatically publishes route entry.

  • false: Does not automatically publish route entry.

true

EnableDpd

boolean

No

This parameter is supported when you modify an IPsec-VPN connection in single-tunnel mode.

Specifies whether to enable the dead peer detection (DPD) feature. Valid values:

  • true: Enables the DPD feature. The IPsec initiator sends DPD packets to check whether the peer device is alive. If no correct response is received within the specified time, the peer is considered disconnected. IPsec deletes the ISAKMP SA and the corresponding IPsec SA, and the secure tunnel is also deleted.

  • false: Disables the DPD feature. The IPsec initiator does not send DPD probe packets.

true

EnableNatTraversal

boolean

No

This parameter is supported when you modify an IPsec-VPN connection in single-tunnel mode.

Specifies whether to enable the NAT traversal feature. Valid values:

  • true: Enables the NAT traversal feature. After this feature is enabled, the IKE negotiation process skips the verification of UDP port numbers and discovers NAT gateway devices in the VPN tunnel.

  • false: Disables the NAT traversal feature.

true

BgpConfig

string

No

This parameter is supported when you modify an IPsec-VPN connection in single-tunnel pattern.

The BGP configurations:

  • BgpConfig.EnableBgp: Specifies whether to enable the BGP feature. Valid values: true and false.

  • BgpConfig.LocalAsn: The autonomous system number (ASN) on the Alibaba Cloud side. Valid values: 1 to 4294967295.

    You can enter the ASN in a two-part format: the first 16 bits and the last 16 bits, separated by a period. Each part must be entered in decimal format.

    For example, if you enter 123.456, the ASN is calculated as follows: 123 × 65536 + 456 = 8061384.

  • BgpConfig.TunnelCidr: The CIDR block of the IPsec tunnel. The CIDR block must be a subnet with a mask length of 30 within 169.254.0.0/16, and cannot be 169.254.0.0/30, 169.254.1.0/30, 169.254.2.0/30, 169.254.3.0/30, 169.254.4.0/30, 169.254.5.0/30, 169.254.6.0/30, or 169.254.169.252/30.

    Note

    The IPsec tunnel CIDR block of each IPsec-VPN connection under the same VPN gateway instance must be unique.

  • LocalBgpIp: The BGP IP address on the Alibaba Cloud side. This IP address must be within the IPsec tunnel CIDR block.

Note
  • This parameter is required when the BGP dynamic routing feature is enabled for the VPN gateway.

  • Before adding BGP configurations, understand the working mechanism and limits of BGP dynamic routing. For more information, see Configure BGP dynamic routing.

  • Use a private ASN to establish a BGP connection with Alibaba Cloud. Refer to relevant documentation for the range of private ASNs.

{"EnableBgp":"true","LocalAsn":"65530","TunnelCidr":"169.254.11.0/30","LocalBgpIp":"169.254.11.1"}

RemoteCaCertificate

string

No

This parameter is supported when you modify an IPsec-VPN connection in single-tunnel mode.

If the current VPN gateway is an SM VPN gateway, you can modify the CA certificate of the peer.

If the current VPN gateway is a standard VPN gateway, this parameter is not supported.

-----BEGIN CERTIFICATE----- MIIB7zCCAZW**** -----END CERTIFICATE-----

TunnelOptionsSpecification

array<object>

No

The tunnel configurations.

The parameters in the TunnelOptionsSpecification array are supported only when you modify an IPsec-VPN connection in dual-tunnel mode. You can modify the configurations of both the primary and secondary tunnels of the IPsec-VPN connection at the same time.

array<object>

No

The tunnel configurations.

TunnelId

string

No

The ID of the tunnel.

tun-opsqc4d97wni27****

CustomerGatewayId

string

No

The instance ID of the customer gateway instance associated with the tunnel.

cgw-1nmwbpgrp7ssqm1yn****

Role

string

No

The role of the tunnel.

  • master: The current tunnel is the primary tunnel.

  • slave: The current tunnel is the secondary tunnel.

master

EnableDpd

boolean

No

Specifies whether to enable the dead peer detection (DPD) feature for the tunnel. Valid values:

  • true: Enables the DPD feature. The IPsec initiator sends DPD packets to check whether the peer device is alive. If no correct response is received within the specified time, the peer is considered disconnected. IPsec deletes the ISAKMP SA and the corresponding IPsec SA, and the secure tunnel is also deleted.

  • false: Disables the DPD feature. The IPsec initiator does not send DPD probe packets.

true

EnableNatTraversal

boolean

No

Specifies whether to enable the NAT traversal feature for the tunnel. Valid values:

  • true: Enables the NAT traversal feature. After this feature is enabled, the IKE negotiation process skips the verification of UDP port numbers and discovers NAT gateway devices in the VPN tunnel.

  • false: Disables the NAT traversal feature.

true

RemoteCaCertificate

string

No

If the current VPN gateway is an SM VPN gateway, you can modify the CA certificate of the peer for the tunnel.

If the current VPN gateway is a standard VPN gateway, this parameter is not supported.

-----BEGIN CERTIFICATE----- MIIB7zCCAZW**** -----END CERTIFICATE-----

TunnelBgpConfig

object

No

The BGP configurations of the tunnel.

LocalAsn

integer

No

The autonomous system number (ASN) on the Alibaba Cloud side of the tunnel. Valid values: 1 to 4294967295. Default value: 45104.

Note
  • This parameter can be configured or modified only after you enable the BGP feature for the IPsec-VPN connection (that is, set EnableTunnelsBgp to true).

  • Before adding BGP configurations, understand the working mechanism and limits of BGP dynamic routing. For more information, see Configure BGP dynamic routing.

  • Use a private ASN to establish a BGP connection with Alibaba Cloud. Refer to relevant documentation for the range of private ASNs.

65530

LocalBgpIp

string

No

The BGP IP address on the Alibaba Cloud side of the tunnel. This IP address must be within the BGP CIDR block.

169.254.10.1

TunnelCidr

string

No

The BGP CIDR block of the tunnel.

The CIDR block must be a subnet with a mask length of 30 within 169.254.0.0/16, and cannot be 169.254.0.0/30, 169.254.1.0/30, 169.254.2.0/30, 169.254.3.0/30, 169.254.4.0/30, 169.254.5.0/30, 169.254.6.0/30, or 169.254.169.252/30.

Note

The BGP CIDR block of each tunnel under the same VPN gateway instance must be unique.

169.254.10.0/30

TunnelIkeConfig

object

No

The configurations for Phase 1 negotiations.

IkeAuthAlg

string

No

The authentication algorithm used in Phase 1 negotiations.

Valid values: md5, sha1, sha256, sha384, and sha512.

md5

IkeEncAlg

string

No

The encryption algorithm used in Phase 1 negotiations.

Valid values: aes, aes192, aes256, des, and 3des.

aes

IkeLifetime

integer

No

The SA lifetime determined by Phase 1 negotiations. Unit: seconds. Valid values: 0 to 86400.

86400

IkeMode

string

No

The negotiation mode of the IKE version. Valid values:

  • main: The main mode. The negotiation process is highly secure.

  • aggressive: The aggressive mode. The negotiation process is fast and has a high success rate.

main

IkePfs

string

No

The Diffie-Hellman key exchange algorithm used in Phase 1 negotiations. Valid values: group1, group2, group5, and group14.

group2

IkeVersion

string

No

The version of the IKE protocol. Valid values: ikev1 and ikev2.

Compared with IKEv1, IKEv2 simplifies the SA negotiation process and provides better support for multi-CIDR block scenarios.

ikev1

LocalId

string

No

The identifier on the Alibaba Cloud side of the tunnel, which is used for Phase 1 negotiations. The identifier can be up to 100 characters in length and cannot contain spaces. The default value is the IP address of the tunnel.

LocalId supports the FQDN format. If you use the FQDN format, set the negotiation mode to aggressive.

47.21.XX.XX

Psk

string

No

The pre-shared key used for authentication between the tunnel and the peer.

  • The key must be 1 to 100 characters in length and can contain digits, letters, and the following special characters: ~!`@#$%^&*()_-+={}[]|;:',.<>/? It cannot contain spaces.

  • If you do not specify a pre-shared key, the system randomly generates a 16-character string as the pre-shared key. You can call the DescribeVpnConnection operation to query the automatically generated pre-shared key.

Note

The pre-shared key of the tunnel must be the same as that of the peer. Otherwise, the system cannot establish the tunnel.

123456****

RemoteId

string

No

The identifier of the peer, which is used for Phase 1 negotiations. The identifier can be up to 100 characters in length and cannot contain spaces. The default value is the IP address of the customer gateway associated with the tunnel.

RemoteId supports the FQDN format. If you use the FQDN format, set the negotiation mode to aggressive.

47.42.XX.XX

TunnelIpsecConfig

object

No

The configurations for Phase 2 negotiations.

IpsecAuthAlg

string

No

The authentication algorithm used in Phase 2 negotiations.

Valid values: md5, sha1, sha256, sha384, and sha512.

md5

IpsecEncAlg

string

No

The encryption algorithm used in Phase 2 negotiations.

Valid values: aes, aes192, aes256, des, and 3des.

aes

IpsecLifetime

integer

No

The SA lifetime determined by Phase 2 negotiations. Unit: seconds. Valid values: 0 to 86400.

86400

IpsecPfs

string

No

The Diffie-Hellman key exchange algorithm used in Phase 2 negotiations.

Valid values: disabled, group1, group2, group5, and group14.

group2

EnableTunnelsBgp

boolean

No

This parameter is supported when you modify an IPsec-VPN connection in dual-tunnel mode.

Specifies whether to enable the BGP feature for the tunnel. Valid values: true and false.

true

Response elements

Element

Type

Description

Example

object

The response.

EnableNatTraversal

boolean

Indicates whether NAT traversal is enabled for the IPsec-VPN connection. Valid values:

  • false: NAT traversal is disabled.

  • true: NAT traversal is enabled.

This parameter is returned only for IPsec-VPN connections in single-tunnel mode.

true

CreateTime

integer

The timestamp when the IPsec-VPN connection was created. Unit: milliseconds.

The timestamp is in UNIX format, which indicates the total number of milliseconds that have elapsed since 00:00:00 UTC on January 1, 1970.

1492753817000

EffectImmediately

boolean

Indicates whether the configuration of the IPsec-VPN connection takes effect immediately. Valid values:

  • true: Yes. The system immediately initiates IPsec negotiations after the configuration is completed.

  • false: No. The system initiates IPsec negotiations only when traffic enters the connection.

false

VpnGatewayId

string

The ID of the VPN gateway.

vpn-bp1q8bgx4xnkm2ogj****

LocalSubnet

string

The CIDR block on the VPC side.

10.1.1.0/24,10.1.2.0/24

RequestId

string

The request ID.

7DB79D0C-5F27-4AB5-995B-79BE55102F90

VpnConnectionId

string

The ID of the IPsec-VPN connection.

vco-bp1bbi27hojx80nck****

Description

string

The description of the IPsec-VPN connection.

description

RemoteSubnet

string

The CIDR block of the on-premises data center.

10.2.1.0/24,10.2.2.0/24

CustomerGatewayId

string

The ID of the customer gateway associated with the IPsec-VPN connection.

This parameter is returned only for IPsec-VPN connections in single-tunnel mode.

cgw-p0w2jemrcj5u61un8****

Name

string

The name of the IPsec-VPN connection.

nametest

EnableDpd

boolean

Indicates whether dead peer detection (DPD) is enabled for the IPsec-VPN connection. Valid values:

  • false: DPD is disabled.

  • true: DPD is enabled.

This parameter is returned only for IPsec-VPN connections in single-tunnel mode.

true

IkeConfig

object

The Phase 1 negotiation configuration.

The parameters in the IkeConfig array are returned only for IPsec-VPN connections in single-tunnel mode.

RemoteId

string

The identifier of the on-premises data center. Both fully qualified domain names (FQDNs) and IP addresses are supported. By default, this parameter is set to the IP address of the selected customer gateway.

139.18.XX.XX

IkeLifetime

integer

The lifetime of the IKE SA. Unit: seconds.

86400

IkeEncAlg

string

The encryption algorithm for Phase 1 negotiations.

aes

LocalId

string

The identifier of the VPC. Both FQDNs and IP addresses are supported. By default, this parameter is set to the IP address of the selected VPN gateway.

116.64.XX.XX

IkeMode

string

The IKE negotiation mode. Valid values:

  • main: Main mode. This mode provides high security during negotiations.

  • aggressive: Aggressive mode. This mode features faster negotiations and a higher success rate.

main

IkeVersion

string

The IKE version. Valid values:

  • ikev1

  • ikev2

Compared with IKEv1, IKEv2 simplifies the SA negotiation process and provides better support for multi-CIDR block scenarios.

ikev1

IkePfs

string

The Diffie-Hellman (DH) group for Phase 1 negotiations.

group2

Psk

string

The pre-shared key.

pgw6dy7d1i8i****

IkeAuthAlg

string

The authentication algorithm for Phase 1 negotiations.

sha1

IpsecConfig

object

The Phase 2 negotiation configuration.

The parameters in the IpsecConfig array are returned only for IPsec-VPN connections in single-tunnel mode.

IpsecAuthAlg

string

The authentication algorithm for Phase 2 negotiations.

sha1

IpsecLifetime

integer

The lifetime of the IPsec SA. Unit: seconds.

86400

IpsecEncAlg

string

The encryption algorithm for Phase 2 negotiations.

aes

IpsecPfs

string

The DH group for Phase 2 negotiations.

group2

VcoHealthCheck

object

The health check configuration.

The parameters in the VcoHealthCheck array are returned only for IPsec-VPN connections in single-tunnel mode.

Dip

string

The destination IP address.

192.168.1.1

Interval

integer

The retry interval for health checks. Unit: seconds.

3

Retry

integer

The number of health check retries.

3

Sip

string

The source IP address.

10.1.1.1

Enable

string

Indicates whether the health check feature is enabled for the IPsec-VPN connection. Valid values:

  • true: The health check feature is enabled.

  • false: The health check feature is disabled.

true

VpnBgpConfig

object

The BGP configuration.

The parameters in the VpnBgpConfig array are returned only for IPsec-VPN connections in single-tunnel mode.

Status

string

The BGP negotiation status. Valid values:

  • success: Normal.

  • false: Abnormal.

success

PeerBgpIp

string

The BGP IP address on the on-premises data center side.

169.254.11.2

TunnelCidr

string

The BGP CIDR block of the IPsec-VPN connection.

169.254.11.0/30

EnableBgp

string

The enabling status of BGP. Valid values:

  • true: BGP is enabled.

  • false: BGP is disabled.

true

LocalBgpIp

string

The BGP IP address on the Alibaba Cloud side.

169.254.11.1

PeerAsn

integer

The autonomous system number (ASN) of the on-premises data center.

65531

LocalAsn

integer

The autonomous system number on the Alibaba Cloud side.

65530

TunnelOptionsSpecification

object

TunnelOptions

array<object>

The tunnel configuration of the IPsec-VPN connection.

The parameters in the TunnelOptionsSpecification array are returned only for IPsec-VPN connections in dual-tunnel mode.

array<object>

The tunnel configuration.

CustomerGatewayId

string

The ID of the customer gateway associated with the tunnel.

cgw-p0wy363lucf1uyae8****

EnableDpd

boolean

Indicates whether DPD is enabled for the tunnel. Valid values:

  • false: DPD is disabled.

  • true: DPD is enabled.

true

EnableNatTraversal

boolean

Indicates whether NAT traversal is enabled for the tunnel. Valid values:

  • false: NAT traversal is disabled.

  • true: NAT traversal is enabled.

true

InternetIp

string

The IP address of the gateway on the Alibaba Cloud side of the tunnel.

47.21.XX.XX

RemoteCaCertificate

string

The CA certificate of the peer end of the tunnel.

This parameter is returned only when the VPN gateway is of the SM type.

-----BEGIN CERTIFICATE----- MIIB7zCCAZW**** -----END CERTIFICATE-----

Role

string

The role of the tunnel.

  • master: The current tunnel is the primary tunnel.

  • slave: The current tunnel is the secondary tunnel.

master

State

string

The status of the tunnel. Valid values:

  • active: The tunnel is working properly.

  • updating: The tunnel is being updated.

  • deleting: The tunnel is being deleted.

active

TunnelBgpConfig

object

The BGP configuration of the tunnel.

LocalAsn

integer

The autonomous system number of the local end (Alibaba Cloud side) of the tunnel.

65530

LocalBgpIp

string

The BGP IP address of the local end (Alibaba Cloud side) of the tunnel.

169.254.10.1

PeerAsn

integer

The autonomous system number of the peer end of the tunnel.

65531

PeerBgpIp

string

The BGP IP address of the peer end of the tunnel.

169.254.10.2

TunnelCidr

string

The BGP CIDR block of the tunnel.

169.254.10.0/30

TunnelId

string

The ID of the tunnel.

tun-opsqc4d97wni27****

TunnelIkeConfig

object

The Phase 1 negotiation configuration.

IkeAuthAlg

string

The authentication algorithm for Phase 1 negotiations.

sha1

IkeEncAlg

string

The encryption algorithm for Phase 1 negotiations.

aes

IkeLifetime

integer

The lifetime of the IKE SA. Unit: seconds.

86400

IkeMode

string

The IKE negotiation mode. Valid values:

  • main: Main mode. This mode provides high security during negotiations.

  • aggressive: Aggressive mode. This mode features faster negotiations and a higher success rate.

main

IkePfs

string

The Diffie-Hellman (DH) group for Phase 1 negotiations.

group2

IkeVersion

string

The IKE version.

ikev1

LocalId

string

The identifier of the local end (Alibaba Cloud side) of the tunnel.

47.21.XX.XX

Psk

string

The pre-shared key.

123456****

RemoteId

string

The identifier of the peer end of the tunnel.

47.42.XX.XX

TunnelIpsecConfig

object

The Phase 2 negotiation configuration.

IpsecAuthAlg

string

The authentication algorithm for Phase 2 negotiations.

sha1

IpsecEncAlg

string

The encryption algorithm for Phase 2 negotiations.

aes

IpsecLifetime

integer

The lifetime of the IPsec SA. Unit: seconds.

86400

IpsecPfs

string

The DH group for Phase 2 negotiations.

group2

ZoneNo

string

The zone where the tunnel is deployed.

ap-southeast-5a

EnableTunnelsBgp

boolean

The enabling status of BGP for the tunnel. Valid values:

  • true: BGP is enabled.

  • false: BGP is disabled.

This parameter is returned only for IPsec-VPN connections in the dual-tunnel pattern.

true

ResourceGroupId

string

The ID of the resource group to which the IPsec-VPN connection belongs.

The IPsec-VPN connection belongs to the same resource group as its associated VPN gateway. You can call the ListResourceGroups operation to query resource group information.

rg-acfmzs372yg****

Examples

Success response

JSON format

{
  "EnableNatTraversal": true,
  "CreateTime": 1492753817000,
  "EffectImmediately": false,
  "VpnGatewayId": "vpn-bp1q8bgx4xnkm2ogj****",
  "LocalSubnet": "10.1.1.0/24,10.1.2.0/24",
  "RequestId": "7DB79D0C-5F27-4AB5-995B-79BE55102F90",
  "VpnConnectionId": "vco-bp1bbi27hojx80nck****",
  "Description": "description",
  "RemoteSubnet": "10.2.1.0/24,10.2.2.0/24",
  "CustomerGatewayId": "cgw-p0w2jemrcj5u61un8****",
  "Name": "nametest",
  "EnableDpd": true,
  "IkeConfig": {
    "RemoteId": "139.18.XX.XX",
    "IkeLifetime": 86400,
    "IkeEncAlg": "aes",
    "LocalId": "116.64.XX.XX",
    "IkeMode": "main",
    "IkeVersion": "ikev1",
    "IkePfs": "group2",
    "Psk": "pgw6dy7d1i8i****",
    "IkeAuthAlg": "sha1"
  },
  "IpsecConfig": {
    "IpsecAuthAlg": "sha1",
    "IpsecLifetime": 86400,
    "IpsecEncAlg": "aes",
    "IpsecPfs": "group2"
  },
  "VcoHealthCheck": {
    "Dip": "192.168.1.1",
    "Interval": 3,
    "Retry": 3,
    "Sip": "10.1.1.1",
    "Enable": "true"
  },
  "VpnBgpConfig": {
    "Status": "success",
    "PeerBgpIp": "169.254.11.2",
    "TunnelCidr": "169.254.11.0/30",
    "EnableBgp": "true",
    "LocalBgpIp": "169.254.11.1",
    "PeerAsn": 65531,
    "LocalAsn": 65530
  },
  "TunnelOptionsSpecification": {
    "TunnelOptions": [
      {
        "CustomerGatewayId": "cgw-p0wy363lucf1uyae8****",
        "EnableDpd": true,
        "EnableNatTraversal": true,
        "InternetIp": "47.21.XX.XX",
        "RemoteCaCertificate": "-----BEGIN CERTIFICATE----- MIIB7zCCAZW**** -----END CERTIFICATE-----",
        "Role": "master",
        "State": "active",
        "TunnelBgpConfig": {
          "LocalAsn": 65530,
          "LocalBgpIp": "169.254.10.1",
          "PeerAsn": 65531,
          "PeerBgpIp": "169.254.10.2",
          "TunnelCidr": "169.254.10.0/30"
        },
        "TunnelId": "tun-opsqc4d97wni27****",
        "TunnelIkeConfig": {
          "IkeAuthAlg": "sha1",
          "IkeEncAlg": "aes",
          "IkeLifetime": 86400,
          "IkeMode": "main",
          "IkePfs": "group2",
          "IkeVersion": "ikev1",
          "LocalId": "47.21.XX.XX",
          "Psk": "123456****",
          "RemoteId": "47.42.XX.XX"
        },
        "TunnelIpsecConfig": {
          "IpsecAuthAlg": "sha1",
          "IpsecEncAlg": "aes",
          "IpsecLifetime": 86400,
          "IpsecPfs": "group2"
        },
        "ZoneNo": "ap-southeast-5a"
      }
    ]
  },
  "EnableTunnelsBgp": true,
  "ResourceGroupId": "rg-acfmzs372yg****"
}

Error codes

HTTP status code

Error code

Error message

Description

400 VpnGateway.Configuring The specified service is configuring.
400 VpnGateway.FinancialLocked The specified service is financial locked.
400 InvalidName The name is not valid
400 VpnRouteEntry.AlreadyExists The specified route entry is already exist. The route already exists.
400 VpnRouteEntry.Conflict The specified route entry has conflict. Route conflicts exist.
400 NotSupportVpnConnectionParameter.IpsecPfs The specified vpn connection ipsec Ipsec Pfs is not support. The PFS parameter set for the IPsec-VPN connection is not supported.
400 NotSupportVpnConnectionParameter.IpsecAuthAlg The specified vpn connection ipsec Auth Alg is not support. The authentication algorithm specified for the IPsec-VPN connection is not supported.
400 VpnRouteEntry.ConflictSSL The specified route entry has conflict with SSL client. The route conflicts with the SSL client.
400 VpnRouteEntry.BackupRoute Validate backup route entry failed. Active/standby routes failed authentication.
400 VpnRouteEntry.InvalidWeight Invalid route entry weight value. The weight specified for the route is invalid.
400 QuotaExceeded.PBR The policy-based routes has reached the upper limit. The number of policy-based routes has reached the upper limit.
400 OperationUnsupported.SetDPD Current version of the VPN does not support setting DPD. The VPN gateway version does not support DPD.
400 OperationUnsupported.SetNatTraversal Current version of the VPN does not support setting NAT traversal. The VPN gateway version does not support NAT traversal.
400 QuotaExceeded.PolicyBasedRoute The maximum number of policy-based routes is exceeded. Existing routes: %s. Routes to be created: %s. Maximum routes: %s. The quota of policy-based routes is reached. Existing routes: %s. Routes to be created: %s. Quota: %s.
400 MissingParameter.TunnelCidr The parameter TunnelCidr is mandatory when BGP is enabled. You must specify the tunnel CIDR block when you enable BGP.
400 OperationUnsupported.EnableBgp Current version of the VPN does not support enable BGP. The current version of the VPN gateway does not support BGP.
400 MissingParam.CustomerGatewayAsn Asn of customer gateway is mandatory when BGP is enabled. The ASN of the customer gateway cannot be empty when you enable BGP.
400 IllegalParam.LocalAsn The specified LocalAsn is invalid. The local ASN is invalid.
400 IllegalParam.BgpConfig The specified BgpConfig is invalid. The BGP configuration is invalid.
400 IllegalParam.EnableBgp VPN connection must enable BGP when VPN gateway has enabled BGP. The error message returned because the VPN connection must use BGP if BGP is enabled for the VPN gateway.
400 IllegalParam.TunnelCidr The specified TunnelCidr is invalid. The TunnelCidr parameter is set to an invalid value.
400 InvalidLocalBgpIp.Malformed The specified LocalBgpIp is malformed. The local BGP IP address is in an abnormal state.
400 IllegalParam.LocalBgpIp The specified LocalBgpIp is invalid. The local BGP IP address is invalid.
400 IllegalParam.LocalSubnet The specified "LocalSubnet" (%s) is invalid. The specified "LocalSubnet" (%s) is invalid.
400 IllegalParam.RemoteSubnet The specified "RemoteSubnet" (%s) is invalid. The specified "RemoteSubnet" (%s) is invalid.
400 OperationFailed.CenLevelNotSupport When the VPC to which the VPN gateway belongs is attached to a FULL-mode CEN, the VPN gateway cannot enable BGP. When the VPC to which the VPN gateway belongs is attached to a FULL-mode CEN, the VPN gateway cannot enable BGP.
400 InvalidTunnelCidr.Malformed The specified TunnelCidr is malformed. The specified tunnel CIDR block is invalid.
400 CustomerGateway.ConflictRouteEntry The specified customer gateway has conflict with route entry. The customer gateway conflicts with the current routes.
400 VpnTask.CONFLICT Vpn task has conflict. The VPN operation conflicts. Try again later.
400 OperationFailed.RouteConflictWithIPsecServer Operation failed because the route to create conflicts with the client IP pool of the IPsec server. Operation failed because the route to create conflicts with the client IP pool of the IPsec server.
400 IllegalParam.TunnelId The specified TunnelId is invalid. TunnelId is set to an invalid value.
400 IllegalParam.Role The specified Role is invalid. Role is set to an invalid value.
400 VpnConnectionParamInvalid.SameVpnAndCgwDifferentIkeConfigs IPSec connections associated with the same user gateway and VPN gateway should have the same pre-shared key and IKE configuration. The pre-shared key and IKE parameters must be the same for IPsec-VPN connections that are associated with the same VPN gateway and customer gateway.
400 VpnConnectionParamInvalid.SameVpnAndCgwTrafficSelectorOverlap Traffic selectors of IPSec connections associated with the same user gateway and VPN gateway should not overlap. The protected data flows of IPsec-VPN connections that are associated with the same VPN gateway and customer gateway cannot overlap.
400 ModifyIkeV1WithMultiRoutes.Invalid Failed to modify VPN connection parameters. Multi-network is configured while using IkeV1 protocol. Failed to modify VPN connection parameters. Multi-network is configured while using IkeV1 protocol.
400 Vco.StatusNotSupport The current VPN connection state does not support this operation. The operation cannot be performed when the VPN connection is in the current state.
400 IkeVersionInvalid.GcmIncompatible Ikev1 does not support IkeEncAlg of gcm16. Ikev1 does not support IkeEncAlg of gcm16.
400 EncAlgInvalid.DesIncompatible Des/3des in IkeEncAlg and IpsecEncAlg does not support multi algorithm. Des/3des in IkeEncAlg and IpsecEncAlg does not support multi algorithm.
400 CustomerGateway.ConflictVpnIp The specified customer gateway has conflict with vpn gateway ip. The specified customer gateway has conflict with vpn gateway ip.
400 CustomerGateway.AsnNotConfigured ASN of CustomerGateway is required when enabling BGP on an IPSec connection. When BGP is enabled for IPSec connection, ASN needs to be configured on the customer gateway.
500 OperationFailed.RouteConflictWithIPsecServer Operation failed because the specified route conflicts with IPsec server. The route conflicts with the IPsec server.
403 Forbbiden.SubUser User not authorized to operate on the specified resource as your account is created by another user.
403 Forbidden User not authorized to operate on the specified resource. You do not have the permissions to manage the specified resource. Apply for the permissions and try again.
404 InvalidVpnConnectionInstanceId.NotFound The specified vpn connection instance id does not exist. The specified vpn connection instance id does not exist.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.