View the configuration for each BGP session of a Cloud Router. For example, you can view the configured route advertisements for the router and its BGP sessions or the base advertised route priority that Cloud Router uses for calculating route metrics.
All routes for a BGP session use the same base priority. For more information, see Route metrics. If no value is specified, the base advertised route priority is the default value of 100.
To view the configuration for an existing BGP session:
Console
- Go to the Cloud Router page in the Google Cloud Console.
Go to the Cloud Router page - From the list of routers, select the router with the BGP session that you want to view.
- View the BGP sessions section to see the details of your Cloud Router's BGP sessions.
gcloud
Run the
describe
command, passing the name of the Cloud Router.gcloud compute routers describe [ROUTER_NAME]
In the output, view the
bgpPeers
section.bgp: advertiseMode: CUSTOM advertisedIpRanges: — description: 'test' range: 10.0.10.0/24 asn: 65101 bgpPeers: — advertiseMode: DEFAULT advertisedRoutePriority: 101 interfaceName: bgp1 ipAddress: 169.254.0.225 name: p1 peerAsn: 65201 peerIpAddress: 169.254.0.226 — interfaceName: bgp2 ipAddress: 169.254.1.1 name: p1002 peerAsn: 65400 peerIpAddress: 169.254.2.2 creationTimestamp: '2017-07-12T09:01:27.918-07:00' id: '1234567890123456789' interfaces: — ipRange: 169.254.0.225/30 linkedInterconnectAttachment: https://www.googleapis.com/compute/projects/test/regions/us-central1/interconnectAttachments/test1 name: interface1 — ipRange: 169.254.1.1/29 linkedInterconnectAttachment: https://www.googleapis.com/compute/projects/test/regions/us-central1/interconnectAttachments/test2 name: interface2 kind: compute#router name: my-router
API
To view the configuration for a BGP session, use the
routers.get
method.
GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/routers/ROUTER_NAME
Replace the following values:
PROJECT_ID
: the project that contains the Cloud RouterREGION
: the region where the Cloud Router is locatedROUTER_NAME
: the name of the Cloud Router
The bgpPeers[]
field in the output contains the configuration for each BGP
session.
What's next?
- Update the base priority of advertised routes.
- Update the route advertisements.