3.5. Managing Virtual Networks

3.5.1. vinfra service compute network create

Create a compute network:

usage: vinfra service compute network create [--dhcp | --no-dhcp]
                                             [--dns-nameserver <dns-nameserver>]
                                             [--allocation-pool <allocation-pool>]
                                             [--gateway <gateway> | --no-gateway]
                                             [--ip-version <ip-version>]
                                             [--physical-network <physical-network>]
                                             [--cidr <cidr>] <network-name>
--dhcp
Enable DHCP
--no-dhcp
Disable DHCP
--dns-nameserver <dns-nameserver>
DNS server IP address. This option can be used multiple times.
--allocation-pool <allocation-pool>
Allocation pool to create inside the network in the format: ip_addr_start-ip_addr_end. This option can be used multiple times.
--gateway <gateway>
Gateway IP address
--no-gateway
Do not configure a gateway for this network
--ip-version <ip-version>
Network IP version
--physical-network <physical-network>
A physical network to link to a public network
--cidr <cidr>
Subnet range in CIDR notation
<network-name>
Network name

Example:

# vinfra service compute network create myprivnet --type vxlan \
--cidr 192.128.128.0/24 --gateway 192.128.128.1
+------------------+--------------------------------------+
| Field            | Value                                |
+------------------+--------------------------------------+
| id               | 3848fb5d-bc98-4320-acd0-cde2df7c5bdd |
| name             | myprivnet                            |
| physical_network |                                      |
| project_id       | 72a5db3a033c403a86756021e601ef34     |
| subnet           | allocation_pools:                    |
|                  | - end: 192.128.128.254               |
|                  |   start: 192.128.128.2               |
|                  | cidr: 192.128.128.0/24               |
|                  | dns_nameservers: []                  |
|                  | enable_dhcp: true                    |
|                  | gateway_ip: 192.128.128.1            |
|                  | ip_version: 4                        |
| type             | vxlan                                |
+------------------+--------------------------------------+

This command creates a private network myprivnet with the specific CIDR and gateway.

3.5.2. vinfra service compute network list

List compute networks:

usage: vinfra service compute network list

Example:

# vinfra service compute network list -c id -c name -c cidr -c type -c allocation_pools
+----------------+-----------+-------+------------------+------------------------+
| id             | name      | type  | cidr             | allocation_pools       |
+----------------+-----------+-------+------------------+------------------------+
| 1bf2c9da-<...> | private   | vxlan | 192.168.128.0/24 | - end: 192.168.128.254 |
|                |           |       |                  |   start: 192.168.128.2 |
| 3848fb5d-<...> | myprivnet | vxlan | 192.128.128.0/24 | - end: 192.128.128.254 |
|                |           |       |                  |   start: 192.128.128.2 |
| 417606ac-<...> | public    | flat  | 10.94.0.0/16     | - end: 10.94.129.79    |
|                |           |       |                  |   start: 10.94.129.64  |
+----------------+-----------+-------+------------------+------------------------+

This command lists networks used in the compute cluster. (The output is abridged to fit on page.)

3.5.3. vinfra service compute network show

Display compute network details:

usage: vinfra service compute network show <network>
<network>
Network ID or name

Example:

# vinfra service compute network show 417606ac-1dbe-426a-844d-e047831ddce9
+------------------+--------------------------------------+
| Field            | Value                                |
+------------------+--------------------------------------+
| allocation_pools |                                      |
| cidr             |                                      |
| dns_nameservers  |                                      |
| enable_dhcp      |                                      |
| gateway_ip       |                                      |
| id               | 417606ac-1dbe-426a-844d-e047831ddce9 |
| ip_version       |                                      |
| name             | public                               |
| physical_network | Public                               |
| project_id       | 72a5db3a033c403a86756021e601ef34     |
| type             | flat                                 |
+------------------+--------------------------------------+

This command shows the details of the network with the ID 417606ac-1dbe-426a-844d-e047831ddce9.

3.5.4. vinfra service compute network set

Modify compute network parameters:

usage: vinfra service compute network set [--dhcp | --no-dhcp]
                                          [--dns-nameserver <dns-nameserver>]
                                          [--allocation-pool <allocation-pool>]
                                          [--gateway <gateway> | --no-gateway]
                                          [--name <name>] <network>
--dhcp
Enable DHCP
--no-dhcp
Disable DHCP
--dns-nameserver <dns-nameserver>
DNS server IP address. This option can be used multiple times.
--allocation-pool <allocation-pool>
Allocation pool to create inside the network in the format: ip_addr_start-ip_addr_end. This option can be used multiple times.
--gateway <gateway>
Gateway IP address
--no-gateway
Do not configure a gateway for this network
--name <name>
A new name for the network
<network>
Network ID or name

Example:

# vinfra service compute network set myprivnet --no-dhcp
+------------------+--------------------------------------+
| Field            | Value                                |
+------------------+--------------------------------------+
| id               | 3848fb5d-bc98-4320-acd0-cde2df7c5bdd |
| name             | myprivnet                            |
| physical_network |                                      |
| project_id       | 72a5db3a033c403a86756021e601ef34     |
| subnet           | allocation_pools:                    |
|                  | - end: 192.128.128.254               |
|                  |   start: 192.128.128.2               |
|                  | cidr: 192.128.128.0/24               |
|                  | dns_nameservers: []                  |
|                  | enable_dhcp: false                   |
|                  | gateway_ip: 192.128.128.1            |
|                  | ip_version: 4                        |
| type             | vxlan                                |
+------------------+--------------------------------------+

This command disables DHCP for the private network myprivnet.

3.5.5. vinfra service compute network delete

Delete a compute network:

usage: vinfra service compute network delete <network>
<network>
Network ID or name

Example:

# vinfra service compute network delete myprivnet
Operation successful

This command deletes the private network myprivnet.