You need to enable JavaScript to run this app.
文档中心
VPN连接

VPN连接

复制全文
下载 pdf
用户网关
CreateCustomerGateway-创建用户网关
复制全文
下载 pdf
CreateCustomerGateway-创建用户网关
调用CreateCustomerGateway创建一个用户网关。​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
下方仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。​
Action String 必选 示例值:CreateCustomerGateway​
要执行的操作,取值:CreateCustomerGateway。​
​
Version String 必选 示例值:2020-04-01​
API版本信息。​
​
CustomerGatewayName String 可选 示例值:CGW-t26c​
用户网关的名称。​
  • 以中文、字母、数字开头,只能包含中文、字母、数字、点号(.)、下划线(_)和短划线(-)。​
  • 长度限制为1 ~ 128个字符。​
  • 不填默认为用户网关的ID。​
​
IpAddress String 必选 示例值:8.XX.XX.8​
对端本地数据中心网关的静态公网IP地址或其他VPC的VPN网关出口IP地址。若对端为非固定静态公网IP,此处需传入0.0.0.0。​
​
Description String 可选 示例值:This is a sample description​
用户网关的描述信息。​
  • 以中文、字母、数字开头,只能包含中文、字母、数字、点号(.)、空格( )、下划线(_)、中划线(-)、等号(=)、英文逗号(,)、中文逗号(,)、中文句号(。)。​
  • 长度限制为0 ~ 255个字符。​
  • 不填默认为空字符串。​
​
ClientToken String 可选 示例值:123e4567-e89b-12d3-a456-42665544****​
客户端Token,用于保证请求幂等性。​
  • 由客户端自动生成一个参数值,确保不同请求间该参数值唯一,避免当调用API超时或服务器内部错误时,客户端多次重试导致重复性操作。​
  • 仅支持ASCII字符,且不能超过64个字符。​
  • 若不传入ClientToken,则此次API调用不进行幂等校验。​
​
ProjectName String 可选 示例值:Project_1​
用户网关所属的项目。不填默认为default,即创建的资源属于default项目。您可调用ListProjects查询当前账号下项目的信息。​
​
Asn Integer 可选 示例值:65000​
用户网关的ASN(Autonomous System Number)。​
  • 如需使用BGP功能,则此参数必须填写。​
  • ASN有效范围1~4294967295(137718 、150436、65533除外)。​
  • 137718和150436均为火山引擎的ASN,65533为特殊ASN,均不可使用。​
​
Tags.N.Key String 可选 示例值:key1​
用户网关标签的标签键(Key)。​
  • 参数 - N :表示标签键的序号,取值范围:1~20。​
  • 多个标签键之间用&分隔。 命名规则如下:​
  • 不能以volc:或sys:的任意大小写组合开头。​
  • 只能包含语言字符、数字、空格和英文符号“_”、“.”、“:”、“/”、“=”、“+”、“-”、“@”。​
  • 长度限制在1~128个字符之间。​
说明​
同一资源的标签键不允许重复。​
​
Tags.N.Value String 可选 示例值:value1​
用户网关标签的标签值(Value)。​
  • 参数 - N:表示标签值的序号,取值范围:1~20。​
  • 多个标签值之间用&分隔。 命名规则如下:​
  • 只能包含语言字符、数字、空格和英文符号“_”、“.”、“:”、“/”、“=”、“+”、“-”、“@”。​
  • 允许为空,长度限制在0~256个字符之间。​
  • 大小写敏感,不能以空格开头或结尾。​
说明​
传入Tags.N.Value则必须传入Tags.N.Key。​
​
IpVersion String 可选 示例值:ipv4​
用户网关的IP地址类型。取值如下:​
  • ipv4:IPv4地址类型。​
  • ipv6:IPv6地址类型。​
当DualTunnelEnabled传入false时,仅支持传入ipv4。​
​
​
​
返回参数​
下方仅列出本接口特有的返回参数。更多信息请参见返回结构。​
RequestId String 示例值:2022032111142501022524314704AF****​
请求ID。​
​
CustomerGatewayId String 示例值:cgw-3tex2x1cwd4c6c0v****​
新创建用户网关的ID。​
​
​
​
请求示例​
​
GET /?Action=CreateCustomerGateway&Version=2020-04-01&CustomerGatewayName=test&Description=test&IpAddress=1.1.1.1 HTTP/1.1​
Host: vpn.cn-beijing.volcengineapi.com​
X-Date: 20251029T033538Z​
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20251029/cn-beijing/vpn/request, SignedHeaders=host;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f​
​
返回示例​
​
{​
"ResponseMetadata": {​
"RequestId": "2022032111142501022524314704AF****",​
"Action": "CreateCustomerGateway",​
"Version": "2020-04-01",​
"Service": "vpn",​
"Region": "cn-beijing"​
},​
"Result": {​
"RequestId": "2022032111142501022524314704AF****",​
"CustomerGatewayId": "cgw-2d670j2o9lc0058ozfddg****"​
}​
}​
​
错误码​
下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。​
​
状态码​
错误码​
错误信息​
说明​
400​
InvalidName.Malformed​
The specified name is malformed.Ensure the maximum length of name is 128.​
指定的名称格式不合法。名称长度不能超过128个字符。​
400​
InvalidName.Malformed​
The specified name is malformed.​
指定的名称格式不合法。请修复名称格式后重试。​
400​
InvalidDescription.Malformed​
The specified description is malformed.Ensure the maximum length of description is 255.​
指定的描述格式不合法。描述长度不能超过255个字符。​
400​
InvalidDescription.Malformed​
The specified description is malformed.​
指定的描述格式不合法。请修复描述格式后重试。​
400​
InvalidCustomerGatewayIp.Malformed​
The specified customer gateway ip is malformed.​
指定的用户网关IP不合法。​
400​
QuotaExceeded.CustomerGateway​
You've reached the limit on the number of customer gateway per region that you can create.​
已达到每个地域可创建的用户网关的数量上限。​
400​
IdempotentParameterMismatch​
Arguments on this idempotent request are inconsistent with arguments used in previous request(s).​
此幂等请求的参数与前一个请求中使用的参数不一致。​
400​
InvalidParameter.ClientTokenMalformed​
The specified parameter ClientToken is malformed.​
指定的参数ClientToken格式不合法,长度不能超过64个ASCII字符。​
400​
InvalidCustomerGateway.InvalidASN​
The Customer Gateway ASN is invalid and it should be in the range of 1-4294967294, excluding 65535, 137718 and 150436.​
指定的ASN不合法,应该属于1-4294967294范围内,65535,137718和150436除外。​
400​
InvalidTag.Disorder​
The specified index order of tag is malformed.​
指定标签的索引顺序参数格式不合法。​
400​
InvalidTagKey.Malformed​
The specified parameter tag key is invalid.​
标签键不合法。​
400​
InvalidTagValue.Malformed​
The specified parameter tag value is invalid.​
标签值不合法。​
400​
LimitExceeded.Tags​
You've reached the limit on the number of tags that you can operate at one time.​
已达到单次可操作标签数量的上限。​
403​
Forbidden.VpnGatewayBgpPermissionNotGranted​
The specified account is not granted VPN gateway BGP permission.​
当前账号未开通VPN支持BGP权限。​
404​
InvalidProject.NotFound​
The specified Project does not exist.​
指定的项目不存在。​
412​
IdempotentProcessing​
The request uses the same client token as a previous one that is still in process.​
幂等请求处理中。​
​
​
最近更新时间:2026.05.22 11:16:09
这个页面对您有帮助吗?
有用
有用
无用
无用