All Products
Search
Document Center

VPN Gateway:DescribeVpnRouteEntries

Last Updated:Oct 13, 2026

Queries the destination route entries and BGP route entries of a VPN gateway instance.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

vpc:DescribeVpnRouteEntries

get

*VpnGateway

acs:vpc:{#regionId}:{#accountId}:vpngateway/{#VpnGatewayId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID of the VPN gateway instance.

You can call the DescribeRegions operation to obtain the region ID.

cn-hangzhou

VpnGatewayId

string

Yes

The instance ID of the VPN gateway.

vpn-bp1cmw7jh1nfe43m9****

PageNumber

integer

No

The page number. Default value: 1.

1

PageSize

integer

No

The number of entries to return per page. Maximum value: 50. Default value: 10.

10

RouteEntryType

string

No

The type of the route. Valid values:

  • custom (default): Queries the destination routes of the VPN gateway instance.

  • bgp: Queries the BGP routes of the VPN gateway instance.

custom

Response elements

Element

Type

Description

Example

object

The response.

PageNumber

integer

The page number.

1

PageSize

integer

The number of entries returned per page.

10

RequestId

string

The request ID.

BF3995A6-FA4F-4C74-B90F-89ECF4BFF4D5

TotalCount

integer

The total number of entries in the list.

1

VpnRouteCounts

object

VpnRouteCount

array<object>

The route statistics for VPN gateway instances in dual-tunnel mode.

Note

This information is returned only for VPN gateway instances that support IPsec-VPN connections in dual-tunnel mode.

object

The route statistics.

RouteCount

integer

The number of route entries.

3

RouteEntryType

string

The type of the route entry. Valid values:

  • custom: destination route entry.

  • bgp: BGP route entry.

bgp

Source

string

The source of the BGP route entry. Valid values:

  • CLOUD: The route is propagated from an Alibaba Cloud service associated with the VPN gateway.

  • VPN_BGP: The route is learned through the BGP routable protocol of the VPN gateway, such as learning routes from the on-premises data center through the BGP routable protocol.

VPN_BGP

VpnRouteEntries

object

VpnRouteEntry

array<object>

The list of route entries.

object

The details of the route entry.

AsPath

string

The AS path that the route entry passes through.

65501,65001,60011

Community

string

The community attribute value of the route entry.

65001:1000,65501:2000

CreateTime

integer

The timestamp when the route entry was created.

The timestamp is in the UNIX timestamp format, which indicates the total number of seconds that have elapsed since 00:00:00 UTC on January 1, 1970.

1563874074000

NextHop

string

The next hop of the route entry.

vco-bp1tui07ob10fmuro****

NextHopTunnelId

string

The ID of the tunnel associated with the next hop of the route entry.

Note

This parameter is returned only for VPN gateway instances that support IPsec-VPN connections in dual-tunnel mode.

tun-36cfgpwjn58axj****

PrefixListId

string

The instance ID of the prefix list.

pl-m5estsqsdqwg88hjf****

RouteDest

string

The destination CIDR block of the route entry.

10.0.0.0/24

RouteEntryType

string

The type of the route. Valid values:

  • custom: the destination route of the VPN gateway instance.

  • bgp: the BGP route of the VPN gateway instance.

custom

Source

string

The source of the BGP route entry. Valid values:

  • CLOUD: The route is propagated from an Alibaba Cloud service associated with the VPN gateway.

  • VPN_BGP: The route is learned through the BGP routable protocol of the VPN gateway, such as learning routes from the on-premises data center through the BGP routable protocol.

CLOUD

State

string

The status of the route entry. Valid values:

  • published: Published.

  • normal: Unpublished.

normal

VpnInstanceId

string

The instance ID of the VPN gateway.

vpn-bp1cmw7jh1nfe43m9****

Weight

integer

The weight of the destination route.

  • For VPN gateway instances that support IPsec-VPN connections in dual-tunnel mode, the default weight of the destination route is 100, which has no practical significance.

  • For VPN gateway instances that support IPsec-VPN connections in single-tunnel mode, the weight of the destination route indicates the priority of the destination route:
    • 100: High priority. If multiple destination routes have the same destination CIDR block, the IPsec-VPN connection associated with this destination route serves as the active link.

    • 0: Low priority. If multiple destination routes have the same destination CIDR block, the IPsec-VPN connection associated with this destination route serves as the standby link.

100

Examples

Success response

JSON format

{
  "PageNumber": 1,
  "PageSize": 10,
  "RequestId": "BF3995A6-FA4F-4C74-B90F-89ECF4BFF4D5",
  "TotalCount": 1,
  "VpnRouteCounts": {
    "VpnRouteCount": [
      {
        "RouteCount": 3,
        "RouteEntryType": "bgp",
        "Source": "VPN_BGP"
      }
    ]
  },
  "VpnRouteEntries": {
    "VpnRouteEntry": [
      {
        "AsPath": "65501,65001,60011",
        "Community": "65001:1000,65501:2000",
        "CreateTime": 1563874074000,
        "NextHop": "vco-bp1tui07ob10fmuro****",
        "NextHopTunnelId": "tun-36cfgpwjn58axj****",
        "PrefixListId": "",
        "RouteDest": "10.0.0.0/24",
        "RouteEntryType": "custom",
        "Source": "CLOUD",
        "State": "normal",
        "VpnInstanceId": "vpn-bp1cmw7jh1nfe43m9****",
        "Weight": 100
      }
    ]
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 IllegalParam.RouteEntryType The specified "RouteEntryType" is invalid.
400 InvalidVpnInstanceId.NotFound The specified VPN was not found. The specified VPN instance was not found.
400 InvalidVpnGatewayInstanceId.NotFound The specified vpn gateway instance id does not exist. The specified VPN gateway does not exist. Check whether the specified VPN gateway is valid.
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.