Update the base route priority

When you configure a Border Gateway Protocol (BGP) session on aCloud Router, you can specify a base advertised priority. Before youbegin, ensure that you are familiar with the Cloud RouterAdvertisedroutes overview.For more information about how Cloud Router uses the base advertisedpriority, seeAdvertisedpriority.

Base priorities are whole numbers from0 to65535. The highest possible basepriority is0. The default base priority is100. If you don't specify a basepriority, the default priority is used.

Base priorities let you specify which Cloud VPN tunnels orCloud Interconnect VLAN attachments on-premises systems to use to sendpackets to your VPC network. You can create active-active,active-passive, or a custom combination of these topologies by using the basepriority to influence how packets are sent to your VPC network.For an example using HA VPN tunnels, seeActive-activeand active-passive routing options forHA VPNin the Cloud VPN documentation.

When choosing base priorities, keep the following in mind:

  • Region-to-region costs are between201 and9999, inclusive. The valuedepends on the distance, latency, and other factors between two regions.Google generates the region-to-region cost values, and you can't modifythem.

  • Base priorities among Cloud Routers in a region are recommended tobe between0 and200, inclusive. Because region-to-region costs are atleast201, if you use base priorities of201 or more, you mightaccidentally assign a Cloud VPN tunnel or VLAN attachment a lowerpriority than you intend. Another BGP session in a different region mightadvertise the same prefix with an overall higher priority (MED, which equalsbase priority plus region-to-region cost). Without carefully setting basepriorities in other regions, you might cause on-premises traffic to bedelivered to your VPC network by way of an unexpectedCloud VPN tunnel or VLAN attachment.

  • Base priorities of10200 or more help ensure that a prefix's overalladvertised priority (MED, base priority plus region-to-region cost) isalways lower than any other advertised prefix with a base priority of200or less.

To update the base advertised route priority for an existing BGP session,follow these steps.

Console

For Cloud VPN tunnels that use dynamic routing, includingHA VPN tunnels, complete the following steps:

  1. In the Google Cloud console, go to theCloud VPN tunnels page.

    Go to Cloud VPN tunnels

  2. From the list of tunnels in theName column, select thetunnel that you want to modify.

  3. On theCloud VPN tunnel details page, selectModify BGP session.

  4. Modify theAdvertised route priority value.

  5. ClickSave and continue.

For Dedicated Interconnect or Partner Interconnect,complete the following steps:

  1. In the Google Cloud console, go to theVLAN attachments tab on theCloud Interconnect page.

    Go to Cloud Interconnect

  2. From the list of attachments in theName column, select theattachment that you want to modify.

  3. On theVLAN attachment details page, select the name of theBGP session.

  4. Modify theAdvertised route priority value.

  5. ClickSave and continue.

gcloud

Run theupdate-bgp-peer command using the--advertised-route-priority flag. Specify the name of theCloud Router and BGP session that correspond to the appropriateCloud VPN tunnel or VLAN attachment.

gcloud compute routers update-bgp-peerROUTER_NAME \    --peer-name=NAME_OF_BGP_SESSION \    --advertised-route-priority=BASE_PRIORITY_VALUE

API

Use therouters.patchmethod to update thebgpPeers[] field.

ThebgpPeers[] field accepts an array of BGP peers. When youPATCH thisfield, you overwrite the existing array of BGP peers with the new arrayincluded in your request.

  1. Send aGET request to get the current array of BGP peers for the router.For details, seeView BGP session configuration.

  2. Send aPATCH 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 theCloud Router
    • REGION: the region where the Cloud Routeris located
    • ROUTER_NAME: the name of the Cloud Router
    • BGP_PEERS: the contents of the new array of BGP peers

    The following example includes one BGP peer with the defaultadvertisedRoutePriority of100 and another with an updated valueof99:

        {      "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?

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-19 UTC.