All Products
Search
Document Center

VPN Gateway:DescribeVpnRouteEntries

Last Updated:Jun 19, 2026

Queries the destination route and BGP route information of a VPN gateway instance by calling the DescribeVpnRouteEntries operation.

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 query the region ID.

cn-hangzhou

VpnGatewayId

string

Yes

The instance ID of the VPN gateway.

vpn-bp1cmw7jh1nfe43m9****

PageNumber

integer

No

The page number of the list. Default value: 1.

1

PageSize

integer

No

The number of entries per page in a paged query. Maximum value: 50. Default value: 10.

10

RouteEntryType

string

No

The destination type of the routing entry. 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 parameters.

PageSize

integer

The number of entries per page in a paging query.

10

RequestId

string

The request ID.

BF3995A6-FA4F-4C74-B90F-89ECF4BFF4D5

PageNumber

integer

The page number of the list.

1

TotalCount

integer

The total number of entries in the list.

1

VpnRouteEntries

object

VpnRouteEntry

array<object>

The list of route entries.

object

The details of the route entry.

RouteEntryType

string

The type of the route entry. Valid values:

  • Custom: custom

  • System: system

custom

NextHop

string

The next hop of the route entry.

vco-bp1tui07ob10fmuro****

Weight

integer

The weight of the route entry. Valid values: 0 and 100.

  • 0: a low priority

  • 100: a high priority

100

RouteDest

string

The destination CIDR block of the route entry.

10.0.0.0/24

AsPath

string

The AS path of the route entry.

65501,65001,60011

State

string

The status of the route entry. Valid values:

  • published: advertised

  • normal: not advertised

normal

CreateTime

integer

The timestamp when the route entry was created.

1563874074000

Community

string

The community attributes of the route entry.

65001:1000,65501:2000

Source

string

The source of the BGP route. Valid values:

  • CLOUD: advertised from a cloud service associated with the VPN gateway.

  • VPN_BGP: indicates that the current route is learned by using BGP of the VPN gateway. For example, the BGP is used to learn the route of the on-premises data center.

CLOUD

VpnInstanceId

string

The ID of the VPN gateway.

vpn-bp1cmw7jh1nfe43m9****

NextHopTunnelId

string

The ID of the tunnel associated with the next hop.

Note

This parameter is returned only if the VPN gateway supports the dual-tunnel mode.

tun-36cfgpwjn58axj****

VpnRouteCounts

object

VpnRouteCount

array<object>

The route statistics of the VPN gateway instance in dual-tunnel mode.

Note

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

object

The statistics of the routes.

RouteEntryType

string

The route type. Valid values:

  • custom (default): destination-based route.

  • bgp : BGP route entry.

bgp

RouteCount

integer

The number of route entries.

3

Source

string

The source of the BGP route. Valid values:

  • CLOUD: advertised from a cloud service associated with the VPN gateway.

  • VPN_BGP: indicates that the current route is learned by using BGP of the VPN gateway. For example, the BGP is used to learn the route of the on-premises data center.

VPN_BGP

Examples

Success response

JSON format

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

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.
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.