Queries information about IPsec-VPN connections.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
vpc:DescribeVpnConnections |
list |
VpnConnection
VpnConnection
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID of the IPsec-VPN connection. You can call the DescribeRegions operation to query the region ID. |
cn-hangzhou |
| VpnGatewayId |
string |
No |
The instance ID of the VPN gateway. |
vpn-bp1q8bgx4xnkx**** |
| CustomerGatewayId |
string |
No |
The ID of the customer gateway. |
cgw-bp1mvj4g9kogw**** |
| PageNumber |
integer |
No |
The page number. Default value: 1. |
1 |
| PageSize |
integer |
No |
The number of entries per page for paging queries. Default value: 10. Valid values: 1 to 50. |
10 |
| VpnConnectionId |
string |
No |
The ID of the IPsec-VPN connection. |
vco-bp10lz7aejumd**** |
| Tag |
array<object> |
No |
The list of tags bound to the IPsec-VPN connection. You can specify up to 20 tags at a time. |
|
|
object |
No |
The tag information. |
||
| Key |
string |
No |
The tag key. If you specify this parameter, the value cannot be an empty string. The tag key can be up to 64 characters in length and cannot start with You can specify up to 20 tag keys at a time. |
TagKey |
| Value |
string |
No |
The tag value. The tag value can be up to 128 characters in length and can be an empty string. It cannot start with Each tag key corresponds to one tag value. You can specify up to 20 tag values at a time. |
TagValue |
| ResourceGroupId |
string |
No |
The ID of the resource group to which the IPsec-VPN connection belongs. You can call the ListResourceGroups operation to query the resource group ID. |
rg-acfmzs372yg**** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| PageSize |
integer |
The number of entries per page for paging queries. |
10 |
| RequestId |
string |
The request ID. |
238752DC-0693-49BE-9C85-711D5691D3E5 |
| PageNumber |
integer |
The page number. |
1 |
| TotalCount |
integer |
The total number of entries returned. |
2 |
| VpnConnections |
object |
||
| VpnConnection |
array<object> |
The list of IPsec-VPN connection configurations. |
|
|
array<object> |
The configuration of the IPsec-VPN connection. |
||
| Status |
string |
The status of the IPsec-VPN connection.
|
ipsec_sa_established |
| EnableNatTraversal |
boolean |
Indicates whether NAT traversal is enabled for the IPsec-VPN connection.
|
true |
| RemoteCaCertificate |
string |
The CA certificate of the peer. |
-----BEGIN CERTIFICATE----- MIIB7zCCAZW**** -----END CERTIFICATE----- |
| CreateTime |
integer |
The UNIX timestamp indicating when the IPsec-VPN connection was created. Unit: milliseconds. The timestamp follows the Unix time format, representing the total number of milliseconds elapsed since 00:00:00 UTC on January 1, 1970, until the creation time of the IPsec-VPN connection. |
1492753817000 |
| EffectImmediately |
boolean |
Indicates whether the configuration of the IPsec-VPN connection takes effect immediately.
|
true |
| VpnGatewayId |
string |
The instance ID of the VPN Gateway. |
vpn-bp1q8bgx4xnkm**** |
| LocalSubnet |
string |
The CIDR block on the Alibaba Cloud side of the IPsec-VPN connection. When multiple CIDR blocks are present, they are separated by commas (,). |
192.168.0.0/16,172.17.0.0/16 |
| VpnConnectionId |
string |
The ID of the IPsec-VPN connection. |
vco-bp10lz7aejumd**** |
| RemoteSubnet |
string |
The CIDR blocks on the data center side. When multiple CIDR blocks are specified, separate them with commas (,). |
10.0.0.0/8,172.16.0.0/16 |
| CustomerGatewayId |
string |
The instance ID of the customer gateway associated with the IPsec-VPN connection. |
cgw-bp1mvj4g9kogw**** |
| Name |
string |
The name of the IPsec-VPN connection. |
nametest |
| EnableDpd |
boolean |
Indicates whether the DPD (Dead Peer Detection) feature is enabled for the IPsec-VPN connection.
|
true |
| IkeConfig |
object |
The configuration for the first-phase negotiation. |
|
| RemoteId |
string |
The identity on the Alibaba Cloud side of the IPsec-VPN connection. |
139.17.XX.XX |
| IkeLifetime |
integer |
The IKE phase lifetime. Unit: seconds. |
86400 |
| IkeEncAlg |
string |
The IKE phase encryption algorithm. |
aes |
| LocalId |
string |
The identity of the local data center side of the IPsec-VPN connection peer. |
116.64.XX.XX |
| IkeMode |
string |
The IKE phase negotiation mode.
|
main |
| IkeVersion |
string |
The IKE protocol version.
Compared with IKEv1, IKEv2 simplifies the SA negotiation procedure and provides better support for scenarios involving multiple segments. |
ikev1 |
| IkePfs |
string |
The Diffie-Hellman (DH) group used in IKE phase 1. |
group2 |
| Psk |
string |
The pre-shared key. |
pgw6dy7**** |
| IkeAuthAlg |
string |
The IKE phase authentication algorithm. |
sha1 |
| IpsecConfig |
object |
The configuration for Phase 2 negotiation. |
|
| IpsecAuthAlg |
string |
The IPsec authentication algorithm. |
sha1 |
| IpsecLifetime |
integer |
The IPsec lifetime. Unit: seconds. |
86400 |
| IpsecEncAlg |
string |
The IPsec encryption algorithm. |
aes |
| IpsecPfs |
string |
The Diffie-Hellman (DH) group used in the IPsec phase. |
group2 |
| VcoHealthCheck |
object |
Health check configuration for the IPsec-VPN connection. |
|
| Status |
string |
Health check status.
|
success |
| Dip |
string |
The destination IP address. |
192.168.0.1 |
| Interval |
integer |
The time interval for the health check. Unit: seconds. |
2 |
| Retry |
integer |
The number of retry packets for the health check. |
3 |
| Sip |
string |
The source IP address. |
192.168.0.50 |
| Enable |
string |
Enabling status of the health check.
|
true |
| Policy |
string |
Whether to revoke published routes when a health check fails.
|
revoke_route |
| VpnBgpConfig |
object |
The configuration of the BGP routable protocol for the IPsec-VPN connection. |
|
| Status |
string |
The negotiation status of the BGP routable protocol.
|
success |
| PeerBgpIp |
string |
The peer BGP IP address. |
169.254.10.1 |
| TunnelCidr |
string |
The BGP CIDR block for the IPsec-VPN connection. This CIDR block is a subnet within 169.254.0.0/16 with a subnet mask length of 30. |
169.254.10.0/30 |
| LocalBgpIp |
string |
The BGP IP address on the Alibaba Cloud side. |
169.254.10.2 |
| PeerAsn |
integer |
The peer autonomous system number. |
65530 |
| LocalAsn |
integer |
The autonomous system number (ASN) on the Alibaba Cloud side. |
65531 |
| AuthKey |
string |
The authentication key for the BGP routable protocol. |
AuthKey**** |
| AttachType |
string |
The resource type to which the IPsec-VPN connection is attached.
|
CEN |
| NetworkType |
string |
The network type of the IPsec-VPN connection.
|
public |
| AttachInstanceId |
string |
The instance ID of the Cloud Enterprise Network (CEN) instance to which the transit router instance belongs. |
cen-lxxpbpalc776qz**** |
| Spec |
string |
The bandwidth specification of the IPsec-VPN connection. Unit: Mbps. |
1000M |
| State |
string |
The binding status of the IPsec-VPN connection to a transit router instance.
|
attached |
| TransitRouterId |
string |
The instance ID of the transit router to which the IPsec-VPN connection is attached. |
tr-p0we2edef9qr44a85**** |
| TransitRouterName |
string |
The name of the transit router instance. |
nametest |
| CrossAccountAuthorized |
boolean |
Indicates whether the IPsec-VPN connection is attached to a transit router instance under a different account.
|
false |
| InternetIp |
string |
The gateway IP address of the IPsec-VPN connection. Note
This parameter is returned only when the IPsec-VPN connection is attached to a transit router instance. |
10.XX.XX.10 |
| Tag |
object |
||
| Tag |
array<object> |
The list of tags attached to the IPsec-VPN connection. |
|
|
object |
Tag information. |
||
| Key |
string |
The tag key. |
TagKey |
| Value |
string |
The tag value. |
TagValue |
| TunnelOptionsSpecification |
object |
||
| TunnelOptions |
array<object> |
The tunnel configuration information of the IPsec-VPN connection. Parameters under the TunnelOptionsSpecification array are returned only when querying an IPsec-VPN connection in dual-tunnel mode. |
|
|
array<object> |
The configuration information of the tunnel. |
||
| TunnelId |
string |
The tunnel ID. |
tun-opsqc4d97wni27**** |
| CustomerGatewayId |
string |
The ID of the customer gateway associated with the tunnel. |
cgw-p0wy363lucf1uyae8**** |
| EnableDpd |
string |
Whether the DPD (Dead Peer Detection) feature is enabled for the tunnel.
|
true |
| EnableNatTraversal |
string |
Indicates whether NAT traversal is enabled for the tunnel.
|
true |
| InternetIp |
string |
The IP address of the tunnel. |
47.21.XX.XX |
| RemoteCaCertificate |
string |
The CA certificate of the remote end of the tunnel. This parameter is returned only when the Type of the VPN Gateway instance is SM (State Encryption). |
-----BEGIN CERTIFICATE----- MIIB7zCCAZW**** -----END CERTIFICATE----- |
| Role |
string |
The role of the tunnel.
|
master |
| TunnelIndex |
integer |
The creation order of the tunnel.
Note
This parameter is returned only when the IPsec-VPN connection is attached to a transit router. |
1 |
| State |
string |
The status of the tunnel.
|
active |
| Status |
string |
The status of the IPsec-VPN connection.
|
ipsec_sa_established |
| TunnelBgpConfig |
object |
The Border Gateway Protocol (BGP) configuration information of the tunnel. |
|
| BgpStatus |
string |
The Border Gateway Protocol (BGP) negotiation status.
|
success |
| LocalAsn |
string |
The autonomous system number (ASN) of the local end (Alibaba Cloud side) of the tunnel. |
65530 |
| LocalBgpIp |
string |
The BGP IP address on the local end (Alibaba Cloud side) of the tunnel. |
169.254.10.1 |
| PeerAsn |
string |
The autonomous system number of the tunnel peer. |
65531 |
| PeerBgpIp |
string |
The BGP IP address of the tunnel peer. |
169.254.10.2 |
| TunnelCidr |
string |
The BGP segment of the tunnel. |
169.254.10.0/30 |
| TunnelIkeConfig |
object |
The configuration for Phase 1 negotiation. |
|
| IkeAuthAlg |
string |
The IKE authentication algorithm. |
sha1 |
| IkeEncAlg |
string |
The IKE encryption algorithm. |
aes |
| IkeLifetime |
string |
IKE phase lifetime. Unit: seconds. |
86400 |
| IkeMode |
string |
IKE negotiation mode.
|
main |
| IkePfs |
string |
The Diffie-Hellman (DH) group used in IKE phase 1. |
group2 |
| IkeVersion |
string |
IKE protocol version. |
ikev1 |
| LocalId |
string |
The identity of the local end (Alibaba Cloud side) of the tunnel. |
47.21.XX.XX |
| Psk |
string |
Pre-shared key. |
123456**** |
| RemoteId |
string |
The identity of the tunnel peer. |
47.42.XX.XX |
| TunnelIpsecConfig |
object |
Configuration for phase two negotiation. |
|
| IpsecAuthAlg |
string |
IPsec phase authentication algorithm. |
sha1 |
| IpsecEncAlg |
string |
IPsec phase encryption algorithm. |
aes |
| IpsecLifetime |
string |
IPsec phase lifetime. Unit: seconds. |
86400 |
| IpsecPfs |
string |
IPsec phase Diffie-Hellman (DH) group. |
group2 |
| ZoneNo |
string |
The zone where the tunnel is deployed. |
ap-southeast-5a |
| EnableTunnelsBgp |
boolean |
The enabling status of tunnel BGP.
|
true |
| ResourceGroupId |
string |
The ID of the resource group to which the IPsec-VPN connection belongs. You can invoke the ListResourceGroups API to query resource group information. |
rg-acfmzs372yg**** |
| TunnelBandwidth |
string |
Specifies the bandwidth specification for a single VPN tunnel. Valid values: |
Standard |
Examples
Success response
JSON format
{
"PageSize": 10,
"RequestId": "238752DC-0693-49BE-9C85-711D5691D3E5",
"PageNumber": 1,
"TotalCount": 2,
"VpnConnections": {
"VpnConnection": [
{
"Status": "ipsec_sa_established",
"EnableNatTraversal": true,
"RemoteCaCertificate": "-----BEGIN CERTIFICATE----- MIIB7zCCAZW**** -----END CERTIFICATE-----",
"CreateTime": 1492753817000,
"EffectImmediately": true,
"VpnGatewayId": "vpn-bp1q8bgx4xnkm****",
"LocalSubnet": "192.168.0.0/16,172.17.0.0/16",
"VpnConnectionId": "vco-bp10lz7aejumd****",
"RemoteSubnet": "10.0.0.0/8,172.16.0.0/16",
"CustomerGatewayId": "cgw-bp1mvj4g9kogw****",
"Name": "nametest",
"EnableDpd": true,
"IkeConfig": {
"RemoteId": "139.17.XX.XX",
"IkeLifetime": 86400,
"IkeEncAlg": "aes",
"LocalId": "116.64.XX.XX",
"IkeMode": "main",
"IkeVersion": "ikev1",
"IkePfs": "group2",
"Psk": "pgw6dy7****",
"IkeAuthAlg": "sha1"
},
"IpsecConfig": {
"IpsecAuthAlg": "sha1",
"IpsecLifetime": 86400,
"IpsecEncAlg": "aes",
"IpsecPfs": "group2"
},
"VcoHealthCheck": {
"Status": "success",
"Dip": "192.168.0.1",
"Interval": 2,
"Retry": 3,
"Sip": "192.168.0.50",
"Enable": "true",
"Policy": "revoke_route"
},
"VpnBgpConfig": {
"Status": "success",
"PeerBgpIp": "169.254.10.1",
"TunnelCidr": "169.254.10.0/30",
"LocalBgpIp": "169.254.10.2",
"PeerAsn": 65530,
"LocalAsn": 65531,
"AuthKey": "AuthKey****"
},
"AttachType": "CEN",
"NetworkType": "public",
"AttachInstanceId": "cen-lxxpbpalc776qz****",
"Spec": "1000M",
"State": "attached",
"TransitRouterId": "tr-p0we2edef9qr44a85****",
"TransitRouterName": "nametest",
"CrossAccountAuthorized": false,
"InternetIp": "10.XX.XX.10",
"Tag": {
"Tag": [
{
"Key": "TagKey",
"Value": "TagValue"
}
]
},
"TunnelOptionsSpecification": {
"TunnelOptions": [
{
"TunnelId": "tun-opsqc4d97wni27****",
"CustomerGatewayId": "cgw-p0wy363lucf1uyae8****",
"EnableDpd": "true",
"EnableNatTraversal": "true",
"InternetIp": "47.21.XX.XX",
"RemoteCaCertificate": "-----BEGIN CERTIFICATE----- MIIB7zCCAZW**** -----END CERTIFICATE-----",
"Role": "master",
"TunnelIndex": 1,
"State": "active",
"Status": "ipsec_sa_established",
"TunnelBgpConfig": {
"BgpStatus": "success",
"LocalAsn": "65530",
"LocalBgpIp": "169.254.10.1",
"PeerAsn": "65531",
"PeerBgpIp": "169.254.10.2",
"TunnelCidr": "169.254.10.0/30"
},
"TunnelIkeConfig": {
"IkeAuthAlg": "sha1",
"IkeEncAlg": "aes",
"IkeLifetime": "86400",
"IkeMode": "main",
"IkePfs": "group2",
"IkeVersion": "ikev1",
"LocalId": "47.21.XX.XX",
"Psk": "123456****",
"RemoteId": "47.42.XX.XX"
},
"TunnelIpsecConfig": {
"IpsecAuthAlg": "sha1",
"IpsecEncAlg": "aes",
"IpsecLifetime": "86400",
"IpsecPfs": "group2"
},
"ZoneNo": "ap-southeast-5a"
}
]
},
"EnableTunnelsBgp": true,
"ResourceGroupId": "rg-acfmzs372yg****",
"TunnelBandwidth": "Standard"
}
]
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | Forbidden.TagKey.Duplicated | The specified tag key already exists. | The tag resources are duplicate. |
| 400 | SizeLimitExceeded.TagNum | The maximum number of tags is exceeded. | The number of tags has reached the upper limit. |
| 400 | InvalidParameter.TagValue | The specified parameter TagValue is invalid. | The error message returned because the specified tag value is invalid. |
| 400 | InvalidParameter.TagKey | The specified parameter TagKey is invalid. | The error message returned because the specified tag key is invalid. |
| 400 | Duplicated.TagKey | The specified parameter TagKey is duplicated. | The error message returned because the specified tag key already exists. |
| 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. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.