openstack Verified current stable Not installed? Networking

Openstack / List All Subnets

List All Subnets

Lists all subnets available in the OpenStack environment.

$
Terminal
openstack subnet list

When To Use

During initial network setup or troubleshooting to assess subnet configurations.

Pro Tip

Use `--format json` for machine-readable output to automate parsing.

Anatomy of Output

Understanding the result

+--------------------------------------+---------------------------------+-------------------+--------+ Table Header

Defines the boundaries of the subnet listing.

| Subnet ID | Name | CIDR | Status | Column Names

Indicates the fields returned for each subnet.

| 1234abcd-5678-90ef-ghij-klmnopqrst | MySubnet | 10.0.0.0/24 | ACTIVE | Subnet Entry

Displays an example of a listed subnet and its details.

Troubleshooting

Common pitfalls

Error: No subnets found.

Solution: Ensure subnets are created in the OpenStack project.

Error: Permission denied for listing subnets.

Solution: Check role permissions for the currently authenticated user.

Error: Unable to contact the network service.

Solution: Ensure the OpenStack network service is operational.

Command Breakdown

What each part is doing

openstack
Base Command
The executable that performs this operation. Here it runs Openstack before the shell applies any redirect operators.

Alternative Approaches

Comparable commands in other tools

Alternative networking tools for the same job.