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

VPN连接

复制全文
下载 pdf
IPsec连接
ModifyVpnConnectionTunnelAttributes-修改双隧道VPN连接配置信息
复制全文
下载 pdf
ModifyVpnConnectionTunnelAttributes-修改双隧道VPN连接配置信息
调用ModifyVpnConnectionTunnelAttributes接口,修改双隧道IPsec连接特有的配置信息,部分与单隧道共有的参数请调用ModifyVpnConnectionAttributes接口修改,例如名称、描述等。​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
下方仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。​
Action String 必选 示例值:ModifyVpnConnectionTunnelAttributes​
要执行的操作,取值:ModifyVpnConnectionTunnelAttributes。​
​
Version String 必选 示例值:2020-04-01​
API版本信息。​
​
VpnConnectionId String 必选 示例值:vgc-3tehy13n2l4c6c0v****​
IPsec连接的ID。​
​
TunnelId String 必选 示例值:tunnel-t2eryj3hl6gc60bv****​
隧道连接的ID。​
​
CustomerGatewayId String 可选 示例值:cgw-t2eryj3hl6gc60bv****​
隧道关联的用户网关的ID。若传入的用户网关的IP地址为0.0.0.0,则NegotiateInstantly仅可传入false,IkeConfig中IkeConfig.Version仅可传入ikev1且IkeConfig.Mode仅可传入aggressive。​
创建双隧道类型的IPsec连接时,该参数必填。​
​
IkeConfig.Psk String 可选 示例值:Test123***​
预共享密钥,用于第一阶段VPN网关与用户网关之间的身份认证。长度不超过100个字符,只可输入大小写字母、特殊符号~ ` | ! @ # $ % ^ ( ) - _ + = [ ] { } \ , . / : ;以及数字。​
​
IkeConfig.Version String 可选 示例值:ikev1​
IKE密钥交换协议的版本。取值如下​
  • ikev1​
  • ikev2​
​
IkeConfig.Mode String 可选 示例值:main​
第一阶段的协商模式。仅IkeConfig.Version为ikev1时需传入本参数。取值如下:​
  • main​
  • aggressive​
​
IkeConfig.EncAlg String 可选 示例值:aes​
第一阶段协商的加密算法。取值如下:​
  • aes​
  • aes192​
  • aes256​
  • des​
  • 3des​
  • sm4​
​
IkeConfig.AuthAlg String 可选 示例值:sha1​
第一阶段的认证算法。取值如下:​
  • sha1​
  • md5​
  • sha256​
  • sha384​
  • sha512​
  • sm3​
​
IkeConfig.DhGroup String 可选 示例值:group2​
第一阶段协商使用的DH(Diffie-Hellman)密钥交换算法。取值如下:​
  • group1​
  • group2​
  • group5​
  • group14​
​
IkeConfig.Lifetime Integer 可选 示例值:86400​
第一阶段协商的SA的生存时间,超过生存时间后,将重新发起协商。​
  • 取值范围:900~86400,单位:秒。​
  • 默认:86400。​
​
IkeConfig.LocalId String 可选 示例值:​
VPN网关的标识,用于第一阶段的协商,支持IP格式和FQDN( Fully Qualified Domain Name)完全合格域名/全称域名格式。​
  • 不传默认为当前所选VPN网关的出口IP地址。​
  • 若您手动设置为FQDN格式,协商模式推荐设置为“aggressive”。​
  • 长度不超过100个字符,只可输入大小写字母、特殊符号~ ` | ! @ # $ % ^ ( ) - _ + = [ ] { } \ , . / : ;以及数字。​
