Viewing Router Status and Routes

View details such as the status of a router's BGP sessions or the routes that the router is advertising.

Console


  • To check the status of a BGP session:

    1. Go to the Cloud Router page in the Google Cloud Console.
      Go to the Cloud Router page
    2. View the BGP sessions column.
      • A green circle with a checkmark indicates the session is established.
      • A red circle with an exclamation mark indicates that the session is still coming up or has already failed. Hover over the exclamation mark for more information. If the session is still coming up, wait a few moments, 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.
  • To see the routes that your router has advertised:

    1. Go to the Cloud Router page in the Google Cloud Console.
      Go to the Cloud Router page
    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.
  • To see the dynamic routes that your Cloud Router has learned in the network:

    1. Go to the Virtual Private Cloud (VPC) routes page in the Google Cloud Console.
      Go to the VPC Routes page

    2. Select Dynamic.

gcloud


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

gcloud compute --project project-id routers get-status my-router \
    --region asia-east1
  • project-id is the project that contains your Cloud Router.
kind: compute#routerStatusResponse
Result:
  bestRoutes:
  — destRange: 10.0.1.0/24
    kind: compute#route
    nextHopIp: 169.254.1.1
    priority: 100
  — destRange: 10.0.2.0/24
    kind: compute#route
    nextHopIp: 169.254.1.1
    priority: 100
 bgpPeerStatus:
 — advertisedRoutes:
  — destRange: 10.21.0.0/16
    kind: compute#route
    nextHopIp: 169.254.1.2
    priority: 100
  — destRange: 192.168.1.0/24
    kind: compute#route
    nextHopIp: 169.254.1.2
    priority: 100
  ipAddress: 169.254.1.1
  name: bgp-peer1
  numLearnedRoutes: 0
  peerIpAddress: 169.254.1.2
  state: Established
  status: UP
  uptime: '10'
network: https://www.googleapis.com/compute/v1/projects/<var>project-id</var>/global/networks/my-network