Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Le procedure riportate di seguito ti consentono di eliminare una risorsa gateway VPN peer esterno per un gateway VPN ad alta disponibilità. Questa risorsa rappresenta il tuo gateway fisico o basato su software in Google Cloud.
Trova la riga contenente il nome del gateway peer da eliminare.
In Utilizzato da tunnel VPN, fai clic sul nome del tunnel da eliminare.
Nella pagina Dettagli tunnel VPN, fai clic su Elimina nella parte superiore della pagina.
Nella pagina Tunnel VPN, attendi che il tunnel venga eliminato.
Fai clic sulla scheda Gateway VPN peer.
In Nome gateway peer, individua la riga contenente il gateway che vuoi eliminare.
In quella riga, per eliminare il gateway, fai clic su more_vertAzioni e poi seleziona Elimina.
Nella finestra di dialogo di conferma, fai clic su Elimina.
Per verificare che il gateway sia stato eliminato, fai clic su refreshAggiorna nella parte superiore della pagina.
gcloud
Nei seguenti comandi, sostituisci quanto segue:
PROJECT_ID: l'ID del progetto
EXTERNAL_GATEWAY_NAME: il nome del gateway VPN peer esterno
Per eliminare il gateway:
Identifica il nome del gateway VPN peer esterno che vuoi eliminare e utilizza queste informazioni nei passaggi successivi. Per elencare tutti i gateway VPN, esegui il seguente comando:
gcloud compute external-vpn-gateways list
--project=PROJECT_ID
Determina se il gateway VPN ha tunnel VPN che devono essere eliminati.
Per elencare tutti i tunnel associati al gateway, esegui il seguente
comando:
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-08 UTC."],[],[],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)."]]