# How to Destroy a NAT Gateway A Virtual Private Cloud (VPC) is a private network interface for collections of DigitalOcean resources. VPC networks are inaccessible from the public internet and other VPC networks, and traffic on them doesn’t count against bandwidth usage. You can link VPC networks to each other using VPC peering connections. Destroying a NAT gateway permanently and irreversibly deletes the gateway and terminates its connections. **Warning**: If you destroy a NAT gateway that is set as the default gateway for a VPC network, Droplets configured to route traffic through the VPC gateway IP lose connectivity. Before destroying a default NAT gateway, either set another NAT gateway as the default or update your Droplet routes to remove the gateway configuration. Read [How to Configure Droplets for NAT Gateway](https://docs.digitalocean.com/products/networking/vpc/how-to/configure-droplet-nat-gateway/index.html.md) for more information. Similarly, if you unset a NAT gateway as the default gateway without setting another NAT gateway as default, Droplets using the VPC gateway IP for routing lose connectivity. You must either set another NAT gateway as default or reconfigure your Droplets. ## Destroy a NAT Gateway Using the Command Line ## How to Destroy a NAT Gateway Using the DigitalOcean CLI 1. [Install `doctl`](https://docs.digitalocean.com/reference/doctl/how-to/install/index.html.md), the official DigitalOcean CLI. 2. [Create a personal access token](https://docs.digitalocean.com/reference/api/create-personal-access-token/index.html.md) and save it for use with `doctl`. 3. Use the token to grant `doctl` access to your DigitalOcean account. ```shell doctl auth init ``` 4. Finally, run `doctl compute vpc-nat-gateway delete`. Basic usage looks like this, but you can [read the usage docs](https://docs.digitalocean.com/reference/doctl/reference/compute/vpc-nat-gateway/delete/index.html.md) for more details: ```shell doctl compute vpc-nat-gateway delete [flags] ``` ## Destroy a NAT Gateway Using the API ## How to Destroy a NAT Gateway Using the DigitalOcean API 1. [Create a personal access token](https://docs.digitalocean.com/reference/api/create-personal-access-token/index.html.md) and save it for use with the API. 2. Send a DELETE request to [`https://api.digitalocean.com/v2/vpc_nat_gateways/{id}`](https://docs.digitalocean.com/reference/api/reference/vpc-nat-gateways/index.html.md#vpcnatgateways_delete). ### cURL Using cURL: ```shell curl -X DELETE \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ "https://api.digitalocean.com/v2/vpc_nat_gateways/a21d90fe-dc75-4097-993a-2dc7d1a8a438" ``` ## Destroy a NAT Gateway Using the Control Panel To destroy a NAT gateway, click **Networking** in the left menu, then click the **VPC** tab. Click on the VPC that contains the NAT gateway you want to destroy, then click its **NAT Gateway** tab. In the listing of the VPC’s NAT gateways, click the **…** menu of the NAT Gateway you want to destroy, then click **Destroy**. In the confirmation window, type the name of the NAT gateway to confirm, then click **Destroy NAT Gateway** to permanently destroy the NAT gateway and immediately terminate its connections. You can also destroy a NAT gateway from its **Settings** tab.