Viewing Cloud Router details

This page describes how to view the details of a Cloud Router and its BGP sessions, including the following:

All routes for a BGP session use the same base advertised route priority. For more information, see Advertised prefixes and priorities. If no value is specified, the base advertised route priority is the default value of 100.

For more information about BGP configuration issues and route processing issues, see the Troubleshooting page.

Before you begin

If you want to use the command-line examples in this guide, do the following:

  1. Install or update to the latest version of the gcloud command-line tool.
  2. Set a default region and zone.

If you want to use the API examples in this guide, set up API access.

View Cloud Router status and routes

To view Cloud Router status and routes, follow these steps.

Console

Check the status of a BGP session

  1. In the Google Cloud Console, go to the Cloud Routers page.

    Go to Cloud Routers

  2. View the BGP sessions column.

    • A green circle with a checkmark indicates that the session is established.
    • A red circle with an exclamation mark indicates that the session is still coming up or has already failed.

    For more information, hold the pointer over the exclamation mark. If the session is still coming up, wait a few minutes, and then reload the page to verify that the session has been established. If the session failed, view the logs to see information about the session. For more information, see Viewing logs and metrics.

View the routes that your router has advertised

  1. In the Cloud Console, go to the Cloud Routers page.

    Go to Cloud Routers

  2. Click the name of your router to open the Router details page.

  3. Under BGP sessions, click the name of the BGP session for which you want to see advertised routes.

  4. On the BGP session details page, see the Advertised routes section.

View the dynamic routes that your Cloud Router has learned in the network

  1. In the Cloud Console, go to the VPC Routes page.

    Go to VPC Routes

  2. Select Dynamic.

Determine the BGP peer keepalive interval setting

  1. In the Cloud Console, go to the Cloud Routers page.

    Go to Cloud Routers

  2. Click the router whose information you want to view.

  3. View the setting on the Router details page under BGP peer keepalive interval.

gcloud

  1. Run the get-status command and pass the name of the router. The command returns the router's status and advertised routes.

    gcloud compute routers get-status ROUTER_NAME \
       --project=PROJECT_ID \
       --region=asia-east1
    

    Replace the following:

    • ROUTER_NAME: the name of the Cloud Router
    • PROJECT_ID: the project that contains your Cloud Router
  2. The output is similar to the following:

    kind: compute#routerStatusResponse
    result:
      bestRoutes:
      — creationTimestamp: '2019-04-17T07:16:12.789-07:00'
        destRange: 192.168.1.0/24
        kind: compute#route
        nextHopIp: 169.254.0.2
        priority: 100
      — creationTimestamp: '2019-04-17T07:16:12.789-07:00'
        destRange: 192.168.2.0/24
        kind: compute#route
        nextHopIp: 169.254.0.2
        priority: 338
      bestRoutesForRouter:
      — creationTimestamp: '2019-04-17T07:15:42.012-07:00'
        destRange: 192.168.1.0/24
        kind: compute#route
        nextHopIp: 169.254.0.2
        priority: 100
      — creationTimestamp: '2019-04-17T07:15:42.014-07:00'
        destRange: 192.168.2.0/24
        kind: compute#route
        nextHopIp: 169.254.0.2
        priority: 338
        bgpPeerStatus:
      — advertisedRoutes:
        — destRange: 10.0.1.0/24
          kind: compute#route
          nextHopIp: 169.254.0.1
          priority: 100
        — destRange: 10.0.2.0/24
          kind: compute#route
          nextHopIp: 169.254.0.1
          priority: 340
      ipAddress: 169.254.0.1
      linkedVpnTunnel: https://www.googleapis.com/compute/projects/PROJECT_ID/regions/us-central1/vpnTunnels/vpn-1-tunnel-1
      name: mysession2
      numLearnedRoutes: 2
      peerIpAddress: 169.254.0.2
      state: Established
      status: UP
      uptime: 2 days, 3 hours, 37 minutes, 0 seconds
      uptimeSeconds: '185820'
    network: https://www.googleapis.com/compute/kind: compute#routerStatusResponse
    

API

Use the routers.getRouterStatus method:

GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/routers/ROUTER_NAME/getRouterStatus

Replace the following:

  • PROJECT_ID: the project that contains the Cloud Router
  • REGION: the region where the Cloud Router is located
  • ROUTER_NAME: the name of the Cloud Router

View BGP session configuration

To view the configuration for an existing BGP session, follow these steps.

Console

  1. In the Google Cloud Console, go to the Cloud Routers page.

    Go to Cloud Routers

  2. From the list of routers, select the router with the BGP session that you want to view.

  3. View the BGP sessions section to see the details of your Cloud Router's BGP sessions.

gcloud

  1. Run the describe command and pass the name of the Cloud Router.

    gcloud compute routers describe ROUTER_NAME /
      --project PROJECT_ID /
      --region REGION
    

    Replace the following:

    • ROUTER_NAME: the name of the Cloud Router
    • PROJECT_ID: the project that contains your Cloud Router
    • REGION: the region where the Cloud Router is located
  2. In the output, view the bgpPeers section:

      bgp:
        advertiseMode: DEFAULT
        asn: 65001
        keepaliveInterval: 120
      bgpPeers:
      — advertiseMode: DEFAULT
        enable: 'TRUE'
        interfaceName: if-mysession2
        ipAddress: 169.254.0.1
        name: mysession2
        peerAsn: 65002
        peerIpAddress: 169.254.0.2
      creationTimestamp: '2019-03-15T13:48:12.433-07:00'
      description: ''
      id: '7214728016518951367'
      interfaces:
      — ipRange: 169.254.0.1/30
      linkedVpnTunnel: https://www.googleapis.com/compute/projects/PROJECT_ID/regions/us-central1/vpnTunnels/vpn-1-tunnel-1
      name: if-mysession2
      kind: compute#router
      name: ROUTER_NAME
      network: https://www.googleapis.com/compute/projects/PROJECT_ID/global/networks/network-a
      region: https://www.googleapis.com/compute/projects/PROJECT_ID/regions/us-central1
      selfLink: https://www.googleapis.com/compute/projects/PROJECT_ID/regions/us-central1/routers/ROUTER_NAME
      selfLinkWithId: https://www.googleapis.com/compute/projects/PROJECT_ID/regions/us-central1/routers/7114728016518951267
    

API

Use the routers.get method:

GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/routers/ROUTER_NAME

Replace the following:

  • PROJECT_ID: the project that contains the Cloud Router
  • REGION: the region where the Cloud Router is located
  • ROUTER_NAME: the name of the Cloud Router

The bgpPeers[] field in the output contains the configuration for each BGP session.

What's next