Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Les procédures suivantes vous permettent de supprimer une passerelle VPN haute disponibilité ou une passerelle VPN classique. Utilisez l'option de commande vpn-gateways pour les VPN haute disponibilité et target-vpn-gateways pour les VPN classiques.
Une fois une passerelle VPN haute disponibilité supprimée, toutes les ressources des passerelles de pairs que vous avez créées restent disponibles.
Identifiez la ligne contenant le nom de la passerelle que vous souhaitez supprimer.
Cliquez sur le nom de la passerelle.
Sur la page Informations détaillées sur la passerelle VPN Google, sous Tunnels VPN, cochez les cases à cocher correspondant aux tunnels que vous souhaitez supprimer.
Pour supprimer les tunnels, cliquez sur Supprimer.
Dans la boîte de dialogue de confirmation, cliquez sur Supprimer.
Pour supprimer la passerelle, cliquez sur Supprimer en haut de la page.
Dans la boîte de dialogue de confirmation, cliquez sur Supprimer.
gcloud
Dans les commandes suivantes, remplacez les éléments suivants :
PROJECT_ID : ID de votre projet
GATEWAY_NAME : nom de votre passerelle VPN
REGION : région où réside votre passerelle VPN
Pour supprimer la passerelle, procédez comme suit :
Identifiez le nom et la région de la passerelle VPN que vous souhaitez supprimer, puis utilisez ces informations lors des prochaines étapes. Pour répertorier toutes les passerelles VPN, exécutez la commande suivante :
gcloud compute vpn-gateways list
--project=PROJECT_ID
Déterminez si la passerelle VPN comporte des tunnels VPN devant être supprimés.
Pour répertorier tous les tunnels associés à la passerelle, exécutez la commande suivante :
Identifiez la ligne contenant le nom de la passerelle que vous souhaitez supprimer.
Cliquez sur le nom de la passerelle.
Sur la page Informations détaillées sur la passerelle VPN Google, sous Tunnels VPN, cochez les cases à cocher correspondant aux tunnels que vous souhaitez supprimer.
Pour supprimer les tunnels, cliquez sur Supprimer.
Dans la boîte de dialogue de confirmation, cliquez sur Supprimer.
Pour supprimer la passerelle, cliquez sur Supprimer en haut de la page.
Dans la boîte de dialogue de confirmation, cliquez sur Supprimer.
gcloud
Dans les commandes suivantes, remplacez les éléments suivants :
PROJECT_ID : ID de votre projet
GATEWAY_NAME : nom de votre passerelle VPN
REGION : région où réside votre passerelle VPN
FR_NAME : nom de chaque règle de transfert
Pour supprimer la passerelle, procédez comme suit :
Identifiez le nom et la région de la passerelle VPN que vous souhaitez supprimer, puis utilisez ces informations lors des prochaines étapes. Pour répertorier toutes les passerelles VPN, exécutez la commande suivante :
gcloud compute target-vpn-gateways list
--project=PROJECT_ID
Déterminez si la passerelle VPN comporte des tunnels VPN devant être supprimés.
Pour répertorier tous les tunnels associés à la passerelle, exécutez la commande suivante :
Pour utiliser des scénarios à haute disponibilité et à haut débit, ou des scénarios à plusieurs sous-réseaux, consultez la section Configurations avancées.
Pour vous aider à résoudre les problèmes courants que vous pouvez rencontrer lors de l'utilisation de Cloud VPN, consultez la page Dépannage.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/08 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/08 (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)."]]