Create a project network

Create a project network for instance communication.

Before you begin

  • The administrator has created a project for you and has provided you with a clouds.yaml file for you to access the cloud.
  • The python-openstackclient package is on your workstation.
    $ dnf list installed python-openstackclient

Procedure

  1. Confirm that the system OS_CLOUD variable is set for your cloud:
    $ echo $OS_CLOUD
    my_cloud

    Reset the variable if necessary:

    $ export OS_CLOUD=my_other_cloud

    As an alternative, you can specify the cloud name by adding the --os-cloud <cloud_name> option each time you run an openstack command.

  2. Create a network.
    Example
    $ openstack network create my_network
    Tip
    • If you do not intend to enter the network into production immediately, you can add the --disable option to the create network command.
    • Consider naming your network for the role that the network provides. One example: webservers_122 is a network that host web servers and the VLAN ID is 122.

Results

  • Confirm that the network was added:
    $ openstack network list -c Name
    Sample output
    +-------------+
    | Name        |
    +-------------+
    | my_network  |
    | private     |
    | public      |
    | lb-mgmt-net |
    +-------------+

What to do next

  • If you need to modify the network, use the openstack network set command.
  • Most networks need at least one subnet. Proceed to Create a subnet.

Remove an unused network

Delete a network when needed, such as during a decommissioning process.

Before you begin

  • The administrator has created a project for you and has provided you with a clouds.yaml file for you to access the cloud.
  • The python-openstackclient package is on your workstation.
    $ dnf list installed python-openstackclient
  • No interfaces are connected to the network that you want to delete.

Procedure

  1. Confirm that the system OS_CLOUD variable is set for your cloud:
    $ echo $OS_CLOUD
    my_cloud

    Reset the variable if necessary:

    $ export OS_CLOUD=my_other_cloud

    As an alternative, you can specify the cloud name by adding the --os-cloud <cloud_name> option each time you run an openstack command.

  2. Obtain the name of the network that you want to delete.

    Retain this name, because you will need it later.

    $ openstack network list -c Name
    Sample output
    +-------------+
    | Name        |
    +-------------+
    | my_network  |
    | private     |
    | public      |
    | lb-mgmt-net |
    +-------------+
  3. Using the network name, delete the network.
    Example

    In this example, my_network is deleted:

    $ openstack network delete my_network

Results

  • Confirm that the network was deleted:
    $ openstack network list -c Name
    Sample output
    +-------------+
    | Name        |
    +-------------+
    | private     |
    | public      |
    | lb-mgmt-net |
    +-------------+