[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-12。"],[],[],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)."]]