[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-05 (世界標準時間)。"],[],[],null,["# Delete an external peer VPN gateway\n\nThe following procedures enable you to delete an external peer VPN gateway\nresource for an HA VPN gateway. This resource represents\nyour physical or software-based gateway in Google Cloud.\n\nTo add an external peer VPN gateway resource, see\n[Configure the peer VPN gateway](/network-connectivity/docs/vpn/how-to/configuring-peer-gateway).\n\nBefore removing an external peer VPN gateway resource,\n[delete all associated VPN tunnels](/network-connectivity/docs/vpn/how-to/deleting-a-tunnel).\n\nTo delete an external peer VPN gateway resource, complete the following 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=peerGateways)\n2. Find the row that contains the **Peer gateway name** that you want to\n delete.\n\n3. Under **In use by VPN tunnels**, click the name of the tunnel to delete.\n\n4. On the **VPN tunnel details** page, at the top of the page, click\n **Delete**.\n\n5. On the **VPN tunnels** page, wait for the tunnel to be deleted.\n\n6. Click the **Peer VPN gateways** tab.\n\n7. Under **Peer gateway name**, find the row that contains the gateway that\n you want to delete.\n\n8. In that row, to delete the gateway, click\n more_vert**Actions** , then select\n **Delete**.\n\n9. In the confirmation dialog box, click **Delete**.\n\n10. To confirm that the gateway has been deleted, at the top of the page,\n click\n refresh**Refresh**.\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\"\u003eEXTERNAL_GATEWAY_NAME\u003c/var\u003e: the name of your external peer VPN gateway\n\nTo delete the gateway, follow these steps:\n\n1. Identify the name of the external peer 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 external-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 EXTERNAL_GATEWAY_NAME \\\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 external peer VPN gateway.\n\n ```\n gcloud compute external-vpn-gateways delete EXTERNAL_GATEWAY_NAME \\\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/externalVpnGateways/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[`externalVpnGateways.delete`](/compute/docs/reference/rest/v1/externalVpnGateways/delete)\nmethod: \n\n```\nDELETE https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/global/externalVpnGateways/EXTERNAL_GATEWAY_NAME\n```\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)."]]