Managing compute subnets

You can add and delete subnets of physical compute networks. Also, if you exhaust all public IP addresses in a physical compute network, you can add more subnets to this network by using the OpenStack command-line tool. The new subnets will be available in the admin and self-service panel for IP address allocation and management.

Limitations

  • For an IPv6 subnet, you cannot change the IPv6 address mode.
  • A compute network with enabled IP address management must have at least one subnet.

Prerequisites

To add a subnet to a physical compute network

  1. On the Compute > Networks tab, click the desired physical network.
  2. In the Subnets section, click Add, and then select IPv4 subnet or IPv6 subnet, depending on the available option.
  3. In the new window, specify the subnet settings, and then click Add.

To add more subnets to a physical compute network

  1. Identify the required network by listing all of the existing networks:

    # openstack --insecure network list
    +-----------------------+---------+--------------------------------------+
    | ID                    | Name    | Subnets                              |
    +-----------------------+---------+--------------------------------------+
    | a1d8d6ae-c89d-4307<…> | public  | d52aa9f4-6a4b-4268-a71d-1a50f9b60aa9 |
    | e31eac69-9ab7-41ad<…> | private | 470526d3-ea5a-48fb-81ac-20273f005f61 |
    +-----------------------+---------+--------------------------------------+
  2. Create a new subnet in the network by using the openstack subnet create command. For example:

    # openstack --insecure subnet create --ip-version 4 --subnet-range 10.164.132.0/24 \
    --gateway 10.164.132.1 --dhcp --dns-nameserver 8.8.8.8 --allocation-pool \
    start=10.164.132.201,end=10.164.132.212 --network public newsubnet

To delete a subnet from a physical compute network

  1. On the Compute > Networks tab, click the desired physical network.
  2. In the Subnets section, click the bin icon next to the subnet you want to remove.

    You cannot delete the only subnet.