Updated on 2026-10-22 GMT+08:00

Modifying a VPN Server

Function

This API is used to modify a VPN server with a specified ID.

Calling Method

For details, see Calling APIs.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

Action

Access Level

Resource Type (*: required)

Condition Key

Alias

Dependencies

vpn:p2cVpnGateway:updateServer

write

p2cVpnGateway

g:ResourceTag/<tag-key>

-

  • scm:cert:export
  • scm:cert:list
  • iam:identityProviders:getIdentityProvider
  • iam:identityProviders:listProtocols
  • iam:identityProviders:listIdentityProviders

URI

PUT /v5/{project_id}/p2c-vpn-gateways/vpn-servers/{vpn_server_id}

Table 1 Parameter description

Parameter

Type

Mandatory

Description

project_id

String

Yes

Specifies a project ID. You can obtain the project ID by referring to Obtaining the Project ID.

vpn_server_id

String

Yes

Specifies the ID of a VPN server.

Request

  • Request parameters
    Table 2 Request parameters

    Parameter

    Type

    Mandatory

    Description

    vpn_server

    UpdateServerRequest object

    Yes

    Specifies the to-be-updated VPN server object.

    Table 3 UpdateServerRequest

    Parameter

    Type

    Mandatory

    Description

    client_cidr

    String

    No

    • Specifies a client CIDR block. A virtual IP address on this CIDR block will be assigned to a client for establishing a connection.
    • The value is in the format of dotted decimal notation/mask, for example, 192.168.1.0/24.
    • Constraints:
      • The client CIDR block cannot conflict with the routes in the default route table of the VPC to which the gateway belongs.
      • The client CIDR block cannot conflict with any local CIDR block of the server.
      • The number of available IP addresses in the client CIDR block must be greater than four times the maximum number of gateway connections.
      • The client CIDR block cannot be 0.0.0.0/8, 127.0.0.0/8, 224.0.0.0/4, 240.0.0.0/4, or 169.254.0.0/16.

    local_subnets

    Array of strings

    No

    • Specifies the list of local CIDR blocks. A local CIDR block is a destination CIDR block on the cloud to be accessed by client CIDR blocks through a VPN.
    • The value is in the format of dotted decimal notation/mask, for example, 10.10.1.0/24.
    • Constraints:
      • There must be at least one local CIDR block. By default, a maximum of 20 local CIDR blocks are supported.
      • The local CIDR block cannot be 0.0.0.0/8, 127.0.0.0/8, 224.0.0.0/4, or 240.0.0.0/4.

    server_certificate

    server_certificate object

    No

    Specifies a server certificate. It is recommended to use a certificate with a strong cryptographic algorithm, such as RSA-3072 or RSA-4096.

    ssl_options

    ssl_options object

    No

    Specifies SSL options.

    client_auth_type

    String

    No

    • Specifies the client authentication mode.
    • Value range:

      CERT: certificate authentication

      LOCAL_PASSWORD: password authentication (local)

      IAM: IAM authentication

      FEDERATED: federated authentication

    dns_servers

    Array of strings

    No

    • Specifies the DNS server list. A maximum of two DNS servers are supported.
    • The value is in dotted decimal notation, for example, 172.16.1.1.

    idp_name

    String

    No

    • Specifies an identity provider name. This parameter is mandatory when the client authentication mode is federation authentication.
    • Constraints:
      • This parameter is mandatory when the client authentication mode is federation authentication.

        Do not set this parameter when the client authentication mode is not federation authentication.

    Table 4 server_certificate

    Parameter

    Type

    Mandatory

    Description

    id

    String

    Yes

    Specifies a certificate ID, which is the ID of a certificated uploaded in the CCM.

    Table 5 ssl_options

    Parameter

    Type

    Mandatory

    Description

    protocol

    String

    No

    • Specifies a protocol.
    • Value range: TCP
    • The default value is TCP.

    port

    Integer

    No

    • Specifies a port number.
    • Value range:
      • 443
      • 1194
    • The default value is 443.

    encryption_algorithm

    String

    No

    • Specifies an encryption algorithm.
    • Value range:
      • AES-128-GCM
      • AES-256-GCM
    • The default value is AES-128-GCM.
  • Example request
    PUT https://{Endpoint}/v5/{project_id}/p2c-vpn-gateways/vpn-servers/{vpn_server_id}
    
    {
      "vpn_server": {
        "client_cidr": "192.168.10.0/24",
        "local_subnets": [
          "172.16.0.0/24",
          "172.16.1.0/24"
        ],
        "server_certificate": {
          "id": "scs1717051012106"
        },
        "ssl_options": {
          "protocol": "TCP",
          "port": 443,
          "encryption_algorithm": "AES-128-GCM"
        },
        "client_auth_type": "CERT"
      }
    }

Response

  • Response parameters

    Returned status code 200: successful operation

    Table 6 Parameters in the response body

    Parameter

    Type

    Description

    request_id

    string

    Specifies a request ID.

  • Example response
    {
      "request_id": "c63d850876bcddbdfbd11776cce57914"
    }

Status Codes

For details, see Status Codes.