<a id="manage-subnets"></a>

# How to manage subnets

See also: [Subnet](https://documentation.ubuntu.com/juju/4.0/reference/subnet.md#subnet)

## List subnets

To view the subnets known to `juju`, run:

```text
juju subnets
```

### Example output

```default
subnets:
  172.31.0.0/20:
    type: ipv4
    provider-id: subnet-9b4ed4fc
    provider-network-id: vpc-54a7112e
    status: in-use
    space: alpha
    zones:
    * us-east-1c
  172.31.16.0/20:
    type: ipv4
    provider-id: subnet-eca389a6
    provider-network-id: vpc-54a7112e
    status: in-use
    space: alpha
    zones:
    * us-east-1a
...
```

See more: [juju subnets](https://documentation.ubuntu.com/juju/4.0/reference/juju-cli/list-of-juju-cli-commands/subnets.md#command-juju-subnets)

## Move a subnet to another space

For all providers other than MAAS, all subnets are initially in a default `alpha` space.
To move a subnet `172.31.16.0/20` to a different space, `db-space`, execute:

```text
juju move-to-space db-space 172.31.16.0/20
```

### Example output

```text

Subnet 172.31.16.0/20 moved from alpha to db-space

```

See more: [juju move-to-space](https://documentation.ubuntu.com/juju/4.0/reference/juju-cli/list-of-juju-cli-commands/move-to-space.md#command-juju-move-to-space)
