LinuxCommandLibrary

openstack-network

Manage OpenStack network resources

TLDR

List all networks

$ openstack network list
copy

Show details of a network
$ openstack network show [network_id_or_name]
copy

Create a new network with a given name
$ openstack network create [network_name]
copy

Delete a network
$ openstack network delete [network_id_or_name]
copy

Enable a network
$ openstack network set --enable [network_id_or_name]
copy

Disable a network
$ openstack network set --disable [network_id_or_name]
copy

SYNOPSIS

openstack network <subcommand> [options] [arguments]

PARAMETERS

<subcommand>
    Specifies the particular networking operation to perform. Common subcommands include create (to provision new networks), list (to view existing resources), show (to display details of a specific resource), set (to modify properties), delete (to remove resources), agent (to manage network agents), router (to manage routers), port (to manage network ports), subnet (to manage IP subnets), and floating ip (to manage public IP addresses). Each subcommand has its own set of specific options and arguments.

--help
    Displays a help message for the command or subcommand, detailing available options, common usage patterns, and examples. Using `openstack help network` provides an overview of network subcommands, while `openstack help network ` gives specific help.

--debug
    Enables verbose debug output, which is invaluable for troubleshooting by displaying detailed information about API requests, responses, and internal client operations.

--os-cloud <cloud_name>
    Specifies a named cloud configuration to use, as defined in the `clouds.yaml` file (typically located in `~/.config/openstack/clouds.yaml` or `/etc/openstack/clouds.yaml`). This simplifies authentication and endpoint discovery.

--os-auth-url <url>
    The full authentication URL for the OpenStack Identity service (Keystone). This is a fundamental piece of information for the client to connect to the cloud. It can also be set via an environment variable.

--os-project-name <name>
    The name of the project (tenant) within which the operation should be performed. OpenStack resources are typically scoped to a specific project. This can also be set via an environment variable.

--os-username <username>
    The username for authenticating against the OpenStack Identity service. This is usually set via an environment variable to avoid exposing credentials on the command line.

DESCRIPTION

The `openstack network` command provides a comprehensive interface for managing networking resources within an OpenStack cloud environment. It is a vital part of the unified OpenStack command-line client, enabling users and administrators to programmatically interact with the Neutron (OpenStack Networking) service. This includes a wide array of operations such as creating, listing, showing details of, updating, and deleting networks, subnets, ports, routers, security groups, floating IPs, and more. It allows for detailed configuration of virtual network topologies, IP addressing schemes, and access control rules, facilitating the robust deployment and management of virtual network infrastructure essential for virtual machines and other cloud resources. The commands allow fine-grained control over network segmentation, routing, and external connectivity.

CAVEATS

The command `openstack-network` is not a standalone executable. Instead, it refers to the collection of networking operations performed using the openstack unified command-line client, specifically by invoking the network subcommand (e.g., openstack network create, openstack network list).

Effective use requires a properly configured OpenStack environment, which typically involves setting environment variables (like OS_CLOUD, OS_AUTH_URL, OS_USERNAME, OS_PASSWORD, OS_PROJECT_NAME) or having a valid `clouds.yaml` configuration file.

User permissions within OpenStack are paramount; operations will fail if the authenticated user lacks the necessary roles or policies to perform the requested networking action.

UNIFIED CLI STRUCTURE

The `openstack` client is designed with a hierarchical command structure. `network` acts as a top-level subcommand, grouping all operations related to OpenStack Networking. To perform an action, you combine `openstack`, the service subcommand (`network`), and then the specific operation (e.g., `create`, `list`, `delete`). This structure ensures consistency across all OpenStack services.

ENVIRONMENT VARIABLES & CONFIGURATION

Most `openstack` commands, including `network` operations, rely heavily on environment variables (e.g., `OS_AUTH_URL`, `OS_USERNAME`, `OS_PROJECT_NAME`, `OS_PASSWORD`, `OS_REGION_NAME`, `OS_IDENTITY_API_VERSION`) or a `clouds.yaml` configuration file for authentication, endpoint discovery, and region selection. It is crucial to have these configured correctly before attempting to run `openstack network` commands to ensure proper connection to your OpenStack cloud.

HISTORY

OpenStack's networking service, Neutron (originally named Quantum), provides the underlying infrastructure for these commands. Historically, OpenStack users interacted with networking services using the dedicated `neutronclient` CLI. However, with the evolution of OpenStack and its unified client, the `openstack` command-line tool, introduced around the Mitaka/Newton releases, consolidated all service interactions under a single interface. The `openstack network` subcommands thus replaced and absorbed the functionalities of the older `neutronclient`, providing a more consistent and streamlined user experience for managing all OpenStack resources.

SEE ALSO

openstack(1), neutron(1), ip(8), bridge(8)

Copied to clipboard