Calls the ModifyTunnelAttribute operation to modify the tunnel configuration of a highly available VPN.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
vpc:ModifyTunnelAttribute |
update |
*VpnConnection
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ClientToken |
string |
No |
The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters. Note
If you do not specify this parameter, the system automatically uses the RequestId as the ClientToken. The RequestId may be different for each API request. |
02fb3da4-130e-11e9-8e44-0016e04115b |
| TunnelOptionsSpecification |
object |
No |
The tunnel configuration to modify. |
|
| EnableDpd |
boolean |
No |
Specifies whether to enable the Dead Peer Detection (DPD) feature. Valid values:
|
true |
| EnableNatTraversal |
boolean |
No |
Specifies whether to enable NAT traversal. Valid values:
|
true |
| RemoteCaCertificate |
string |
No |
The peer CA certificate when the IPsec-VPN connection is associated with a China Certification Authority (China CA)-compliant VPN gateway. |
-----BEGIN CERTIFICATE----- MIIB7zCCAZW**** -----END CERTIFICATE----- |
| TunnelBgpConfig |
object |
No |
The BGP configuration of the tunnel to modify. If BGP was not previously enabled for the tunnel, call the ModifyVpnConnectionAttribute operation to enable BGP and add the BGP configuration for the tunnel. |
|
| LocalAsn |
integer |
No |
The autonomous system number (ASN) of the local end of the tunnel. Valid values: 1 to 4294967295. |
65530 |
| LocalBgpIp |
string |
No |
The BGP IP address of the local end of the tunnel. This address must be an IP address within the TunnelCidr range. |
169.254.11.1 |
| TunnelCidr |
string |
No |
The CIDR block of the BGP IP address on the local end of the tunnel. The CIDR block must be a subnet within 169.254.0.0/16 with a mask length of 30 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 a VPN gateway instance must be unique. |
169.254.11.0/30 |
| TunnelIkeConfig |
object |
No |
The IKE phase (Phase 1) configuration of the tunnel to modify. |
|
| IkeAuthAlg |
string |
No |
The authentication algorithm used in Phase 1 negotiation. Valid values: md5, sha1, sha256, sha384, or sha512. |
sha1 |
| IkeEncAlg |
string |
No |
The encryption algorithm used in Phase 1 negotiation. Valid values: aes, aes192, aes256, des, or 3des. |
aes |
| IkeLifetime |
integer |
No |
The lifetime of the SA negotiated in Phase 1. Unit: seconds. Valid values: 0 to 86400. |
86400 |
| IkeMode |
string |
No |
The negotiation mode of the IKE version. Valid values:
|
main |
| IkePfs |
string |
No |
The Diffie-Hellman key exchange algorithm used in Phase 1 negotiation. Valid values: group1, group2, group5, group14. |
group2 |
| IkeVersion |
string |
No |
The version of the IKE protocol. Valid values: ikev1 or ikev2. |
ikev2 |
| LocalId |
string |
No |
The identifier of the local end of the tunnel. The value can be up to 100 characters in length and cannot contain spaces. The value supports FQDN and IP formats. The default value is the IP address of the tunnel. |
47.XX.XX.87 |
| Psk |
string |
No |
The pre-shared key used for identity authentication between the tunnel and the peer.
Note
The pre-shared keys configured on the tunnel and the peer must be the same. Otherwise, the tunnel cannot be established. |
123456**** |
| RemoteId |
string |
No |
The identifier of the peer end of the tunnel. The value can be up to 100 characters in length and cannot contain spaces. The value supports FQDN and IP formats. The default value is the IP address of the customer gateway instance associated with the tunnel. |
47.XX.XX.207 |
| TunnelIpsecConfig |
object |
No |
The IPsec phase (Phase 2) configuration of the tunnel to modify. |
|
| IpsecAuthAlg |
string |
No |
The authentication algorithm used in Phase 2 negotiation. Valid values: md5, sha1, sha256, sha384, or sha512. |
sha1 |
| IpsecEncAlg |
string |
No |
The encryption algorithm used in Phase 2 negotiation. Valid values: aes, aes192, aes256, des, or 3des. |
aes |
| IpsecLifetime |
integer |
No |
The lifetime of the SA negotiated in Phase 2. Unit: seconds. Valid values: 0 to 86400. |
86400 |
| IpsecPfs |
string |
No |
The Diffie-Hellman key exchange algorithm used in Phase 2 negotiation. Valid values: disabled, group1, group2, group5, group14. |
group2 |
| CustomerGatewayId |
string |
No |
The instance ID of the customer gateway associated with the tunnel. |
cgw-1nmwbpgrp7ssqm1yn**** |
| RegionId |
string |
No |
The region ID of the IPsec-VPN connection. You can call the DescribeRegions operation to query the region ID. |
cn-hangzhou |
| VpnConnectionId |
string |
Yes |
The ID of the IPsec-VPN connection. |
vco-gw69vm1i71y354**** |
| TunnelId |
string |
Yes |
The tunnel ID. |
tun-gbyz2e070xzo93**** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| TunnelId |
string |
The tunnel ID. |
tun-gbyz2e070xzo93**** |
| RequestId |
string |
The request ID. |
E6F36FF0-9544-3AEE-8673-A4647D50064C |
| TunnelIkeConfig |
object |
The IKE phase (Phase 1) configuration of the tunnel. |
|
| IkeAuthAlg |
string |
The IKE authentication algorithm. |
sha1 |
| IkeEncAlg |
string |
The IKE encryption algorithm. |
aes |
| IkeLifetime |
integer |
The IKE lifetime. Unit: seconds. |
86400 |
| IkeMode |
string |
The IKE negotiation mode.
|
main |
| IkePfs |
string |
The DH group. |
group2 |
| IkeVersion |
string |
The IKE protocol version.
Compared with IKEv1, IKEv2 simplifies the SA negotiation process and provides better support for multi-CIDR-block scenarios. |
ikev2 |
| LocalId |
string |
The identifier of the local end of the tunnel. The value supports FQDN and IP formats. The default value is the IP address of the tunnel. |
47.XX.XX.87 |
| Psk |
string |
The pre-shared key. |
123456**** |
| RemoteId |
string |
The identifier of the peer end of the tunnel. The value supports FQDN and IP formats. The default value is the IP address of the customer gateway instance associated with the tunnel. |
47.XX.XX.207 |
| TunnelIpsecConfig |
object |
The IPsec phase (Phase 2) configuration of the tunnel. |
|
| IpsecAuthAlg |
string |
The IPsec authentication algorithm. |
sha1 |
| IpsecEncAlg |
string |
The IPsec encryption algorithm. |
aes |
| IpsecLifetime |
integer |
The IPsec lifetime. Unit: seconds. |
86400 |
| IpsecPfs |
string |
The DH group. |
group2 |
| TunnelBgpConfig |
object |
The BGP configuration of the tunnel. |
|
| EnableBgp |
boolean |
The enabling status of BGP.
|
true |
| LocalAsn |
integer |
The autonomous system number (ASN) of the local end of the tunnel. |
65530 |
| LocalBgpIp |
string |
The BGP IP address of the local end of the tunnel. |
169.254.11.1 |
| PeerAsn |
integer |
The autonomous system number (ASN) of the peer end of the tunnel. |
65531 |
| PeerBgpIp |
string |
The BGP IP address of the peer end of the tunnel. |
169.254.11.2 |
| TunnelCidr |
string |
The CIDR block of the tunnel BGP IP address. |
169.254.11.0/30 |
| EnableNatTraversal |
boolean |
Indicates whether NAT traversal is enabled. Valid values:
|
true |
| EnableDpd |
boolean |
Indicates whether the Dead Peer Detection (DPD) feature is enabled.
|
true |
| RemoteCaCertificate |
string |
The peer CA certificate when the IPsec-VPN connection is created with a China CA-compliant VPN gateway. |
-----BEGIN CERTIFICATE----- MIIB7zCCAZW**** -----END CERTIFICATE----- |
| CustomerGatewayId |
string |
The instance ID of the customer gateway associated with the tunnel. |
cgw-p0wx48ayhrygitm80**** |
| Role |
string |
The role of the tunnel.
|
master |
| ZoneNo |
string |
The zone of the tunnel. |
cn-hangzhou-h |
| InternetIp |
string |
The IP address of the tunnel. |
47.XX.XX.87 |
| State |
string |
The status of the tunnel.
|
active |
Examples
Success response
JSON format
{
"TunnelId": "tun-gbyz2e070xzo93****",
"RequestId": "E6F36FF0-9544-3AEE-8673-A4647D50064C",
"TunnelIkeConfig": {
"IkeAuthAlg": "sha1",
"IkeEncAlg": "aes",
"IkeLifetime": 86400,
"IkeMode": "main",
"IkePfs": "group2",
"IkeVersion": "ikev2",
"LocalId": "47.XX.XX.87",
"Psk": "123456****",
"RemoteId": "47.XX.XX.207"
},
"TunnelIpsecConfig": {
"IpsecAuthAlg": "sha1",
"IpsecEncAlg": "aes",
"IpsecLifetime": 86400,
"IpsecPfs": "group2"
},
"TunnelBgpConfig": {
"EnableBgp": true,
"LocalAsn": 65530,
"LocalBgpIp": "169.254.11.1",
"PeerAsn": 65531,
"PeerBgpIp": "169.254.11.2",
"TunnelCidr": "169.254.11.0/30"
},
"EnableNatTraversal": true,
"EnableDpd": true,
"RemoteCaCertificate": "-----BEGIN CERTIFICATE----- MIIB7zCCAZW**** -----END CERTIFICATE-----",
"CustomerGatewayId": "cgw-p0wx48ayhrygitm80****",
"Role": "master",
"ZoneNo": "cn-hangzhou-h",
"InternetIp": "47.XX.XX.87",
"State": "active"
}
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 | 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 | IllegalParam.LocalAsn | The param of LocalAsn is illegal | The LocalAsn parameter is set to an invalid value. |
| 400 | IllegalParam.LocalBgpIp | The specified LocalBgpIp is invalid. | The local BGP IP address is invalid. |
| 400 | VpnGateway.task.conflict | The VPN is in the configuration state, please wait a while before operating. | The VPN is in the configuration state, please wait a while before operating. |
| 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 | 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 | IkeVersionInvalid.GcmIncompatible | Ikev1 does not support IkeEncAlg of gcm16. | Ikev1 does not support IkeEncAlg of gcm16. |
| 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. |
| 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.