Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Reverter para o modo de divulgação padrão
Se você não precisar mais divulgar determinadas sub-redes ou intervalos de IP personalizados, poderá voltar ao modo de divulgação padrão.
Por padrão, o Cloud Router divulga todas as sub-redes
disponíveis, inclusive as
novas. Para as sessões do BGP, o comportamento padrão é herdar o comportamento do Cloud Router.
Antes de começar
gcloud
Para usar os exemplos de linha de comando deste guia:
Instale ou atualize para a versão mais recente da
Google Cloud CLI.
Na página Detalhes do Router, clique em
editEditar.
Na seção Rotas divulgadas, para Rotas, selecione
Divulgar todas as sub-redes visíveis para o Cloud Router (Padrão).
Clique em Salvar para reverter ao modo de divulgação padrão.
gcloud
Execute o comando update. Use a sinalização --advertisement-mode para
alterar o modo de divulgação para default, conforme mostrado no exemplo
a seguir:
Selecione o roteador do Cloud Router que contém a sessão do BGP a ser atualizada.
Na página Detalhes do Router, selecione a sessão do BGP a ser atualizada.
Na página de detalhes da sessão do BGP, clique em editEditar.
Em Rotas, selecione Divulgar todas as sub-redes visíveis para o Cloud Router (padrão).
Clique em Salvar para reverter ao modo de divulgação padrão.
gcloud
Execute o comando update-bgp-peer. Use a sinalização --advertisement-mode
para alterar o modo de divulgação para default, conforme mostrado no exemplo
a seguir:
Para uma ou mais sessões do BGP, use o método
routers.patch
para atualizar o campo bgpPeers[].
O campo bgpPeers[] aceita uma matriz de pares do BGP. Quando você PATCH esse campo,
você substitui a matriz atual de pares do BGP pela nova matriz
incluída na solicitação.
Envie uma solicitação PATCH com uma nova matriz de pares do BGP.
Para cada peering do BGP que você quer reverter para o modo de divulgação padrão, faça o seguinte:
Defina advertisedMode como DEFAULT
Defina advertisedGroup[] e advertisedIpRanges[] como [].
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-04-21 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)."]]