2014-08-13 13:13:51 -06:00
|
|
|
======
|
|
|
|
subnet
|
|
|
|
======
|
|
|
|
|
2016-04-24 19:17:36 -05:00
|
|
|
A **subnet** is a block of IP addresses and associated configuration state.
|
|
|
|
Subnets are used to allocate IP addresses when new ports are created on a
|
|
|
|
network.
|
|
|
|
|
2014-08-13 13:13:51 -06:00
|
|
|
Network v2
|
|
|
|
|
2016-02-11 15:20:27 -06:00
|
|
|
subnet create
|
2016-03-15 09:37:10 +09:00
|
|
|
-------------
|
2016-02-11 15:20:27 -06:00
|
|
|
|
|
|
|
Create new subnet
|
|
|
|
|
|
|
|
.. program:: subnet create
|
|
|
|
.. code:: bash
|
|
|
|
|
2016-12-20 09:26:15 +08:00
|
|
|
openstack subnet create
|
2016-02-11 15:20:27 -06:00
|
|
|
[--project <project> [--project-domain <project-domain>]]
|
2017-08-08 09:23:44 +05:30
|
|
|
[--subnet-pool <subnet-pool> | --use-default-subnet-pool [--prefix-length <prefix-length>] | --use-prefix-delegation]
|
2016-02-11 15:20:27 -06:00
|
|
|
[--subnet-range <subnet-range>]
|
|
|
|
[--allocation-pool start=<ip-address>,end=<ip-address>]
|
|
|
|
[--dhcp | --no-dhcp]
|
|
|
|
[--dns-nameserver <dns-nameserver>]
|
|
|
|
[--gateway <gateway>]
|
|
|
|
[--host-route destination=<subnet>,gateway=<ip-address>]
|
|
|
|
[--ip-version {4,6}]
|
2016-08-18 16:50:52 +07:00
|
|
|
[--description <description>]
|
2016-02-11 15:20:27 -06:00
|
|
|
[--ipv6-ra-mode {dhcpv6-stateful,dhcpv6-stateless,slaac}]
|
|
|
|
[--ipv6-address-mode {dhcpv6-stateful,dhcpv6-stateless,slaac}]
|
2016-06-10 16:01:31 -05:00
|
|
|
[--network-segment <network-segment>]
|
2016-07-15 13:20:10 -04:00
|
|
|
[--service-type <service-type>]
|
2017-04-29 00:32:32 +00:00
|
|
|
[--tag <tag> | --no-tag]
|
2016-02-11 15:20:27 -06:00
|
|
|
--network <network>
|
|
|
|
<name>
|
|
|
|
|
|
|
|
.. option:: --project <project>
|
|
|
|
|
|
|
|
Owner's project (name or ID)
|
|
|
|
|
|
|
|
.. option:: --project-domain <project-domain>
|
|
|
|
|
|
|
|
Domain the project belongs to (name or ID).
|
|
|
|
This can be used in case collisions between project names exist.
|
|
|
|
|
|
|
|
.. option:: --subnet-pool <subnet-pool>
|
|
|
|
|
|
|
|
Subnet pool from which this subnet will obtain a CIDR (name or ID)
|
|
|
|
|
2017-08-08 09:23:44 +05:30
|
|
|
.. option:: --use-prefix-delegation
|
|
|
|
|
|
|
|
Use 'prefix-delegation' if IP is IPv6 format and IP would be delegated
|
|
|
|
externally
|
|
|
|
|
2016-02-11 15:20:27 -06:00
|
|
|
.. option:: --use-default-subnet-pool
|
|
|
|
|
2016-12-19 17:23:35 +08:00
|
|
|
Use default subnet pool for :option:`--ip-version`
|
2016-02-11 15:20:27 -06:00
|
|
|
|
|
|
|
.. option:: --prefix-length <prefix-length>
|
|
|
|
|
|
|
|
Prefix length for subnet allocation from subnet pool
|
|
|
|
|
|
|
|
.. option:: --subnet-range <subnet-range>
|
|
|
|
|
|
|
|
Subnet range in CIDR notation
|
2016-12-19 17:23:35 +08:00
|
|
|
(required if :option:`--subnet-pool` is not specified, optional otherwise)
|
2016-02-11 15:20:27 -06:00
|
|
|
|
|
|
|
.. option:: --allocation-pool start=<ip-address>,end=<ip-address>
|
|
|
|
|
|
|
|
Allocation pool IP addresses for this subnet e.g.:
|
2016-04-12 15:57:17 +08:00
|
|
|
``start=192.168.199.2,end=192.168.199.254``
|
|
|
|
(repeat option to add multiple IP addresses)
|
2016-02-11 15:20:27 -06:00
|
|
|
|
|
|
|
.. option:: --dhcp
|
|
|
|
|
|
|
|
Enable DHCP (default)
|
|
|
|
|
|
|
|
.. option:: --no-dhcp
|
|
|
|
|
|
|
|
Disable DHCP
|
|
|
|
|
|
|
|
.. option:: --dns-nameserver <dns-nameserver>
|
|
|
|
|
2016-04-12 15:57:17 +08:00
|
|
|
DNS server for this subnet (repeat option to set multiple DNS servers)
|
2016-02-11 15:20:27 -06:00
|
|
|
|
|
|
|
.. option:: --gateway <gateway>
|
|
|
|
|
|
|
|
Specify a gateway for the subnet. The three options are:
|
2016-04-01 16:16:08 -05:00
|
|
|
<ip-address>: Specific IP address to use as the gateway,
|
|
|
|
'auto': Gateway address should automatically be chosen from
|
|
|
|
within the subnet itself, 'none': This subnet will not use
|
|
|
|
a gateway, e.g.: ``--gateway 192.168.9.1``, ``--gateway auto``,
|
2016-06-21 16:30:55 +07:00
|
|
|
``--gateway none`` (default is 'auto').
|
2016-02-11 15:20:27 -06:00
|
|
|
|
|
|
|
.. option:: --host-route destination=<subnet>,gateway=<ip-address>
|
|
|
|
|
|
|
|
Additional route for this subnet e.g.:
|
2016-04-01 16:16:08 -05:00
|
|
|
``destination=10.10.0.0/16,gateway=192.168.71.254``
|
|
|
|
destination: destination subnet (in CIDR notation)
|
|
|
|
gateway: nexthop IP address
|
2016-04-12 15:57:17 +08:00
|
|
|
(repeat option to add multiple routes)
|
2016-02-11 15:20:27 -06:00
|
|
|
|
|
|
|
.. option:: --ip-version {4,6}
|
|
|
|
|
|
|
|
IP version (default is 4). Note that when subnet pool is specified,
|
2016-04-01 16:16:08 -05:00
|
|
|
IP version is determined from the subnet pool and this option
|
|
|
|
is ignored.
|
2016-02-11 15:20:27 -06:00
|
|
|
|
2016-08-18 16:50:52 +07:00
|
|
|
.. option:: --description <description>
|
|
|
|
|
|
|
|
Set subnet description
|
|
|
|
|
2016-02-11 15:20:27 -06:00
|
|
|
.. option:: --ipv6-ra-mode {dhcpv6-stateful,dhcpv6-stateless,slaac}
|
|
|
|
|
|
|
|
IPv6 RA (Router Advertisement) mode,
|
2016-04-01 16:16:08 -05:00
|
|
|
valid modes: [dhcpv6-stateful, dhcpv6-stateless, slaac]
|
2016-02-11 15:20:27 -06:00
|
|
|
|
|
|
|
.. option:: --ipv6-address-mode {dhcpv6-stateful,dhcpv6-stateless,slaac}
|
|
|
|
|
|
|
|
IPv6 address mode, valid modes: [dhcpv6-stateful, dhcpv6-stateless, slaac]
|
|
|
|
|
2016-06-10 16:01:31 -05:00
|
|
|
.. option:: --network-segment <network-segment>
|
|
|
|
|
2016-09-28 08:16:22 -05:00
|
|
|
Network segment to associate with this subnet (name or ID)
|
2016-06-10 16:01:31 -05:00
|
|
|
|
2016-07-15 13:20:10 -04:00
|
|
|
.. option:: --service-type <service-type>
|
|
|
|
|
|
|
|
Service type for this subnet e.g.:
|
|
|
|
``network:floatingip_agent_gateway``.
|
|
|
|
Must be a valid device owner value for a network port
|
|
|
|
(repeat option to set multiple service types)
|
|
|
|
|
2017-04-29 00:32:32 +00:00
|
|
|
.. option:: --tag <tag>
|
|
|
|
|
|
|
|
Tag to be added to the subnet (repeat option to set multiple tags)
|
|
|
|
|
|
|
|
.. option:: --no-tag
|
|
|
|
|
|
|
|
No tags associated with the subnet
|
|
|
|
|
2016-02-11 15:20:27 -06:00
|
|
|
.. option:: --network <network>
|
|
|
|
|
|
|
|
Network this subnet belongs to (name or ID)
|
|
|
|
|
|
|
|
.. _subnet_create-name:
|
|
|
|
.. describe:: <name>
|
|
|
|
|
|
|
|
Name of subnet to create
|
|
|
|
|
2016-03-23 14:20:19 -05:00
|
|
|
subnet delete
|
|
|
|
-------------
|
|
|
|
|
2016-06-16 13:09:27 +08:00
|
|
|
Delete subnet(s)
|
2016-03-23 14:20:19 -05:00
|
|
|
|
|
|
|
.. program:: subnet delete
|
|
|
|
.. code:: bash
|
|
|
|
|
2016-12-20 09:26:15 +08:00
|
|
|
openstack subnet delete
|
2016-06-16 13:09:27 +08:00
|
|
|
<subnet> [<subnet> ...]
|
2016-03-23 14:20:19 -05:00
|
|
|
|
|
|
|
.. _subnet_delete-subnet:
|
|
|
|
.. describe:: <subnet>
|
|
|
|
|
2016-06-16 13:09:27 +08:00
|
|
|
Subnet(s) to delete (name or ID)
|
2016-03-23 14:20:19 -05:00
|
|
|
|
2014-08-13 13:13:51 -06:00
|
|
|
subnet list
|
|
|
|
-----------
|
|
|
|
|
|
|
|
List subnets
|
|
|
|
|
|
|
|
.. program:: subnet list
|
|
|
|
.. code:: bash
|
|
|
|
|
2016-12-20 09:26:15 +08:00
|
|
|
openstack subnet list
|
2014-08-13 13:13:51 -06:00
|
|
|
[--long]
|
2016-08-08 15:02:06 +07:00
|
|
|
[--ip-version {4,6}]
|
2016-08-09 11:25:35 +07:00
|
|
|
[--dhcp | --no-dhcp]
|
2016-09-16 14:31:26 +07:00
|
|
|
[--project <project> [--project-domain <project-domain>]]
|
|
|
|
[--network <network>]
|
|
|
|
[--gateway <gateway>]
|
|
|
|
[--name <name>]
|
|
|
|
[--subnet-range <subnet-range>]
|
2017-04-29 00:32:32 +00:00
|
|
|
[--tags <tag>[,<tag>,...]] [--any-tags <tag>[,<tag>,...]]
|
|
|
|
[--not-tags <tag>[,<tag>,...]] [--not-any-tags <tag>[,<tag>,...]]
|
2014-08-13 13:13:51 -06:00
|
|
|
|
|
|
|
.. option:: --long
|
|
|
|
|
|
|
|
List additional fields in output
|
2016-02-04 17:19:37 -06:00
|
|
|
|
2016-05-12 18:59:58 +00:00
|
|
|
.. option:: --ip-version {4, 6}
|
|
|
|
|
2016-06-21 16:30:55 +07:00
|
|
|
List only subnets of given IP version in output.
|
|
|
|
Allowed values for IP version are 4 and 6.
|
2016-05-12 18:59:58 +00:00
|
|
|
|
2016-08-09 11:25:35 +07:00
|
|
|
.. option:: --dhcp
|
|
|
|
|
|
|
|
List subnets which have DHCP enabled
|
|
|
|
|
|
|
|
.. option:: --no-dhcp
|
|
|
|
|
|
|
|
List subnets which have DHCP disabled
|
|
|
|
|
2016-07-15 13:20:10 -04:00
|
|
|
.. option:: --service-type <service-type>
|
|
|
|
|
|
|
|
List only subnets of a given service type in output
|
|
|
|
e.g.: ``network:floatingip_agent_gateway``.
|
|
|
|
Must be a valid device owner value for a network port
|
|
|
|
(repeat option to list multiple service types)
|
|
|
|
|
2016-09-16 14:31:26 +07:00
|
|
|
.. option:: --project <project>
|
|
|
|
|
2017-04-03 16:15:14 -05:00
|
|
|
List only subnets which belong to a given project in output (name or ID)
|
2016-09-16 14:31:26 +07:00
|
|
|
|
|
|
|
.. option:: --project-domain <project-domain>
|
|
|
|
|
|
|
|
Domain the project belongs to (name or ID).
|
|
|
|
This can be used in case collisions between project names exist.
|
|
|
|
|
|
|
|
.. option:: --network <network>
|
|
|
|
|
2017-04-03 16:15:14 -05:00
|
|
|
List only subnets which belong to a given network in output (name or ID)
|
2016-09-16 14:31:26 +07:00
|
|
|
|
|
|
|
.. option:: --gateway <gateway>
|
|
|
|
|
|
|
|
List only subnets of given gateway IP in output
|
|
|
|
|
|
|
|
.. option:: --name <name>
|
|
|
|
|
|
|
|
List only subnets of given name in output
|
|
|
|
|
|
|
|
.. option:: --subnet-range <subnet-range>
|
|
|
|
|
|
|
|
List only subnets of given subnet range (in CIDR notation) in output
|
|
|
|
e.g.: ``--subnet-range 10.10.0.0/16``
|
|
|
|
|
2017-04-29 00:32:32 +00:00
|
|
|
.. option:: --tags <tag>[,<tag>,...]
|
|
|
|
|
|
|
|
List subnets which have all given tag(s)
|
|
|
|
|
|
|
|
.. option:: --any-tags <tag>[,<tag>,...]
|
|
|
|
|
|
|
|
List subnets which have any given tag(s)
|
|
|
|
|
|
|
|
.. option:: --not-tags <tag>[,<tag>,...]
|
|
|
|
|
|
|
|
Exclude subnets which have all given tag(s)
|
|
|
|
|
|
|
|
.. option:: --not-any-tags <tag>[,<tag>,...]
|
|
|
|
|
|
|
|
Exclude subnets which have any given tag(s)
|
|
|
|
|
2016-03-15 09:37:10 +09:00
|
|
|
subnet set
|
|
|
|
----------
|
|
|
|
|
|
|
|
Set subnet properties
|
|
|
|
|
|
|
|
.. program:: subnet set
|
|
|
|
.. code:: bash
|
|
|
|
|
2016-12-20 09:26:15 +08:00
|
|
|
openstack subnet set
|
2016-03-15 09:37:10 +09:00
|
|
|
[--allocation-pool start=<ip-address>,end=<ip-address>]
|
2016-09-10 16:59:19 +05:30
|
|
|
[--no-allocation-pool]
|
2016-03-15 09:37:10 +09:00
|
|
|
[--dhcp | --no-dhcp]
|
|
|
|
[--dns-nameserver <dns-nameserver>]
|
2016-11-16 14:22:44 +05:30
|
|
|
[--no-dns-nameserver]
|
2016-03-15 09:37:10 +09:00
|
|
|
[--gateway <gateway-ip>]
|
|
|
|
[--host-route destination=<subnet>,gateway=<ip-address>]
|
2016-09-10 16:59:19 +05:30
|
|
|
[--no-host-route]
|
2016-07-15 13:20:10 -04:00
|
|
|
[--service-type <service-type>]
|
2016-03-15 09:37:10 +09:00
|
|
|
[--name <new-name>]
|
2016-08-18 16:50:52 +07:00
|
|
|
[--description <description>]
|
2017-04-29 00:32:32 +00:00
|
|
|
[--tag <tag>] [--no-tag]
|
2016-03-15 09:37:10 +09:00
|
|
|
<subnet>
|
|
|
|
|
|
|
|
.. option:: --allocation-pool start=<ip-address>,end=<ip-address>
|
|
|
|
|
|
|
|
Allocation pool IP addresses for this subnet e.g.:
|
2016-04-12 15:57:17 +08:00
|
|
|
``start=192.168.199.2,end=192.168.199.254``
|
|
|
|
(repeat option to add multiple IP addresses)
|
2016-03-15 09:37:10 +09:00
|
|
|
|
2016-09-10 16:59:19 +05:30
|
|
|
.. option:: --no-allocation-pool
|
|
|
|
|
|
|
|
Clear associated allocation pools from this subnet.
|
2016-12-19 17:23:35 +08:00
|
|
|
Specify both :option:`--allocation-pool` and :option:`--no-allocation-pool`
|
2016-09-10 16:59:19 +05:30
|
|
|
to overwrite the current allocation pool information.
|
|
|
|
|
2016-03-15 09:37:10 +09:00
|
|
|
.. option:: --dhcp
|
|
|
|
|
|
|
|
Enable DHCP
|
|
|
|
|
|
|
|
.. option:: --no-dhcp
|
|
|
|
|
|
|
|
Disable DHCP
|
|
|
|
|
|
|
|
.. option:: --dns-nameserver <dns-nameserver>
|
|
|
|
|
2016-04-12 15:57:17 +08:00
|
|
|
DNS server for this subnet (repeat option to set multiple DNS servers)
|
2016-03-15 09:37:10 +09:00
|
|
|
|
2016-11-16 14:22:44 +05:30
|
|
|
.. option:: --no-dns-nameservers
|
|
|
|
|
|
|
|
Clear existing information of DNS servers.
|
2016-12-19 17:23:35 +08:00
|
|
|
Specify both :option:`--dns-nameserver` and :option:`--no-dns-nameservers`
|
2016-11-16 14:22:44 +05:30
|
|
|
to overwrite the current DNS server information.
|
|
|
|
|
2016-03-15 09:37:10 +09:00
|
|
|
.. option:: --gateway <gateway>
|
|
|
|
|
|
|
|
Specify a gateway for the subnet. The options are:
|
2016-04-01 16:16:08 -05:00
|
|
|
<ip-address>: Specific IP address to use as the gateway,
|
|
|
|
'none': This subnet will not use a gateway,
|
2016-06-21 16:30:55 +07:00
|
|
|
e.g.: ``--gateway 192.168.9.1``, ``--gateway none``.
|
2016-03-15 09:37:10 +09:00
|
|
|
|
|
|
|
.. option:: --host-route destination=<subnet>,gateway=<ip-address>
|
|
|
|
|
|
|
|
Additional route for this subnet e.g.:
|
2016-04-01 16:16:08 -05:00
|
|
|
``destination=10.10.0.0/16,gateway=192.168.71.254``
|
|
|
|
destination: destination subnet (in CIDR notation)
|
|
|
|
gateway: nexthop IP address
|
2016-09-10 16:59:19 +05:30
|
|
|
|
|
|
|
.. option:: --no-host-route
|
|
|
|
|
|
|
|
Clear associated host routes from this subnet.
|
2016-12-19 17:23:35 +08:00
|
|
|
Specify both :option:`--host-route` and :option:`--no-host-route`
|
2016-09-10 16:59:19 +05:30
|
|
|
to overwrite the current host route information.
|
2016-03-15 09:37:10 +09:00
|
|
|
|
2016-07-15 13:20:10 -04:00
|
|
|
.. option:: --service-type <service-type>
|
|
|
|
|
|
|
|
Service type for this subnet e.g.:
|
|
|
|
``network:floatingip_agent_gateway``.
|
|
|
|
Must be a valid device owner value for a network port
|
|
|
|
(repeat option to set multiple service types)
|
2016-11-16 14:08:11 +05:30
|
|
|
|
2016-08-18 16:50:52 +07:00
|
|
|
.. option:: --description <description>
|
|
|
|
|
|
|
|
Set subnet description
|
2016-07-15 13:20:10 -04:00
|
|
|
|
2016-03-15 09:37:10 +09:00
|
|
|
.. option:: --name
|
|
|
|
|
|
|
|
Updated name of the subnet
|
|
|
|
|
2017-04-29 00:32:32 +00:00
|
|
|
.. option:: --tag <tag>
|
|
|
|
|
|
|
|
Tag to be added to the subnet (repeat option to set multiple tags)
|
|
|
|
|
|
|
|
.. option:: --no-tag
|
|
|
|
|
|
|
|
Clear tags associated with the subnet. Specify both --tag
|
|
|
|
and --no-tag to overwrite current tags
|
|
|
|
|
2016-03-15 09:37:10 +09:00
|
|
|
.. _subnet_set-subnet:
|
|
|
|
.. describe:: <subnet>
|
|
|
|
|
|
|
|
Subnet to modify (name or ID)
|
|
|
|
|
|
|
|
|
2016-02-04 17:19:37 -06:00
|
|
|
subnet show
|
|
|
|
-----------
|
|
|
|
|
2016-04-16 10:59:37 +08:00
|
|
|
Display subnet details
|
2016-02-04 17:19:37 -06:00
|
|
|
|
|
|
|
.. program:: subnet show
|
|
|
|
.. code:: bash
|
|
|
|
|
2016-12-20 09:26:15 +08:00
|
|
|
openstack subnet show
|
2016-02-04 17:19:37 -06:00
|
|
|
<subnet>
|
|
|
|
|
|
|
|
.. _subnet_show-subnet:
|
|
|
|
.. describe:: <subnet>
|
|
|
|
|
2016-04-16 10:59:37 +08:00
|
|
|
Subnet to display (name or ID)
|
2016-04-15 13:21:08 +09:00
|
|
|
|
|
|
|
subnet unset
|
|
|
|
------------
|
|
|
|
|
|
|
|
Unset subnet properties
|
|
|
|
|
|
|
|
.. program:: subnet unset
|
|
|
|
.. code:: bash
|
|
|
|
|
2016-12-20 09:26:15 +08:00
|
|
|
openstack subnet unset
|
2016-04-15 13:21:08 +09:00
|
|
|
[--allocation-pool start=<ip-address>,end=<ip-address> [...]]
|
|
|
|
[--dns-nameserver <dns-nameserver> [...]]
|
|
|
|
[--host-route destination=<subnet>,gateway=<ip-address> [...]]
|
2016-07-15 13:20:10 -04:00
|
|
|
[--service-type <service-type>]
|
2017-04-29 00:32:32 +00:00
|
|
|
[--tag <tag> | --all-tag]
|
2016-04-15 13:21:08 +09:00
|
|
|
<subnet>
|
|
|
|
|
|
|
|
.. option:: --dns-nameserver <dns-nameserver>
|
|
|
|
|
|
|
|
DNS server to be removed from this subnet
|
|
|
|
(repeat option to unset multiple DNS servers)
|
|
|
|
|
|
|
|
.. option:: --allocation-pool start=<ip-address>,end=<ip-address>
|
|
|
|
|
2016-08-18 17:06:22 +01:00
|
|
|
Allocation pool IP addresses to be removed from this
|
|
|
|
subnet e.g.: ``start=192.168.199.2,end=192.168.199.254``
|
|
|
|
(repeat option to unset multiple allocation pools)
|
2016-04-15 13:21:08 +09:00
|
|
|
|
|
|
|
.. option:: --host-route destination=<subnet>,gateway=<ip-address>
|
|
|
|
|
|
|
|
Route to be removed from this subnet e.g.:
|
|
|
|
``destination=10.10.0.0/16,gateway=192.168.71.254``
|
|
|
|
destination: destination subnet (in CIDR notation)
|
|
|
|
gateway: nexthop IP address
|
|
|
|
(repeat option to unset multiple host routes)
|
|
|
|
|
2016-07-15 13:20:10 -04:00
|
|
|
.. option:: --service-type <service-type>
|
|
|
|
|
|
|
|
Service type to be removed from this subnet e.g.:
|
|
|
|
``network:floatingip_agent_gateway``.
|
|
|
|
Must be a valid device owner value for a network port
|
|
|
|
(repeat option to unset multiple service types)
|
|
|
|
|
2017-04-29 00:32:32 +00:00
|
|
|
.. option:: --tag <tag>
|
|
|
|
|
|
|
|
Tag to be removed from the subnet
|
|
|
|
(repeat option to remove multiple tags)
|
|
|
|
|
|
|
|
.. option:: --all-tag
|
|
|
|
|
|
|
|
Clear all tags associated with the subnet
|
|
|
|
|
2016-04-15 13:21:08 +09:00
|
|
|
.. _subnet_unset-subnet:
|
|
|
|
.. describe:: <subnet>
|
|
|
|
|
2016-08-18 17:06:22 +01:00
|
|
|
Subnet to modify (name or ID)
|