Pilih kotak centang di sebelah tunnel VPN yang ingin dihapus.
Di bagian atas halaman, klik Delete.
Saat Anda menggunakan konsol Google Cloud untuk menghapus tunnel VPN,
Google Cloud juga akan menghapus sesi Border Gateway Protocol (BGP) apa pun
yang terkait dengan tunnel VPN.
Untuk mengonfirmasi penghapusan, klik Hapus lagi.
Opsional: Untuk mengonfirmasi bahwa sesi BGP yang terkait dengan tunnel
VPN telah dihapus, buka halaman detail Cloud Router.
Untuk mengetahui informasi selengkapnya, lihat
Melihat detail Cloud Router.
gcloud
Dalam perintah berikut, ganti kode berikut:
PROJECT_ID: ID project Anda
TUNNEL_NAME: nama tunnel Anda
REGION: region tempat tunnel Anda berada
Untuk menghapus tunnel, ikuti langkah-langkah berikut:
Identifikasi nama dan region tunnel VPN yang ingin dihapus,
lalu gunakan informasi tersebut pada langkah berikutnya. Untuk melihat daftar semua tunnel VPN
di project Anda, jalankan perintah berikut:
gcloud compute vpn-tunnels list
--project=PROJECT_ID
Untuk menghapus tunnel VPN, jalankan perintah berikut:
.Saat Anda menggunakan Google Cloud CLI untuk menghapus tunnel VPN,
perintah tersebut tidak otomatis menghapus sesi BGP yang
dikonfigurasi untuk tunnel VPN.
Opsional: Untuk menghapus sesi BGP yang terkait dengan tunnel VPN,
VPN, gunakan perintah
gcloud compute routers remove-bgp-peer. Untuk mengetahui petunjuknya, lihat
Menghapus sesi BGP.
Untuk memverifikasi bahwa sesi BGP telah dihapus, buka
halaman detail Cloud Router di konsol Google Cloud , atau jalankan
perintah gcloud compute routers describe untuk
Cloud Router.
Untuk mengetahui petunjuknya, lihat
Melihat detail Cloud Router.
API
Untuk menghapus tunnel, ikuti langkah-langkah berikut:
Saat Anda menggunakan Cloud VPN API untuk menghapus tunnel VPN,
perintah API tidak akan menghapus sesi BGP apa pun yang terkait dengan
tunnel VPN.
Opsional: Untuk menghapus sesi BGP yang terkait dengan
tunnel VPN, gunakan metode
routers.patch
untuk memperbarui kolom bgpPeers[].
Untuk mengetahui petunjuknya, lihat
Menghapus sesi BGP.
Untuk memverifikasi bahwa sesi BGP Anda telah dihapus, buka
halaman detail Cloud Router di konsol Google Cloud , atau jalankan
perintah gcloud compute routers describe untuk
Cloud Router.
Untuk mengetahui petunjuknya, lihat
Melihat detail Cloud Router.
Tindak lanjut yang direkomendasikan
Setelah menghapus tunnel VPN, pertimbangkan hal berikut:
Tinjau aturan firewall Anda dan hapus
aturan yang tidak lagi
diperlukan.
Jika tunnel menggunakan pemilihan rute berbasis kebijakan VPN Klasik atau merupakan VPN berbasis rute, tinjau rute di jaringan Google CloudAnda. Hapus rute statis
yang tidak lagi diperlukan.
Jika Anda menggunakan konsol Google Cloud untuk menghapus tunnel bagi gateway VPN Klasik, rute statis yang dibuat secara otomatis seharusnya sudah dihapus. Jika Anda menggunakan
Google Cloud CLI untuk menghapus tunnel, atau membuat rute statis kustom
untuk tunnel, hapus tunnel tersebut secara manual.
Jika tidak ada lagi tunnel untuk gateway VPN yang terkait, Anda dapat menghapus
gateway VPN.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-12 UTC."],[],[],null,["# Delete a VPN tunnel\n\nThe following procedure applies to tunnels connected to either\nClassic VPN or HA VPN gateways.\n\nTo delete an existing Cloud VPN tunnel, 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\nTo delete the tunnel, follow these steps:\n\n1. In the Google Cloud console, go to the **VPN** page.\n\n [Go to VPN](https://console.cloud.google.com/vpn/list?tab=tunnels)\n2. Select the checkbox next to the VPN tunnel that you want to remove.\n\n3. At the top of the page, click **Delete**.\n\n When you use the Google Cloud console to delete a VPN tunnel,\n Google Cloud also deletes any Border Gateway Protocol (BGP) sessions\n associated with the VPN tunnel.\n4. To confirm deletion, click **Delete** again.\n\n5. Optional: To confirm that the BGP sessions associated with the VPN\n tunnel are deleted, go to the Cloud Router details page.\n For more information, see\n [View Cloud Router details](/network-connectivity/docs/router/how-to/viewing-router-details).\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\"\u003eTUNNEL_NAME\u003c/var\u003e: the name of your tunnel\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: the region where your tunnel resides\n\nTo delete the tunnel, follow these steps:\n\n1. Identify the name and region of the VPN tunnel that you want to delete,\n and then use that information in the next step. To list all VPN tunnels\n in your project, run the following command:\n\n ```\n gcloud compute vpn-tunnels list\n --project=PROJECT_ID\n ```\n2. To delete the VPN tunnel, run the following command:\n\n ```\n gcloud compute vpn-tunnels delete TUNNEL_NAME \\\n --region=REGION \\\n --project=PROJECT_ID\n ```\n\n When you use Google Cloud CLI to delete a VPN tunnel,\n the command does not automatically delete the BGP sessions that are\n configured for the VPN tunnel.\n3. Optional: To delete the BGP sessions associated with the VPN tunnel,\n use the `gcloud compute routers remove-bgp-peer`\n command. For instructions, see\n [Remove a BGP session](/network-connectivity/docs/router/how-to/disabling-removing-bgp#remove_a_bgp_session).\n\n To verify that the BGP sessions are deleted, go to the\n Cloud Router details page in the Google Cloud console, or run the\n `gcloud compute routers describe` command for a\n Cloud Router.\n For instructions, see\n [View Cloud Router details](/network-connectivity/docs/router/how-to/viewing-router-details).\n\n### API\n\nTo delete the tunnel, follow these steps:\n\n1. Make a DELETE request by using the\n [`vpnTunnels.delete`](/compute/docs/reference/rest/v1/vpnTunnels/delete)\n method:\n\n ```\n DELETE https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/vpnTunnels/TUNNEL_NAME\n ```\n\n When you use the Cloud VPN API to delete a VPN tunnel,\n the API command does not delete any BGP sessions that are associated with the\n VPN tunnel.\n2. Optional: To delete the BGP sessions associated with\n the VPN tunnel, use the\n [`routers.patch`](/compute/docs/reference/rest/v1/routers/patch)\n method to update the `bgpPeers[]` field.\n For instructions, see\n [Remove a BGP session](/network-connectivity/docs/router/how-to/disabling-removing-bgp#remove_a_bgp_session).\n\n To verify that your BGP sessions are deleted, go to the\n Cloud Router details page in the Google Cloud console, or run the\n `gcloud compute routers describe` command for a\n Cloud Router.\n For instructions, see\n [View Cloud Router details](/network-connectivity/docs/router/how-to/viewing-router-details).\n\n### Recommended follow-up\n\nAfter deleting a VPN tunnel, consider the following:\n\n- Review your firewall rules and [delete the\n rules](/vpc/docs/using-firewalls#deleting_firewall_rules) that you no longer\n need.\n\n- If the tunnel used Classic VPN policy-based routing or was\n a route-based VPN, review the routes in your Google Cloud\n network. [Delete any static routes](/vpc/docs/using-routes#deletingaroute)\n that you no longer need.\n\n- If you used the Google Cloud console to delete the tunnel for a\n Classic VPN gateway, static routes that\n were automatically created should already be removed. If you used the\n Google Cloud CLI to remove the tunnel, or if you created custom static routes\n for it, delete those tunnels manually.\n\n- If no more tunnels exist for the associated VPN gateway, you can [delete the\n VPN gateway](/network-connectivity/docs/vpn/how-to/deleting-a-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)."]]