Modifies the configurations of an IPsec server.
Description
- If you modify only the IpsecServerName parameter, this operation is synchronous. If you modify parameters other than IpsecServerName, this operation is asynchronous.
- When the UpdateIpsecServer operation is asynchronous, the system returns a request ID after you send the request.
However, the operation is still being performed in the system background. You can
call DescribeVpnGateway to query the status of a VPN gateway.
- If the VPN gateway is in the updating state, the configuration of the IPsec server is being modified.
- If the VPN gateway is in the active state, the configuration of the IPsec server is modified.
- You cannot repeatedly call UpdateIpsecServer to modify the configuration of an IPsec server of the same VPN gateway within the specified period of time.
Debugging
OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | UpdateIpsecServer |
The operation that you want to perform. Set the value to UpdateIpsecServer. |
RegionId | String | Yes | cn-shanghai |
The ID of the region where the IPsec server is created. You can call the DescribeRegions operation to query the most recent region list. |
IpsecServerId | String | Yes | iss-bp1bo3xuvcxo7ixll**** |
The ID of the IPsec server. |
LocalSubnet | String | No | 192.168.0.0/24,172.17.0.0/16 |
The local CIDR blocks, which refer to the CIDR blocks on the virtual private cloud (VPC) side. Separate multiple CIDR blocks with commas (,). Example: 192.168.1.0/24,192.168.2.0/24. |
ClientIpPool | String | No | 10.0.0.0/24 |
The client CIDR block. It refers to the CIDR block that is used to allocate an IP address to the client. Note The client CIDR block must not overlap with the CIDR block of the virtual private
cloud (VPC).
|
IpsecServerName | String | No | test |
The name of the IPsec server. The name must be 1 to 100 characters in length, and cannot start with |
EffectImmediately | Boolean | No | false |
Specifies whether to delete the current IPsec tunnel and reinitiate negotiations. Valid values:
|
IkeConfig | String | No | {"IkeVersion":"ikev2","IkeMode":"main","IkeEncAlg":"aes","IkeAuthAlg":"sha1","IkePfs":"group2","IkeLifetime":86400} |
The configuration of Phase 1 negotiations. Valid values:
|
IpsecConfig | String | No | {"IpsecEncAlg":"aes","IpsecAuthAlg":"sha1","IpsecPfs":"group2","IpsecLifetime":86400} |
The configuration of Phase 2 negotiations. Valid values:
|
PskEnabled | Boolean | No | true |
Specifies whether to enable pre-shared key authentication. If you set the value to true, pre-shared key authentication is enabled. |
Psk | String | No | Cfd123**** |
The pre-shared key. Enter the pre-shared key that is used for identity authentication between the IPsec server and the client. The key must be 1 to 100 characters in length. 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 ListIpsecServers operation to query the pre-shared keys that are generated by the system. Note The pre-shared key of the IPsec server must be the same as the authentication key
of the client. Otherwise, a connection cannot be established between the IPsec server
and the client.
|
ClientToken | String | No | e4567-e89b-12d3-a456-42665544**** |
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 it is unique among different requests. ClientToken can contain only ASCII characters. Note If you do not set this parameter, ClientToken is set to the value of RequestId. The value of RequestId may be different for each API request.
|
DryRun | String | No | false |
Specifies whether to precheck the request without performing the operation. Valid values:
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | B61C08E5-403A-46A2-96C1-F7B1216DB10C |
The ID of the request. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=UpdateIpsecServer
&RegionId=cn-shanghai
&IpsecServerId=iss-bp1bo3xuvcxo7ixll****
&LocalSubnet=192.168.0.0/24,172.17.0.0/16
&ClientIpPool=10.0.0.0/24
&IpsecServerName=test
&EffectImmediately=false
&IkeConfig={"IkeVersion":"ikev2","IkeMode":"main","IkeEncAlg":"aes","IkeAuthAlg":"sha1","IkePfs":"group2","IkeLifetime":86400}
&IpsecConfig={"IpsecEncAlg":"aes","IpsecAuthAlg":"sha1","IpsecPfs":"group2","IpsecLifetime":86400}
&PskEnabled=true
&Psk=Cfd123****
&ClientToken=e4567-e89b-12d3-a456-42665544****
&DryRun=false
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
</UpdateIpsecServerResponse>
<RequestId>B61C08E5-403A-46A2-96C1-F7B1216DB10C</RequestId>
</UpdateIpsecServerResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "B61C08E5-403A-46A2-96C1-F7B1216DB10C"
}
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 balance first. |
400 | OperationUnsupported.IpsecPfs | The specified IPsec Pfs is unsupported. | The error message returned because the specified authentication algorithm is not supported. |
400 | IllegalParam.AuthMethod | One authentication method (Psk or IDaaS) should be specified at least. | The error message returned because at least one authentication algorithm, Psk or IDaas, must be specified. |
400 | IllegalParam.LocalSubnet | The specified "LocalSubnet" (%s) is invalid. | The error message returned because LocalSubnet is set to an invalid value: %s. |
400 | MissingParam.IDaaSInstanceId | The input parameter IDaaSInstanceId is mandatory when enable multi-factor authentication. | The error message returned because the IDaaS instance ID is required when two-factor authentication is enabled. |
400 | OperationFailed.NoRamPermission | Vpn Service has no permission to operate your IDaaS instances. | The error message returned because the VPN service does not have permissions to manage your IDaaS instance. |
400 | ClientIpPool.NetmaskInvalid | The netmask length of client IP pool must be greater than or equal to 16 and less than or equal to 29. | The error message returned because the mask length of the client CIDR block must be from 16 to 29. |
400 | VpnRouteEntry.Conflict | The specified client IP pool conflicts with VPN connection or SSL server. | The error message returned because the specified client CIDR block conflicts with that of the IPsec-VPN connection or SSL server. |
400 | ClientIpPool.SubnetInvalid | The specified client IP pool cannot be used. | The error message returned because the client CIDR block is unavailable. |
400 | InvalidClientIpPool.Conflict | The specified client IP pool conflicts with other resources in the same VPC. | The error message returned because the client CIDR block conflicts with resources in the VPC. |
400 | SystemBusy | The system is busy. Please try again later. | The error message returned because the system is unavailable. Try again later. |
403 | Forbidden | User not authorized to operate on the specified resource. | The error message returned because you are unauthorized to perform this operation on the specified resource. Acquire the required permissions and try again. |
404 | InvalidIDaaSInstanceId.NotFound | The specified IDaaS instance ID does not exist. | The error message returned because the specified IDaaS instance ID does not exist. |
409 | OperationConflict | The operation against this instance is too frequent, please try again later. | The error message returned because the specified operation is performed frequently on the instance. Try again later. |
For a list of error codes, see Service error codes.