Modifies the configuration of an IPsec-VPN connection.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | ModifyVpnConnectionAttribute |
The operation that you want to perform. Set the value to ModifyVpnConnectionAttribute. |
RegionId | String | Yes | cn-shanghai |
The ID of the region where the IPsec-VPN connection is established. You can call the DescribeRegions operation to query the most recent region list. |
ClientToken | String | No | 02fb3da4-130e-11e9-8e44-0016e04115b |
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 make sure that the value is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. |
VpnConnectionId | String | Yes | vco-bp1bbi27hojx80nck**** |
The ID of the IPsec-VPN connection. |
Name | String | No | IPsec |
The name of the IPsec-VPN connection. The name must be 2 to 128 characters in length and can contain digits, periods (.),
underscores (_), and hyphens (-). The name must start with a letter but cannot start
with |
LocalSubnet | String | No | 10.1.1.0/24,10.1.2.0/24 |
The CIDR block of the virtual private cloud (VPC) to be connected to the data center. This CIDR block is used in Phase 2 negotiations. Separate CIDR blocks with commas (,). Example: 192.168.1.0/24,192.168.2.0/24. |
RemoteSubnet | String | No | 10.2.1.0/24,10.2.2.0/24 |
The CIDR block of the data center. This CIDR block is used in Phase 2 negotiations. Separate CIDR blocks with commas (,). Example: 192.168.3.0/24,192.168.4.0/24. |
EffectImmediately | Boolean | No | false |
Specifies whether to delete the current IPsec tunnel and initiate negotiations again. Valid values:
|
IkeConfig | String | No | {"IkeVersion":"ikev1","IkeMode":"main","IkeEncAlg":"aes","IkeAuthAlg":"sha1","IkePfs":"group2","IkeLifetime":86400} |
The configuration of Phase 1 negotiations:
|
IpsecConfig | String | No | {"IpsecEncAlg":"aes","IpsecAuthAlg":"sha1","IpsecPfs":"group2","IpsecLifetime":86400} |
The configuration of Phase 2 negotiations:
|
HealthCheckConfig | String | No | {"enable":"true","dip":"192.168.XX.XX","sip":"192.168.XX.XX","interval":"3","retry":"3"} |
The health check configuration:
|
AutoConfigRoute | Boolean | No | true |
Specifies whether to automatically advertise routes. Valid values:
|
EnableDpd | Boolean | No | true |
Specifies whether to enable the dead peer detection (DPD) feature. Valid values:
|
EnableNatTraversal | Boolean | No | true |
Specifies whether to enable NAT traversal. Valid values:
|
BgpConfig | String | No | {"EnableBgp":"true","LocalAsn":"45104","TunnelCidr":"169.254.11.0/30","LocalBgpIp":"169.254.11.1"} |
The Border Gateway Protocol (BGP) configuration:
Note
|
RemoteCaCertificate | String | No | c20ycDI1NnYxIENBIChURVNUIFN**** |
The certificate authority (CA) certificate of the peer when a ShangMi (SM) VPN gateway is used to create the IPsec-VPN connection.
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
EnableNatTraversal | Boolean | true |
Indicates whether NAT traversal is enabled. Valid values:
|
CreateTime | Long | 1492753817000 |
The timestamp generated when the IPsec-VPN connection was created. |
EffectImmediately | Boolean | false |
Indicates whether the IPsec-VPN connection immediately takes effect. Valid values:
|
VpnGatewayId | String | vpn-bp1q8bgx4xnkm2ogj**** |
The ID of the VPN gateway. |
LocalSubnet | String | 10.1.1.0/24,10.1.2.0/24 |
The CIDR block of the VPC. |
RequestId | String | 7DB79D0C-5F27-4AB5-995B-79BE55102F90 |
The ID of the request. |
VpnConnectionId | String | vco-bp1bbi27hojx80nck**** |
The ID of the IPsec-VPN connection. |
Description | String | description |
The description of the IPsec-VPN connection. |
RemoteSubnet | String | 10.2.1.0/24,10.2.2.0/24 |
The CIDR block of the data center. |
CustomerGatewayId | String | vpn-bp1q8bgx4xnkm2ogj**** |
The ID of the customer gateway. |
Name | String | test |
The name of the IPsec-VPN connection. |
EnableDpd | Boolean | true |
Indicates whether DPD is enabled. Valid values:
|
IkeConfig | Object |
The configuration of Phase 1 negotiations. |
|
RemoteId | String | 139.18.XX.XX |
The peer ID. The default value is the IP address of the customer gateway. The ID is a fully qualified domain name (FQDN) or an IP address. |
IkeLifetime | Long | 86400 |
The IKE lifetime. Unit: seconds. |
IkeEncAlg | String | aes |
The IKE encryption algorithm. |
LocalId | String | 116.64.XX.XX |
The local ID. The default value is the IP address of the VPN gateway. The ID is an FQDN or an IP address. |
IkeMode | String | main |
The IKE mode. |
IkeVersion | String | ikev1 |
The IKE version. |
IkePfs | String | group2 |
The DH group. |
Psk | String | pgw6dy7d1i8i**** |
The pre-shared key. |
IkeAuthAlg | String | sha1 |
The IKE authentication algorithm. |
IpsecConfig | Object |
The configuration of Phase 2 negotiations. |
|
IpsecAuthAlg | String | sha1 |
The IPsec authentication algorithm. |
IpsecLifetime | Long | 86400 |
The IPsec lifetime. Unit: seconds. |
IpsecEncAlg | String | aes |
The IPsec encryption algorithm. |
IpsecPfs | String | group2 |
The DH group. |
VcoHealthCheck | Object |
The health check configurations. |
|
Dip | String | 1.2.XX.XX |
The destination IP address. |
Interval | Integer | 3 |
The interval between two consecutive health checks. Unit: seconds. |
Retry | Integer | 1 |
The maximum number of health check retries. |
Sip | String | 2.1.XX.XX |
The source IP address. |
Enable | String | true |
Indicates whether the health check feature is enabled. Valid values:
|
VpnBgpConfig | Object |
The BGP configuration. |
|
Status | String | success |
The negotiation status of BGP. Valid values:
|
PeerBgpIp | String | 169.23.XX.XX |
The BGP IP address of the data center. |
TunnelCidr | String | 169.254.11.0/30 |
The CIDR block of the IPsec tunnel. |
EnableBgp | String | true |
Indicates whether BGP is enabled. Valid values:
|
LocalBgpIp | String | 169.35.XX.XX |
The BGP IP address of Alibaba Cloud. |
PeerAsn | Integer | 65531 |
The ASN of the data center. |
LocalAsn | Integer | 45104 |
The ASN of Alibaba Cloud. |
Examples
Sample requests
https://vpc.aliyuncs.com/?Action=ModifyVpnConnectionAttribute
&RegionId=cn-shanghai
&VpnConnectionId=vco-bp1bbi27hojx80nck****
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<ModifyVpnConnectionAttributeResponse>
<EnableNatTraversal>true</EnableNatTraversal>
<CreateTime>1492753817000</CreateTime>
<EffectImmediately>false</EffectImmediately>
<VpnGatewayId>vpn-bp1q8bgx4xnkm2ogj****</VpnGatewayId>
<LocalSubnet>10.1.1.0/24,10.1.2.0/24</LocalSubnet>
<RequestId>7DB79D0C-5F27-4AB5-995B-79BE55102F90</RequestId>
<VpnConnectionId>vco-bp1bbi27hojx80nck****</VpnConnectionId>
<Description>description</Description>
<RemoteSubnet>10.2.1.0/24,10.2.2.0/24</RemoteSubnet>
<CustomerGatewayId>vpn-bp1q8bgx4xnkm2ogj****</CustomerGatewayId>
<Name>test</Name>
<EnableDpd>true</EnableDpd>
<IkeConfig>
<RemoteId>139.18.XX.XX</RemoteId>
<IkeLifetime>86400</IkeLifetime>
<IkeEncAlg>aes</IkeEncAlg>
<LocalId>116.64.XX.XX</LocalId>
<IkeMode>main</IkeMode>
<IkeVersion>ikev1</IkeVersion>
<IkePfs>group2</IkePfs>
<Psk>pgw6dy7d1i8i****</Psk>
<IkeAuthAlg>sha1</IkeAuthAlg>
</IkeConfig>
<IpsecConfig>
<IpsecAuthAlg>sha1</IpsecAuthAlg>
<IpsecLifetime>86400</IpsecLifetime>
<IpsecEncAlg>aes</IpsecEncAlg>
<IpsecPfs>group2</IpsecPfs>
</IpsecConfig>
<VcoHealthCheck>
<Dip>1.2.XX.XX</Dip>
<Interval>3</Interval>
<Retry>1</Retry>
<Sip>2.1.XX.XX</Sip>
<Enable>true</Enable>
</VcoHealthCheck>
<VpnBgpConfig>
<Status>success</Status>
<PeerBgpIp>169.23.XX.XX</PeerBgpIp>
<TunnelCidr>169.254.11.0/30</TunnelCidr>
<EnableBgp>true</EnableBgp>
<LocalBgpIp>169.35.XX.XX</LocalBgpIp>
<PeerAsn>65531</PeerAsn>
<LocalAsn>45104</LocalAsn>
</VpnBgpConfig>
</ModifyVpnConnectionAttributeResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"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" : "vpn-bp1q8bgx4xnkm2ogj****",
"Name" : "test",
"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" : "1.2.XX.XX",
"Interval" : 3,
"Retry" : 1,
"Sip" : "2.1.XX.XX",
"Enable" : "true"
},
"VpnBgpConfig" : {
"Status" : "success",
"PeerBgpIp" : "169.23.XX.XX",
"TunnelCidr" : "169.254.11.0/30",
"EnableBgp" : "true",
"LocalBgpIp" : "169.35.XX.XX",
"PeerAsn" : 65531,
"LocalAsn" : 45104
}
}
Error codes
HttpCode | Error code | Error message | Description |
---|---|---|---|
400 | VpnGateway.Configuring | The specified service is configuring. | The error message returned because the operation is not allowed when the specified service is being configured. Try again later. |
400 | VpnGateway.FinancialLocked | The specified service is financial locked. | The error message returned because the service is suspended due to overdue payments. Top up your account before you enable the service. |
400 | InvalidName | The name is not valid | The error message returned because the format of the name is invalid. |
400 | VpnRouteEntry.Conflict | The specified route entry has conflict. | The error message returned the specified route conflicts with an existing route. |
400 | QuotaExceeded.PolicyBasedRoute | The maximum number of policy-based routes is exceeded. Existing routes: %s. Routes to be created: %s. Maximum routes: %s. | The error message returned because the number of policy-based routes reaches the upper limit. The maximum number of routes that you can create is %s. The number of existing routes is %s. You are creating %s routes. |
400 | IllegalParam.LocalSubnet | The specified "LocalSubnet" (%s) is invalid. | The error message returned because LocalSubnet is set to an invalid value. |
400 | IllegalParam.RemoteSubnet | The specified "RemoteSubnet" (%s) is invalid. | The error message returned because RemoteSubnet is set to an invalid value. |
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. | The error message returned because you cannot enable BGP for a VPN gateway when the Cloud Enterprise Network (CEN) instance to which the VPC of the VPN gateway is attached has the FULL mode enabled. |
403 | Forbbiden.SubUser | User not authorized to operate on the specified resource as your account is created by another user. | The error message returned because you are unauthorized to perform this operation on the specified resource. Acquire the required permissions and try again. |
403 | Forbidden | User not authorized to operate on the specified resource. | The error message returned because you are unauthorized to perform the operation on the specified resource. Acquire the required permissions and try again. |
404 | InvalidVpnConnectionInstanceId.NotFound | The specified vpn connection instance id does not exist. | The error message returned because the specified IPsec-VPN connection does not exist. Check whether the ID of the IPsec-VPN connection is valid. |
For a list of error codes, visit the Error Center.