Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Mit den folgenden Verfahren können Sie ein HA VPN-Gateway oder ein klassisches VPN-Gateway löschen. HA VPN verwendet die Befehlsoption vpn-gateways und das klassische VPN die Befehlsoption target-vpn-gateways.
Nachdem Sie ein HA VPN-Gateway gelöscht haben, sind alle von Ihnen erstellten Peer-Gateway-Ressourcen weiterhin vorhanden.
Ermitteln Sie die Zeile, die den Namen des Gateways enthält, das gelöscht werden soll.
Klicken Sie auf den Namen des Gateways.
Klicken Sie auf der Seite Details zum Google VPN-Gateway unter VPN-Tunnel das Kästchen neben den Tunneln an, die Sie löschen möchten.
Klicken Sie zum Löschen der Tunnel auf Löschen.
Klicken Sie im Bestätigungsdialogfeld auf Löschen.
Klicken Sie oben auf der Seite auf Löschen, um das Gateway zu löschen.
Klicken Sie im Bestätigungsdialogfeld auf Löschen.
gcloud
Ersetzen Sie in den aufgeführten Befehlen Folgendes:
PROJECT_ID: die Projekt-ID
GATEWAY_NAME: der Name Ihres VPN-Gateways
REGION: die Region, in der sich Ihr VPN-Gateway befindet
So löschen Sie das Gateway:
Ermitteln Sie den Namen und die Region des VPN-Gateways, das Sie löschen möchten, und verwenden Sie diese Informationen in späteren Schritten. Um alle VPN-Gateways aufzulisten, führen Sie den folgenden Befehl aus:
gcloud compute vpn-gateways list
--project=PROJECT_ID
Ermitteln Sie, ob das VPN-Gateway VPN-Tunnel hat, die gelöscht werden müssen.
Um alle mit dem Gateway verknüpften Tunnel aufzulisten, führen Sie den folgenden Befehl aus:
Ermitteln Sie die Zeile, die den Namen des Gateways enthält, das gelöscht werden soll.
Klicken Sie auf den Namen des Gateways.
Klicken Sie auf der Seite Details zum Google VPN-Gateway unter VPN-Tunnel das Kästchen neben den Tunneln an, die Sie löschen möchten.
Klicken Sie zum Löschen der Tunnel auf Löschen.
Klicken Sie im Bestätigungsdialogfeld auf Löschen.
Klicken Sie oben auf der Seite auf Löschen, um das Gateway zu löschen.
Klicken Sie im Bestätigungsdialogfeld auf Löschen.
gcloud
Ersetzen Sie in den aufgeführten Befehlen Folgendes:
PROJECT_ID: die Projekt-ID
GATEWAY_NAME: der Name Ihres VPN-Gateways
REGION: die Region, in der sich Ihr VPN-Gateway befindet
FR_NAME: der Name jeder Weiterleitungsregel
So löschen Sie das Gateway:
Ermitteln Sie den Namen und die Region des VPN-Gateways, das Sie löschen möchten, und verwenden Sie diese Informationen in späteren Schritten. Um alle VPN-Gateways aufzulisten, führen Sie den folgenden Befehl aus:
gcloud compute target-vpn-gateways list
--project=PROJECT_ID
Ermitteln Sie, ob das VPN-Gateway VPN-Tunnel hat, die gelöscht werden müssen.
Um alle mit dem Gateway verknüpften Tunnel aufzulisten, führen Sie den folgenden Befehl aus:
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-08-12 (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)."]]