Stay organized with collections
Save and categorize content based on your preferences.
Revert to default advertisement mode
If you no longer need to advertise certain subnets or custom IP ranges, you
can revert back to default advertisement mode.
By default, the Cloud Router advertises all available
subnets, including new
ones. For BGP sessions, the default behavior is to inherit the
Cloud Router's behavior.
Before you begin
gcloud
If you want to use the command-line examples in this guide, do the following:
Install or update to the latest version of the
Google Cloud CLI.
For one or more BGP sessions, 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.
For each BGP peer that you want to revert to default advertisement mode,
do the following:
Set advertisedMode to DEFAULT
Set advertisedGroup[] and advertisedIpRanges[] to []
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-29 UTC."],[],[],null,["# Revert to default advertisement mode\n====================================\n\nIf you no longer need to advertise certain subnets or custom IP ranges, you\ncan revert back to [default advertisement mode](/network-connectivity/docs/router/concepts/overview#route-advertisement-default).\n| **Note:** When you revert to default advertisement mode, Cloud Router deletes the existing custom advertisement mode configuration. You must reconfigure custom advertised routes if you want use them again. If you clear custom advertisement mode on the Cloud Router, all of its BGP sessions still retain their custom advertised route configuration. To clear custom advertisement mode on the Cloud Router BGP sessions, you must individually revert each BGP session.\n\nBy default, the Cloud Router advertises all [available\nsubnets](/network-connectivity/docs/router/concepts/overview#dynamic-routing-mode), including new\nones. For BGP sessions, the default behavior is to inherit the\nCloud Router's behavior.\n\nBefore you begin\n----------------\n\n### gcloud\n\nIf you want to use the command-line examples in this guide, do the following:\n\n1. Install or update to the latest version of the [Google Cloud CLI](/compute/docs/gcloud-compute).\n2. Set a [default region and\n zone](/compute/docs/gcloud-compute#set_default_zone_and_region_in_your_local_client).\n\n### API\n\nIf you want to use the API examples in this guide, set up\n[API access](/compute/docs/api/prereqs).\n\nRevert to default advertisement mode on a Cloud Router\n------------------------------------------------------\n\nTo revert to default advertisement mode on a Cloud Router,\nfollow these steps. \n\n### Console\n\n1. In the Google Cloud console, go to the **Cloud Routers** page.\n\n [Go to Cloud Routers](https://console.cloud.google.com/hybrid/routers/list)\n2. Select the Cloud Router to update.\n\n3. On the **Router details** page, click\n edit**Edit**.\n\n4. In the **Advertised routes** section, for **Routes** , select\n **Advertise all subnets visible to the Cloud Router (Default)**.\n\n5. Click **Save** to revert to default advertisement mode.\n\n### gcloud\n\nRun the `update` command. Use the `--advertisement-mode` flag to\nchange the advertisement mode to `default`, as shown in the following\nexample: \n\n```\ngcloud compute routers update my-router \\\n --advertisement-mode default\n```\n| **Note:** BGP sessions with custom advertised routes retain their custom configurations. You must individually revert each BGP session.\n\n### API\n\nUse the\n[routers.patch](/compute/docs/reference/rest/v1/routers/patch)\nmethod to set `bgp.advertiseMode` to `DEFAULT` and clear the custom advertisement mode\nconfiguration: \n\n```\nPATCH https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/routers/ROUTER_NAME\n{\n \"bgp\": {\n \"advertiseMode\": \"DEFAULT\",\n \"advertisedGroups\": [],\n \"advertisedIpRanges\": []\n }\n}\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project that contains the Cloud Router\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: the region where the Cloud Router is located\n- \u003cvar translate=\"no\"\u003eROUTER_NAME\u003c/var\u003e: the name of the Cloud Router\n\nRevert to default advertisement mode on a BGP session\n-----------------------------------------------------\n\nTo revert to default advertisement mode on a BGP session,\nfollow these steps. \n\n### Console\n\n1. In the Google Cloud console, go to the **Cloud Routers** page.\n\n [Go to Cloud Routers](https://console.cloud.google.com/hybrid/routers/list)\n2. Select the Cloud Router that contains the BGP session to\n update.\n\n3. On the **Router details** page, select the BGP session to update.\n\n4. On the **BGP session details** page, click\n edit**Edit**.\n\n5. For **Routes** , select\n **Advertise all subnets visible to the Cloud Router (Default)**.\n\n6. Click **Save** to revert to default advertisement mode.\n\n### gcloud\n\nRun the `update-bgp-peer` command. Use the `--advertisement-mode` flag\nto change the advertisement mode to `default`, as shown in the following\nexample: \n\n```\ngcloud compute routers update-bgp-peer my-router \\\n --peer-name my-bgp-session \\\n --advertisement-mode default\n```\n\n### API\n\nFor one or more BGP sessions, use the\n[`routers.patch`](/compute/docs/reference/rest/v1/routers/patch)\nmethod to update the `bgpPeers[]` field.\n\nThe `bgpPeers[]` field accepts an array of BGP peers. When you `PATCH` this\nfield, you overwrite the existing array of BGP peers with the new array\nincluded in your request.\n\n1. Send a `GET` request to get the current array of BGP peers for the router.\n For details, see\n [View BGP session configuration](/network-connectivity/docs/router/how-to/viewing-router-details#bgp-configuration).\n\n2. Send a `PATCH` request with a new array of BGP peers.\n For each BGP peer that you want to revert to default advertisement mode,\n do the following:\n\n - Set `advertisedMode` to `DEFAULT`\n - Set `advertisedGroup[]` and `advertisedIpRanges[]` to `[]`\n\n ```\n PATCH https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/routers/ROUTER_NAME\n {\n \"bgpPeers\": [\n BGP_PEERS\n ]\n }\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project that contains the Cloud Router\n - \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: the region where the Cloud Router is located\n - \u003cvar translate=\"no\"\u003eROUTER_NAME\u003c/var\u003e: the name of the Cloud Router\n - \u003cvar translate=\"no\"\u003eBGP_PEERS\u003c/var\u003e: the contents of the new array of BGP peers\n\n The following example reverts two BGP sessions to default\n advertisement mode: \n\n ```\n {\n \"name\": \"peer-1\",\n \"interfaceName\": \"if-peer-1\",\n \"ipAddress\": \"169.254.10.1\",\n \"peerIpAddress\": \"169.254.10.2\",\n \"peerAsn\": 64512,\n \"advertisedRoutePriority\": 100,\n \"advertiseMode\": \"DEFAULT\",\n \"advertisedGroups\": [],\n \"advertisedIpRanges\": []\n },\n {\n \"name\": \"peer-2\",\n \"interfaceName\": \"if-peer-2\",\n \"ipAddress\": \"169.254.20.1\",\n \"peerIpAddress\": \"169.254.20.2\",\n \"peerAsn\": 64513,\n \"advertisedRoutePriority\": 100,\n \"advertiseMode\": \"DEFAULT\",\n \"advertisedGroups\": [],\n \"advertisedIpRanges\": []\n }\n ```\n\nWhat's next\n-----------\n\n- To view the configuration of a Cloud Router, its BGP sessions, and\n the routes that Cloud Router is advertising, see\n [View Cloud Router details](/network-connectivity/docs/router/how-to/viewing-router-details).\n\n- To troubleshoot issues with custom advertised routes, see\n [Troubleshooting](/network-connectivity/docs/router/resources/troubleshooting)."]]