Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Os procedimentos a seguir permitem que você exclua um gateway de VPN de alta disponibilidade ou um gateway de VPN clássica. A VPN de alta disponibilidade usa a opção de comando vpn-gateways
e a VPN clássica usa a opção de comando target-vpn-gateways.
Depois de excluir um gateway de VPN de alta disponibilidade, todos os recursos de gateway de peering que você criou ainda existirão.
Encontre a linha que contém o nome do gateway que você quer excluir.
Clique no nome do gateway.
Na página Detalhes do gateway da VPN do Google, em Túneis de VPN, marque as caixas de seleção ao lado dos túneis que você quer excluir.
Para excluir os túneis, clique em Excluir.
Na caixa de diálogo de confirmação, clique em Excluir.
Para excluir o gateway, clique em Excluir na parte superior da página.
Na caixa de diálogo de confirmação, clique em Excluir.
gcloud
Nos comandos a seguir, substitua:
PROJECT_ID: ID do projeto
GATEWAY_NAME: o nome do gateway da VPN.
REGION: a região onde seu gateway de VPN reside.
Para excluir o gateway, siga estas etapas:
Identifique o nome e a região do gateway da VPN que você quer excluir e use essas informações nas etapas posteriores. Para listar todos os gateways da VPN, execute o seguinte comando:
gcloud compute vpn-gateways list
--project=PROJECT_ID
Determine se o gateway da VPN tem algum túnel da VPN que precisa ser removido.
Para listar todos os túneis associados ao gateway, execute o seguinte comando:
Encontre a linha que contém o nome do gateway que você quer excluir.
Clique no nome do gateway.
Na página Detalhes do gateway da VPN do Google, em Túneis de VPN, marque as caixas de seleção ao lado dos túneis que você quer excluir.
Para excluir os túneis, clique em Excluir.
Na caixa de diálogo de confirmação, clique em Excluir.
Para excluir o gateway, clique em Excluir na parte superior da página.
Na caixa de diálogo de confirmação, clique em Excluir.
gcloud
Nos comandos a seguir, substitua:
PROJECT_ID: ID do projeto
GATEWAY_NAME: o nome do gateway da VPN.
REGION: a região onde seu gateway de VPN reside.
FR_NAME: o nome de cada regra de encaminhamento.
Para excluir o gateway, siga estas etapas:
Identifique o nome e a região do gateway da VPN que você quer excluir e use essas informações nas etapas posteriores. Para listar todos os gateways da VPN, execute o seguinte comando:
gcloud compute target-vpn-gateways list
--project=PROJECT_ID
Determine se o gateway da VPN tem algum túnel da VPN que precisa ser removido.
Para listar todos os túneis associados ao gateway, execute o seguinte comando:
[[["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,["# Delete a VPN gateway\n\nThe following procedures enable you to delete an HA VPN gateway\nor a Classic VPN gateway. HA VPN uses the\n`vpn-gateways` command option, and Classic VPN uses the\n`target-vpn-gateways` command option.\n\nAfter you delete an HA VPN gateway, any peer gateway\nresources that you created still exist.\n\nBefore removing a Cloud VPN gateway,\n[delete all associated VPN tunnels](/network-connectivity/docs/vpn/how-to/deleting-a-tunnel).\n\nDelete an HA VPN gateway\n------------------------\n\nTo delete an existing HA VPN gateway, complete the\nfollowing steps.\n\n#### Permissions required for this task\n\nTo perform this task, you must have been granted the following permissions\n*or* the following IAM roles.\n\n**Permissions**\n\n- `compute.vpnGateways.get`\n- `compute.vpnGateways.list`\n- `compute.externalVpnGateways.get`\n- `compute.externalVpnGateways.list`\n- `compute.vpnGateways.create`\n- `compute.vpnGateways.delete`\n- `compute.vpnGateways.get`\n- `compute.vpnGateways.list`\n- `compute.vpnGateways.use`\n- `compute.vpnGateways.setLabels`\n- `compute.externalVpnGateways.create`\n- `compute.externalVpnGateways.delete`\n- `compute.externalVpnGateways.get`\n- `compute.externalVpnGateways.list`\n- `compute.externalVpnGateways.use`\n- `compute.externalVpnGateways.setLabels`\n\n**Roles**\n\n- `roles/compute.networkAdmin` \n\n### Console\n\n1. In the Google Cloud console, go to the **VPN** page.\n\n [Go to VPN](https://console.cloud.google.com/hybrid/vpn/list?tab=gateways)\n2. Find the row that contains the **Gateway name** that you want to delete.\n\n3. Click the **Gateway name**.\n\n4. On the **Google VPN gateway details** page, under **VPN tunnels**,\n select the checkboxes next to the tunnels that you want to delete.\n\n5. To delete the tunnels, click **Delete**.\n\n6. In the confirmation dialog box, click **Delete**.\n\n7. To delete the gateway, at the top of the page, click **Delete**.\n\n8. In the confirmation dialog box, click **Delete**.\n\n### gcloud\n\nIn the following commands, replace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of your project\n- \u003cvar translate=\"no\"\u003eGATEWAY_NAME\u003c/var\u003e: the name of your VPN gateway\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: the region where your VPN gateway resides\n\nTo delete the gateway, follow these steps:\n\n1. Identify the name and region of the VPN gateway that you want\n to delete, and then use that information in later steps. To list all VPN\n gateways, run the following command:\n\n ```\n gcloud compute vpn-gateways list\n --project=PROJECT_ID\n ```\n2. Determine if the VPN gateway has any VPN tunnels that need to be deleted.\n To list all tunnels associated with the gateway, run the following\n command:\n\n ```\n gcloud compute vpn-gateways describe GATEWAY_NAME \\\n --region=REGION \\\n --project=PROJECT_ID \\\n --format='flattened(tunnels)'\n ```\n3. [Delete each existing tunnel](/network-connectivity/docs/vpn/how-to/deleting-a-tunnel).\n\n4. Delete the VPN gateway:\n\n ```\n gcloud compute vpn-gateways delete GATEWAY_NAME \\\n --region=REGION \\\n --project=PROJECT_ID\n ```\n\n### API\n\nTo delete tunnels first, make a DELETE request by using the\n[`vpnTunnels.delete`](/compute/docs/reference/rest/v1/vpnTunnels/delete)\nmethod: \n\n```\nDELETE https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/vpnTunnels/TUNNEL_NAME\n```\n\nMake a DELETE request by using the\n[`vpnGateways.delete`](/compute/docs/reference/rest/v1/vpnGateways/delete)\nmethod: \n\n```\nDELETE https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/vpnGateways/GATEWAY_NAME\n```\n\nDelete a Classic VPN gateway\n----------------------------\n\n| **Warning:** Certain Classic VPN dynamic routing functionality is deprecated. For more information, see [Classic VPN dynamic routing partial deprecation](/network-connectivity/docs/vpn/deprecations/classic-vpn-deprecation).\n\nTo delete an existing Classic VPN gateway, complete the\nfollowing steps.\n\n#### Permissions required for this task\n\nTo perform this task, you must have been granted the following permissions\n*or* the following IAM roles.\n\n**Permissions**\n\n- `compute.vpnGateways.get`\n- `compute.vpnGateways.list`\n- `compute.externalVpnGateways.get`\n- `compute.externalVpnGateways.list`\n- `compute.vpnGateways.create`\n- `compute.vpnGateways.delete`\n- `compute.vpnGateways.get`\n- `compute.vpnGateways.list`\n- `compute.vpnGateways.use`\n- `compute.vpnGateways.setLabels`\n- `compute.externalVpnGateways.create`\n- `compute.externalVpnGateways.delete`\n- `compute.externalVpnGateways.get`\n- `compute.externalVpnGateways.list`\n- `compute.externalVpnGateways.use`\n- `compute.externalVpnGateways.setLabels`\n\n**Roles**\n\n- `roles/compute.networkAdmin` \n\n### Console\n\n1. In the Google Cloud console, go to the **VPN** page.\n\n [Go to VPN](https://console.cloud.google.com/hybrid/vpn/list?tab=gateways)\n2. Find the row that contains the **Gateway name** that you want to delete.\n\n3. Click the **Gateway name**.\n\n4. On the **Google VPN gateway details** page, under **VPN tunnels**,\n select the checkboxes next to the tunnels that you want to delete.\n\n5. To delete the tunnels, click **Delete**.\n\n6. In the confirmation dialog box, click **Delete**.\n\n7. To delete the gateway, at the top of the page, click **Delete**.\n\n8. In the confirmation dialog box, click **Delete**.\n\n| **Note:** Using the Google Cloud console to delete a VPN gateway removes the three associated forwarding rules and the target VPN gateway object. The regional external IP address remains in your project, so it can be re-used or deleted separately.\n\n### gcloud\n\nIn the following commands, replace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of your project\n- \u003cvar translate=\"no\"\u003eGATEWAY_NAME\u003c/var\u003e: the name of your VPN gateway\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: the region where your VPN gateway resides\n- \u003cvar translate=\"no\"\u003eFR_NAME\u003c/var\u003e: the name of each forwarding rule\n\nTo delete the gateway, follow these steps:\n\n1. Identify the name and region of the VPN gateway that you want\n to delete, and then use that information in later steps. To list all VPN\n gateways, run the following command:\n\n ```\n gcloud compute target-vpn-gateways list\n --project=PROJECT_ID\n ```\n2. Determine if the VPN gateway has any VPN tunnels that need to be deleted.\n To list all tunnels associated with the gateway, run the following\n command:\n\n ```\n gcloud compute target-vpn-gateways describe GATEWAY_NAME \\\n --region=REGION \\\n --project=PROJECT_ID \\\n --format='flattened(tunnels)'\n ```\n3. [Delete each existing tunnel](/network-connectivity/docs/vpn/how-to/deleting-a-tunnel).\n\n4. Determine the names of the three forwarding rules associated with the\n target VPN gateway:\n\n ```\n gcloud compute target-vpn-gateways describe GATEWAY_NAME \\\n --region=REGION \\\n --project=PROJECT_ID \\\n --format='flattened(forwardingRules)'\n ```\n5. Delete the forwarding rules; repeat this command for each forwarding rule:\n\n ```\n gcloud compute forwarding-rules delete FR_NAME \\\n --region=REGION \\\n --project=PROJECT_ID\n ```\n6. Delete the target VPN gateway:\n\n ```\n gcloud compute target-vpn-gateways delete GATEWAY_NAME \\\n --region=REGION \\\n --project=PROJECT_ID\n ```\n\n### API\n\nTo delete tunnels first, make a DELETE request by using the\n[`vpnTunnels.delete`](/compute/docs/reference/rest/v1/vpnTunnels/delete)\nmethod: \n\n```\nDELETE https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/vpnTunnels/TUNNEL_NAME\n```\n\nMake a DELETE request by using the\n[`targetVpnGateways.delete`](/compute/docs/reference/rest/v1/targetVpnGateways/delete)\nmethod: \n\n```\nDELETE https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/targetVpnGateways/GATEWAY_NAME\n```\n\nRecommended follow-up\n---------------------\n\nAfter deleting a VPN gateway, consider doing the following:\n\n- Review your firewall rules and [delete the\n rules](/vpc/docs/using-firewalls#deleting_firewall_rules) that you no longer need.\n- For Classic VPN, you can [delete the external IP\n address](/sdk/gcloud/reference/compute/addresses/delete) previously used by the VPN gateway.\n\nWhat's next\n-----------\n\n- To view Cloud Logging and Monitoring information, see [View logs and metrics](/network-connectivity/docs/vpn/how-to/viewing-logs-metrics).\n- To use high-availability and high-throughput scenarios or multiple subnet scenarios, see [Advanced configurations](/network-connectivity/docs/vpn/concepts/advanced).\n- To help you solve common issues that you might encounter when using Cloud VPN, see [Troubleshooting](/network-connectivity/docs/vpn/support/troubleshooting)."]]