Organízate con las colecciones
Guarda y clasifica el contenido según tus preferencias.
Los siguientes procedimientos te permiten eliminar una pasarela de VPN de alta disponibilidad o una pasarela de VPN clásica. La VPN de alta disponibilidad usa la opción de comando vpn-gateways, mientras que la VPN clásica usa la opción de comando target-vpn-gateways.
Después de eliminar una pasarela de VPN de alta disponibilidad, los recursos de la pasarela de par que hayas creado seguirán existiendo.
Busca la fila que contenga el nombre de la pasarela que quieras eliminar.
Haz clic en el nombre de la pasarela.
En la página Detalles de la pasarela VPN de Google, en Túneles VPN, marca las casillas situadas junto a los túneles que quieras eliminar.
Para eliminar los túneles, haz clic en Eliminar.
En el cuadro de diálogo de confirmación, haga clic en Eliminar.
Para eliminar la pasarela, en la parte superior de la página, haz clic en Eliminar.
En el cuadro de diálogo de confirmación, haga clic en Eliminar.
gcloud
En los siguientes comandos, sustituye lo siguiente:
PROJECT_ID: el ID de tu proyecto
GATEWAY_NAME: el nombre de tu pasarela VPN
REGION: la región en la que se encuentra tu pasarela VPN
Para eliminar la pasarela, sigue estos pasos:
Identifica el nombre y la región de la pasarela de VPN que quieres eliminar y, a continuación, usa esa información en los pasos posteriores. Para enumerar todas las pasarelas VPN, ejecuta el siguiente comando:
gcloud compute vpn-gateways list
--project=PROJECT_ID
Determina si la pasarela VPN tiene túneles VPN que deban eliminarse.
Para enumerar todos los túneles asociados a la pasarela, ejecuta el siguiente comando:
Busca la fila que contenga el nombre de la pasarela que quieras eliminar.
Haz clic en el nombre de la pasarela.
En la página Detalles de la pasarela VPN de Google, en Túneles VPN, marca las casillas situadas junto a los túneles que quieras eliminar.
Para eliminar los túneles, haz clic en Eliminar.
En el cuadro de diálogo de confirmación, haga clic en Eliminar.
Para eliminar la pasarela, en la parte superior de la página, haz clic en Eliminar.
En el cuadro de diálogo de confirmación, haga clic en Eliminar.
gcloud
En los siguientes comandos, sustituye lo siguiente:
PROJECT_ID: el ID de tu proyecto
GATEWAY_NAME: el nombre de tu pasarela VPN
REGION: la región en la que se encuentra tu pasarela VPN
FR_NAME: el nombre de cada regla de reenvío
Para eliminar la pasarela, sigue estos pasos:
Identifica el nombre y la región de la pasarela de VPN que quieres eliminar y, a continuación, usa esa información en los pasos posteriores. Para enumerar todas las pasarelas VPN, ejecuta el siguiente comando:
gcloud compute target-vpn-gateways list
--project=PROJECT_ID
Determina si la pasarela VPN tiene túneles VPN que deban eliminarse.
Para enumerar todos los túneles asociados a la pasarela, ejecuta el siguiente comando:
[[["Es fácil de entender","easyToUnderstand","thumb-up"],["Me ofreció una solución al problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Es difícil de entender","hardToUnderstand","thumb-down"],["La información o el código de muestra no son correctos","incorrectInformationOrSampleCode","thumb-down"],["Me faltan las muestras o la información que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-11 (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)."]]