Update the base route priority
When you configure a Border Gateway Protocol (BGP) session on a Cloud Router, you can specify a base advertised priority for the BGP session. The base advertised priority applies to all prefixes (destinations) advertised by that BGP session.
Base priorities are whole numbers from 0
to 65535
.
The highest possible base priority is 0
. The default base priority is 100
.
If you don't specify a base priority, the default priority is used.
Base priorities let you specify which Cloud VPN tunnels or VLAN attachments on-premises systems use to send packets to your VPC network. You can create active-active, active-passive, or a custom combination of these topologies by using the base priority. For an example using HA VPN tunnels, see Active-active and active-passive routing options for HA VPN in the Cloud VPN documentation.
To update the base advertised route priority for an existing BGP session, follow these steps.
Console
For Cloud VPN tunnels that use dynamic routing, including HA VPN tunnels, complete the following steps:
In the Google Cloud console, go to the Cloud VPN tunnels page.
From the list of tunnels in the Name column, select the tunnel that you want to modify.
On the Cloud VPN tunnel details page, select Modify BGP session.
Modify the Advertised route priority value.
Click Save and continue.
For Dedicated Interconnect or Partner Interconnect, complete the following steps:
In the Google Cloud console, go to the VLAN attachments tab on the Cloud Interconnect page.
From the list of attachments in the Name column, select the attachment that you want to modify.
On the VLAN attachment details page, select the name of the BGP session.
Modify the Advertised route priority value.
Click Save and continue.
gcloud
Run the update-bgp-peer
command using the
--advertised-route-priority
flag. Specify the name of the
Cloud Router and BGP session that correspond to the appropriate
Cloud VPN tunnel or VLAN attachment.
gcloud compute routers update-bgp-peer ROUTER_NAME \ --peer-name=NAME_OF_BGP_SESSION \ --advertised-route-priority=BASE_PRIORITY_VALUE
API
Use the
routers.patch
method to update the bgpPeers[]
field.
The bgpPeers[]
field accepts an array of BGP peers. When you PATCH
this
field, you overwrite the existing array of BGP peers with the new array
included in your request.
Send a
GET
request to get the current array of BGP peers for the router. For details, see View BGP session configuration.Send a
PATCH
request with a new array of BGP peers. In the array element that contains the BGP session that you want to update, modify the value ofadvertisedRoutePriority
.PATCH https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/routers/ROUTER_NAME { "bgpPeers": [ BGP_PEERS ] }
Replace the following:
PROJECT_ID
: the project that contains the Cloud RouterREGION
: the region where the Cloud Router is locatedROUTER_NAME
: the name of the Cloud RouterBGP_PEERS
: the contents of the new array of BGP peers
The following example includes one BGP peer with the default
advertisedRoutePriority
of100
and another with an updated value of99
:{ "name": "peer-1", "interfaceName": "if-peer-1", "ipAddress": "169.254.10.1", "peerIpAddress": "169.254.10.2", "peerAsn": 64512, "advertisedRoutePriority": 100, "advertiseMode": "DEFAULT" }, { "name": "peer-2", "interfaceName": "if-peer-2", "ipAddress": "169.254.20.1", "peerIpAddress": "169.254.20.2", "peerAsn": 64513, "advertisedRoutePriority": 99, "advertiseMode": "DEFAULT" }
What's next?
To view the base advertised route priority, see View Cloud Router details.
To troubleshoot issues when using Cloud Router, see Troubleshooting.