edit-icon download-icon

DescribeVpnConnection

Last Updated: Apr 13, 2018

Description

Query the list of IPsec connections.

Request parameters

Name Type Required Description
Action String Yes

The action to perform.

Valid value: DescribeVpnConnections

RegionId String Yes

The region of the IPsec connection.

You can obtain the region ID by calling the DescribeRegions API.

VpnGatewayId String No The ID of the VPN gateway.
CustomerGatewayId String No The ID of the customer gateway.
PageNumber Integer No The number of pages to return. The default value is 1.
PageSize Integer No The number of rows per page. The maximum value is 50 and the default value is 10.

Response parameters

Name Type Description
RequestId String The ID of the request.
VpnConnections JSON string A list of IPsec connections.
TotalCount Integer The number of queried entries.
PageNumber Integer The current page number.
PageSize Integer The number of entries on the current page.
VPNConnection objects
VpnConnectionId String The ID of the IPsec connection.
CustomerGatewayId String The ID of the customer gateway.
VpnGatewayId String The ID of the VPN gateway.
Name String The name of the IPsec connection.
LocalSubnet String The CIDR block of the VPC.
RemoteSubnet String The CIDR block of the local data center.
CreateTime Long The creation time of the IPsec connection.
IkeConfig JSON string Configurations of phase-one negotiation.
IpsecConfig JSON string Configurations of phase-two negotiation.
Status String The status of IPsec connection.

  • ike_sa_not_established: The phase-one negotiation fails.
  • ike_sa_established: The phase-one negotiation succeeds.

  • ipsec_sa_not_established: The phase-two negotiation fails.

  • ipsec_sa_established: The phase-two negotiation succeeds.

Error codes

See VPC API Error Center.

Examples

Request example

  1. https://vpc.aliyuncs.com/?Action=DescribeVpnConnections
  2. &RegionID=cn-hangzhou
  3. &<CommonParameters>

Response example

XML format

  1. <DescribeVpnConnectionsResponse>
  2. <PageNumber>1</PageNumber>
  3. <VpnConnections>
  4. <VpnConnection>
  5. <Name>vpn connection test</Name>
  6. <CustomerGatewayId>cgw-bp1pvpl9r9adju6l5nxck</CustomerGatewayId>
  7. <RemoteSubnet>2.2.2.0/24</RemoteSubnet>
  8. <IpsecConfig>
  9. <IpsecLifetime>86400</IpsecLifetime>
  10. <IpsecAuthAlg>sha1</IpsecAuthAlg>
  11. <IpsecPfs>group2</IpsecPfs>
  12. <IpsecEncAlg>aes</IpsecEncAlg>
  13. </IpsecConfig>
  14. <EffectImmediately>true</EffectImmediately>
  15. <VpnGatewayId>vpn-bp1q8bgx4xnkm2ogj0fiu</VpnGatewayId>
  16. <CreateTime>1492753817000</CreateTime>
  17. <VpnConnectionId>vco-bp10lz7aejumd2vxoqgev</VpnConnectionId>
  18. <status>ipsec_sa_established
  19. <status>
  20. <LocalSubnet>1.1.1.0/24,1.1.2.0/24</LocalSubnet>
  21. <IkeConfig>
  22. <IkeEncAlg>aes</IkeEncAlg>
  23. <RemoteId>139.196.32.167</RemoteId>
  24. <IkePfs>group2</IkePfs>
  25. <IkeAuthAlg>sha1</IkeAuthAlg>
  26. <Psk>pgw6dy7d1i8in7x5</Psk>
  27. <IkeMode>main</IkeMode>
  28. <IkeLifetime>86400</IkeLifetime>
  29. <IkeVersion>ikev1</IkeVersion>
  30. <LocalId>116.62.69.64</LocalId>
  31. </IkeConfig>
  32. </VpnConnection>
  33. </VpnConnections>
  34. <TotalCount>1</TotalCount>
  35. <PageSize>10</PageSize>
  36. <RequestId>3F96DAF2-8A69-4E84-824A-E16E22308703</RequestId>
  37. </DescribeVpnConnectionsResponse>

JSON format

  1. {
  2. "PageNumber": 1,
  3. "VpnConnections": {
  4. "VpnConnection": [
  5. {
  6. "Name": "vpn connection test",
  7. "CustomerGatewayId": "cgw-bp1pvpl9r9adju6l5nxck",
  8. "RemoteSubnet": "2.2.2.0/24",
  9. "IpsecConfig": {
  10. "IpsecLifetime": 86400,
  11. "IpsecAuthAlg": "sha1",
  12. "IpsecPfs": "group2",
  13. "IpsecEncAlg": "aes"
  14. },
  15. "EffectImmediately": true,
  16. "VpnGatewayId": "vpn-bp1q8bgx4xnkm2ogj0fiu",
  17. "CreateTime": 1492753817000,
  18. "VpnConnectionId": "vco-bp10lz7aejumd2vxoqgev",
  19. "status": "ipsec_sa_established",
  20. "LocalSubnet": "1.1.1.0/24,1.1.2.0/24",
  21. "IkeConfig": {
  22. "IkeEncAlg": "aes",
  23. "RemoteId": "139.196.32.167",
  24. "IkePfs": "group2",
  25. "IkeAuthAlg": "sha1",
  26. "Psk": "pgw6dy7d1i8in7x5",
  27. "IkeMode": "main",
  28. "IkeLifetime": 86400,
  29. "IkeVersion": "ikev1",
  30. "LocalId": "116.62.69.64"
  31. }
  32. }
  33. ]
  34. },
  35. "TotalCount": 1,
  36. "PageSize": 10,
  37. "RequestId": "54A4B3D0-DF4D-4C54-B8DC-5DC8DD49C939"
  38. }
Thank you! We've received your feedback.