​
IkeConfig.RemoteId String 可选 示例值:​
用户网关的标识,用于第一阶段的协商,支持IP格式和FQDN( Fully Qualified Domain Name)完全合格域名/全称域名格式。​
  • 不传默认为当前所选用户网关的公网IP地址。​
  • 若您手动设置为FQDN格式,协商模式推荐设置为“aggressive”。​
  • 长度不超过100个字符,只可输入大小写字母、特殊符号~ ` | ! @ # $ % ^ ( ) - _ + = [ ] { } \ , . / : ;以及数字。​
​
IpsecConfig.EncAlg String 可选 示例值:aes​
第二阶段协商的加密算法。取值如下:​
  • aes​
  • aes192​
  • aes256​
  • des​
  • 3des​
  • sm4​
​
IpsecConfig.AuthAlg String 可选 示例值:sha1​
第二阶段协商的认证算法。取值如下:​
  • sha1​
  • md5​
  • sha256​
  • sha384​
  • sha512​
  • sm3​
​
IpsecConfig.DhGroup String 可选 示例值:group2​
第二阶段使用的DH(Diffie-Hellman)密钥交换算法。取值如下:​
  • group1​
  • group2​
  • group5​
  • group14​
  • disable(不配置DH算法)​
若选择group1、group2、group5、group14,将默认开启PFS(Perfect Forward Secrecy)完美前向保密功能,对应的客户端也需要开启PFS功能。若客户端不支持PFS功能,此处需配置为“disable”。​
​
IpsecConfig.Lifetime Integer 可选 示例值:86400​
第二阶段协商的SA的生存时间,超过生存时间后,将重新发起协商。​
  • 取值范围:900~86400​
  • 单位:秒。​
  • 默认:86400。​
​
BGPConfig.TunnelCidr String 可选 示例值:169.254.XX.XX/30​
BGP 会话本端IP和对端IP所在的 CIDR 地址段。 ​
  • 该地址段需要在 169.254.0.0/16 网段内、掩码长度为 30 的网段。​
  • 如果EnableTunnelsBgp传入值为true,此参数必须填写。​
​
BGPConfig.LocalBgpIP String 可选 示例值:169.254.XX.XX​
火山引擎侧的 BGP 地址。​
  • 该地址必须为 IPsec 隧道网段内的一个 IP 地址。​
  • 如果EnableTunnelsBgp传入值为true,此参数必须填写。​
​
NatTraversal Boolean 可选 示例值:false​
是否开启NAT穿越功能。​
  • true:开启。NAT穿越(NAT Traversal)功能开启后,IKE协商时不会对UDP端口号进行验证,并且能够发现VPN连接隧道中NAT网关设备。​
  • false:不开启。​
​
DpdAction String 可选 示例值:clear​
DPD功能的状态。​
  • none:关闭DPD功能。​
  • clear:开启DPD功能,DPD超时后清除IKE SA。​
  • hold:开启DPD功能,DPD超时后保持当前状态,等待新的流量进入后重新建立连接。​
  • restart:开启DPD功能,DPD超时后立即重连。​
​
DpdMode String 可选 示例值:on_demand​
IPsec连接的DPD探测方式,取值如下:​
  • on_demand(默认):按需。​
  • periodic:周期。​
​
​
返回参数​
下方仅列出本接口特有的返回参数。更多信息请参见返回结构。​
RequestId String 示例值:0ED8D006-F706-4D23-88ED-E11ED28D****​
请求ID。​
​
​
请求示例​
​
GET /?Action=ModifyVpnConnectionTunnelAttributes&Version=2020-04-01&VpnConnectionId=vgc-2bzvqi8kerd342dx0eg2f****&TunnelId=tunnel-t2eryj3hl6gc60bv**** 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": "202203211611080102121461940900****",​
"Action": "ModifyVpnConnectionTunnelAttributes",​
"Version": "2020-04-01",​
"Service": "vpn",​
"Region": "cn-beijing"​
},​
"Result": {​
"RequestId": "202203211611080102121461940900****"​
}​
}​
​
错误码​
下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。​
​
状态码​
错误码​
错误信息​
说明​
400​
DryRunOperation​
Exception raised to indicate a successfully authorized action when the DryRun flag is set to true.​
该请求设置为DryRun操作,操作授权已获得许可,但未被实际执行。​
400​
IncorrectVpnConnectionStatus​
The operation is not supported by the current vpn connection.​
当前操作不支持,请稍后重试。​
400​
InvalidCustomerGateWay.SameVpcWithVpnGateway​
The specified customer gateway and VPN gateway are in the same VPC.​
用户网关与VPN网关在相同VPC,无法建立IPSEC连接。​
400​
InvalidCustomerGateway.InvalidStatus​
The specified customer gateway is not in the correct status for the request.​
指定的用户网关所处的状态无法响应该请求。​
400​
InvalidVpnConnectionDpdAction.Malformed​
The specified DpdAction is malformed.​
指定的DpdAction不合法。​
400​
InvalidVpnConnectionIKEAuthElg.Malformed​
The specified IKE AuthAlg is malformed.​
指定的IKE AuthAlg不合法。​
400​
InvalidVpnConnectionIKEDhGroup.Malformed​
The specified IKE DhGroup is malformed.​
指定的IKE DhGroup不合法。​
400​
InvalidVpnConnectionIKEEncElg.Malformed​
The specified IKE EncAlg is malformed.​
指定的IKE EncAlg不合法。​
400​
InvalidVpnConnectionIKELifetime.Malformed​
The specified IKE Lifetime is malformed.​
指定的IKE Lifetime不合法。​
400​
InvalidVpnConnectionIKELocalID.Malformed​
The specified IKE LocalId is malformed.​
指定的IKE LocalId不合法。​
400​
InvalidVpnConnectionIKELocalID.Malformed​
The specified IKE LocalId is malformed. Ensure the maximum length of IKE LocalId is 100.​
指定的IKE LocalId格式不合法。IKE LocalId长度不能超过100个字符。​
400​
InvalidVpnConnectionIKEMode.Malformed​
The specified IKE Mode is malformed.​
指定的IKE Mode不合法。​
400​
InvalidVpnConnectionIKEMode.NotSupported​
The specified customer gateway with ip address 0.0.0.0 is only supported in IKEv1 version aggressive mode.​
仅IKEv1野蛮模式支持IP地址为0.0.0.0的用户网关。​
400​
InvalidVpnConnectionIKEPsk.Malformed​
The specified IKE Psk is malformed.​
指定的IKE Psk不合法。​
400​
InvalidVpnConnectionIKEPsk.Malformed​
The specified IKE Psk is malformed. Ensure the maximum length of IKE Psk is 100.​
指定的IKE Psk格式不合法。IKE Psk长度不能超过100个字符。​
400​
InvalidVpnConnectionIKERemoteID.Malformed​
The specified IKE RemoteId is malformed. Ensure the maximum length of IKE RemoteId is 100.​
指定的IKE RemoteId格式不合法。IKE RemoteId长度不能超过100个字符。​
400​
InvalidVpnConnectionIKERemoteID.Malformed​
The specified IKE RemoteId is malformed.​
指定的IKE RemoteId不合法。​
400​
InvalidVpnConnectionIKEVersion.Malformed​
The specified IKE Version is malformed.​
指定的IKE Version不合法。​
400​
InvalidVpnConnectionIPSecAuthElg.Malformed​
The specified IPSec AuthAlg is malformed.​
指定的IPSec AuthAlg不合法。​
400​
InvalidVpnConnectionIPSecDhGroup.Malformed​
The specified IPSec DhGroup is malformed.​
指定的IPSec DhGroup不合法。​
400​
InvalidVpnConnectionIPSecEncElg.Malformed​
The specified IPSec EncAlg is malformed.​
指定的IPSec EncAlg不合法。​
400​
InvalidVpnConnectionIPSecLifetime.Malformed​
The specified IPSec Lifetime is malformed.​
指定的IPSec Lifetime不合法。​
400​
InvalidVpnConnectionNegotiateInstantly.NotSupported​
NegotiateInstantly is not supported when the specified customer gateway ip address is 0.0.0.0.​
当指定的客户网关IP地址为0.0.0.0时,不支持立即协商。​
400​
InvalidVpnTunnelRemoteId.Conflict​
The specified IKE RemoteId conflicts with that of another IPSec connection tunnel with the same role under this gateway.​
指定的IKE RemoteId与本网关下其他相同角色的IPSec连接隧道存在冲突。​
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​
InvalidVpnConnectionBgpLocalIp.Malformed​
The BGP local IP is invalid; it should be within BGP tunnel CIDR and must be a host IP.​
指定的BGP本端地址不合法。​
400​
InvalidVpnConnectionBgpTunnelCidr.Malformed​
The BGP tunnel CIDR is invalid.​
指定的BGP隧道地址不合法。​
400​
InvalidVpnGateway.CustomerGateWayASNDuplicated​
The VPN gateway ASN is the same as the customer gateway ASN.​
VPN网关的ASN与用户网关的ASN一致,无法使用BGP功能。​
400​
InvalidVpnGateway.InvalidASN​
The VPN Gateway ASN is invalid and it should be in the range of 64512-65534 or 4200000000-4294967294.​
指定的ASN不合法。ASN应该在64512-65534、4200000000-4294967294范围内。​
403​
Forbidden.VpnConnectionBlocked​
The specified TR IPsec is blocked.​
当前TR IPsec封禁中,禁止操作。​
404​
InvalidCustomerGateway.NotFound​
The specified customer gateway does not exist.​
指定的用户网关不存在。​
404​
InvalidTunnel.NotFound​
The specified tunnel not exist.​
指定的隧道不存在。​
404​
InvalidVpnConnection.NotFound​
The specified IPSec connection does not exist.​
指定的IPSec连接不存在。​
412​
InvalidVpnGateway.Expired​
The specified VPN gateway has expired.​
指定的VPN网关已过期。​
​
最近更新时间:2026.09.18 15:13:19
这个页面对您有帮助吗?
有用
有用
无用
无用