Delete a VPN gateway

The following procedures enable you to delete an HA VPN gatewayor a Classic VPN gateway. HA VPN uses thevpn-gateways command option, and Classic VPN uses thetarget-vpn-gateways command option.

After you delete an HA VPN gateway, any peer gatewayresources that you created still exist.

Before removing a Cloud VPN gateway,delete all associated VPN tunnels.

Delete an HA VPN gateway

To delete an existing HA VPN gateway, complete thefollowing steps.

Permissions required for this task

To perform this task, you must have been granted the following permissionsor the following IAM roles.

Permissions

  • compute.vpnGateways.get
  • compute.vpnGateways.list
  • compute.vpnGateways.create
  • compute.vpnGateways.delete
  • compute.vpnGateways.use
  • compute.vpnGateways.setLabels
  • compute.externalVpnGateways.get
  • compute.externalVpnGateways.list
  • compute.externalVpnGateways.create
  • compute.externalVpnGateways.delete
  • compute.externalVpnGateways.use
  • compute.externalVpnGateways.setLabels

Roles

  • roles/compute.networkAdmin

Console

  1. In the Google Cloud console, go to theVPN page.

    Go to VPN

  2. Find the row that contains theGateway name that you want to delete.

  3. Click theGateway name.

  4. On theGoogle VPN gateway details page, underVPN tunnels,select the checkboxes next to the tunnels that you want to delete.

  5. To delete the tunnels, clickDelete.

  6. In the confirmation dialog box, clickDelete.

  7. To delete the gateway, at the top of the page, clickDelete.

  8. In the confirmation dialog box, clickDelete.

gcloud

In the following commands, replace the following:

  • PROJECT_ID: the ID of your project
  • GATEWAY_NAME: the name of your VPN gateway
  • REGION: the region where your VPN gateway resides

To delete the gateway, follow these steps:

  1. Identify the name and region of the VPN gateway that you wantto delete, and then use that information in later steps. To list all VPNgateways, run the following command:

    gcloud compute vpn-gateways list   --project=PROJECT_ID
  2. Determine if the VPN gateway has any VPN tunnels that need to be deleted.To list all tunnels associated with the gateway, run the followingcommand:

    gcloud compute vpn-gateways describeGATEWAY_NAME \   --region=REGION \   --project=PROJECT_ID \   --format='flattened(tunnels)'
  3. Delete each existing tunnel.

  4. Delete the VPN gateway:

    gcloud compute vpn-gateways deleteGATEWAY_NAME \   --region=REGION \   --project=PROJECT_ID

API

To delete tunnels first, make a DELETE request by using thevpnTunnels.deletemethod:

DELETE https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/vpnTunnels/TUNNEL_NAME

Make a DELETE request by using thevpnGateways.deletemethod:

DELETE https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/vpnGateways/GATEWAY_NAME

Delete a Classic VPN gateway

Warning: Certain Classic VPN dynamic routing functionality is deprecated. For more information, see Classic VPN dynamic routing partial deprecation.

To delete an existing Classic VPN gateway, complete thefollowing steps.

Permissions required for this task

To perform this task, you must have been granted the following permissionsor the following IAM roles.

Permissions

  • compute.vpnGateways.get
  • compute.vpnGateways.list
  • compute.externalVpnGateways.get
  • compute.externalVpnGateways.list
  • compute.vpnGateways.create
  • compute.vpnGateways.delete
  • compute.vpnGateways.get
  • compute.vpnGateways.list
  • compute.vpnGateways.use
  • compute.vpnGateways.setLabels
  • compute.externalVpnGateways.create
  • compute.externalVpnGateways.delete
  • compute.externalVpnGateways.get
  • compute.externalVpnGateways.list
  • compute.externalVpnGateways.use
  • compute.externalVpnGateways.setLabels

Roles

  • roles/compute.networkAdmin

Console

  1. In the Google Cloud console, go to theVPN page.

    Go to VPN

  2. Find the row that contains theGateway name that you want to delete.

  3. Click theGateway name.

  4. On theGoogle VPN gateway details page, underVPN tunnels,select the checkboxes next to the tunnels that you want to delete.

  5. To delete the tunnels, clickDelete.

  6. In the confirmation dialog box, clickDelete.

  7. To delete the gateway, at the top of the page, clickDelete.

  8. In the confirmation dialog box, clickDelete.

Note: Using the Google Cloud console to delete a VPN gateway removesthe three associated forwarding rules and the target VPN gateway object. Theregional external IP address remains in your project, so it can be re-usedor deleted separately.

gcloud

In the following commands, replace the following:

To delete the gateway, follow these steps:

  1. Identify the name and region of the VPN gateway that you wantto delete, and then use that information in later steps. To list all VPNgateways, run the following command:

    gcloud compute target-vpn-gateways list   --project=PROJECT_ID
  2. Determine if the VPN gateway has any VPN tunnels that need to be deleted.To list all tunnels associated with the gateway, run the followingcommand:

    gcloud compute target-vpn-gateways describeGATEWAY_NAME \   --region=REGION \   --project=PROJECT_ID \   --format='flattened(tunnels)'
  3. Delete each existing tunnel.

  4. Determine the names of the three forwarding rules associated with thetarget VPN gateway:

    gcloud compute target-vpn-gateways describeGATEWAY_NAME \   --region=REGION \   --project=PROJECT_ID \   --format='flattened(forwardingRules)'
  5. Delete the forwarding rules; repeat this command for each forwarding rule:

    gcloud compute forwarding-rules deleteFR_NAME \   --region=REGION \   --project=PROJECT_ID
  6. Delete the target VPN gateway:

    gcloud compute target-vpn-gateways deleteGATEWAY_NAME \   --region=REGION \   --project=PROJECT_ID

API

To delete tunnels first, make a DELETE request by using thevpnTunnels.deletemethod:

DELETE https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/vpnTunnels/TUNNEL_NAME

Make a DELETE request by using thetargetVpnGateways.deletemethod:

DELETE https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/targetVpnGateways/GATEWAY_NAME

Recommended follow-up

After deleting a VPN gateway, consider doing the following:

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-15 UTC.