Deleting a VPN gateway
To delete an existing Cloud VPN gateway, do the following:
In the following commands, replace
[PROJECT_ID] with the ID of your
Identify the name and region of the VPN gateway you need to remove. You can list all VPN gateways with the following command. Once you identify the VPN gateway, replace
[REGION]with its name and region in the following steps.
gcloud compute target-vpn-gateways list --project [PROJECT_ID]
Determine if the VPN gateway has any VPN tunnels that need to be removed. Use the following command to list all tunnels associated with it:
gcloud compute target-vpn-gateways describe [NAME] \ --region [REGION] \ --project [PROJECT_ID] \ --format='flattened(tunnels)'
Determine the names of the three forwarding rules associated with the target VPN gateway.
gcloud compute target-vpn-gateways describe [NAME] \ --region [REGION] \ --project [PROJECT_ID] \ --format='flattened(forwardingRules)'
Delete the forwarding rules. Repeat this command, replacing
[FR_NAME]with the name of each forwarding rule:
gcloud compute forwarding-rules delete [FR_NAME] \ --region [REGION] \ --project [PROJECT_ID]
Delete the target VPN gateway.
gcloud compute target-vpn-gateways delete [NAME] \ --region [REGION] \ --project [PROJECT_ID]
After deleting a VPN gateway, consider doing the following:
- Review your firewall rules and delete the rules that you no longer need.
- You can delete the external IP address previously used by the VPN gateway.
- Learn about the basic concepts of Cloud VPN
- Create a custom Virtual Private Cloud network
- Set up different types of Cloud VPN
- Maintain VPN tunnels and gateways
- See Advanced Configurations for information on high-availability, high-throughput scenarios, or multiple subnet scenarios.
- Get troubleshooting help