Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Vuelve al modo de anuncio predeterminado
Si ya no necesitas anunciar ciertas subredes o rangos de IP personalizados, puedes volver al modo de anuncio predeterminado.
De forma predeterminada, Cloud Router anuncia todas las subredes disponibles, incluidas las nuevas. Para las sesiones de BGP, el comportamiento predeterminado es heredar el comportamiento del Cloud Router.
Antes de comenzar
gcloud
Si deseas usar los ejemplos de línea de comandos de esta guía, haz lo siguiente:
Selecciona el Cloud Router que contiene la sesión de BGP que quieres actualizar.
En la página Detalles del router, selecciona la sesión de BGP que quieres actualizar.
En la página de detalles de la sesión de BGP, haz clic en editEditar.
En Rutas, selecciona Anunciar todas las subredes visibles para Cloud Router (opción predeterminada).
Haz clic en Guardar para volver al modo de anuncio predeterminado.
gcloud
Ejecuta el comando update-bgp-peer y usa la marca --advertisement-mode para cambiar el modo de anuncio a default, como se muestra en el siguiente ejemplo:
Para una o más sesiones de BGP, usa el método routers.patch para actualizar el campo bgpPeers[].
El campo bgpPeers[] acepta un arreglo de pares de BGP. Cuando aplicas PATCH en este campo, reemplazarás el arreglo existente de pares de BGP por el arreglo nuevo incluido en tu solicitud.
Envía una solicitud PATCH con un array nuevo de pares BGP.
Para cada par de BGP que desees revertir al modo de anuncio predeterminado, haz lo siguiente:
Configura advertisedMode en DEFAULT.
Establece advertisedGroup[] y advertisedIpRanges[] en []
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-08-12 (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)."]]