---
title: "ezgh compute network-gateways detach"
description: "Detach a network gateway from its VPC."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.ezghcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ezgh compute network-gateways detach

{/* Generated by ezgh-cli's internal/tools/clidocs from the ezgh command tree. Don't edit: change the command's help in ezgh-cli and regenerate. */}

```sh
ezgh compute network-gateways detach <gateway>
```

Detach a network gateway from its VPC (needs permission to update the VPC too). It's refused (gateway_in_use) while a public IPv4 address is mapped onto one of the VPC's network interfaces or one of them has a public IPv6 /64: disassociate those addresses and delete those interfaces first.

Part of [`ezgh compute network-gateways`](/cli/reference/compute-network-gateways).

## Flags

This command also takes the [global flags](/cli/reference#global-flags).

Source: https://docs.ezghcloud.com/cli/reference/compute-network-gateways-detach/index.mdx
