<commit_before>==============
Use Networking
==============

You can manage OpenStack Networking services by using the service
command. For example:

.. code-block:: console

   # service neutron-server stop
   # service neutron-server status
   # service neutron-server start
   # service neutron-server restart

Log files are in the ``/var/log/neutron`` directory.

Configuration files are in the ``/etc/neutron`` directory.

Administrators and tenants can use OpenStack Networking to build
rich network topologies. Administrators can create network
connectivity on behalf of tenants.

Core Networking API features
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

After you install and configure Networking, tenants and administrators
can perform create-read-update-delete (CRUD) API networking operations
by using the Networking API directly or neutron command-line interface
(CLI). The neutron CLI is a wrapper around the Networking API. Every
Networking API call has a corresponding neutron command.

The CLI includes a number of options. For details, see the `OpenStack
End User Guide <http://docs.openstack.org/user-guide/index.html>`__.

Basic Networking operations
---------------------------

To learn about advanced capabilities available through the neutron
command-line interface (CLI), read the networking section in the
`OpenStack End User
Guide <http://docs.openstack.org/user-guide/index.html>`__.

This table shows example neutron commands that enable you to complete
basic network operations:

+-------------------------+-------------------------------------------------+
| Operation               | Command                                         |
+=========================+=================================================+
|Creates a network.       |                                                 |
|                         |                                                 |
|                         |     ``$ neutron net-create net1``               |
+-------------------------+-------------------------------------------------+
|Creates a subnet that is |                                                 |
|associated with net1.    |                                                 |
|                         |                                                 |
|                         |     ``$ neutron subnet-create``                 |
|                         |     ``net1 10.0.0.0/24``                        |
+-------------------------+-------------------------------------------------+
|Lists ports for a        |                                                 |
|specified tenant.        |                                                 |
|                         |                                                 |
|                         |     ``$ neutron port-list``                     |
+-------------------------+-------------------------------------------------+
|Lists ports for a        |                                                 |
|specified tenant         |                                                 |
|and displays the ``id``, |                                                 |
|``fixed_ips``,           |                                                 |
|and ``device_owner``     |                                                 |
|columns.                 |                                                 |
|                         |                                                 |
|                         |     ``$ neutron port-list -c id``               |
|                         |     ``-c fixed_ips -c device_owner``            |
+-------------------------+-------------------------------------------------+
|Shows information for a  |                                                 |
|specified port.          |                                                 |
|                         |     ``$ neutron port-show PORT_ID``             |
+-------------------------+-------------------------------------------------+

**Basic Networking operations**

.. note::

   The ``device_owner`` field describes who owns the port. A port whose
   ``device_owner`` begins with:

   -  ``network`` is created by Networking.

   -  ``compute`` is created by Compute.

Administrative operations
-------------------------

The administrator can run any :command:`neutron` command on behalf of
tenants by specifying an Identity ``tenant_id`` in the command, as
follows:

.. code-block:: console

   $ neutron net-create --tenant-id TENANT_ID NETWORK_NAME

For example:

.. code-block:: console

   $ neutron net-create --tenant-id 5e4bbe24b67a4410bc4d9fae29ec394e net1

.. note::

   To view all tenant IDs in Identity, run the following command as an
   Identity service admin user:

   .. code-block:: console

      $ openstack project list

Advanced Networking operations
------------------------------

This table shows example Networking commands that enable you to complete
advanced network operations:

+-------------------------------+--------------------------------------------+
| Operation                     | Command                                    |
+===============================+============================================+
|Creates a network that         |                                            |
|all tenants can use.           |                                            |
|                               |                                            |
|                               |     ``$ neutron net-create``               |
|                               |     ``--shared public-net``                |
+-------------------------------+--------------------------------------------+
|Creates a subnet with a        |                                            |
|specified gateway IP address.  |                                            |
|                               |                                            |
|                               |   ``$ neutron subnet-create``              |
|                               |   ``--gateway 10.0.0.254 net1 10.0.0.0/24``|
+-------------------------------+--------------------------------------------+
|Creates a subnet that has      |                                            |
|no gateway IP address.         |                                            |
|                               |                                            |
|                               |     ``$ neutron subnet-create``            |
|                               |     ``--no-gateway net1 10.0.0.0/24``      |
+-------------------------------+--------------------------------------------+
|Creates a subnet with DHCP     |                                            |
|disabled.                      |                                            |
|                               |                                            |
|                               |   ``$ neutron subnet-create``              |
|                               |   ``net1 10.0.0.0/24 --enable-dhcp False`` |
+-------------------------------+--------------------------------------------+
|Specifies a set of host routes |                                            |
|                               |                                            |
|                               |     ``$ neutron subnet-create``            |
|                               |     ``test-net1 172.16.17.32/24 --host-routes``|
|                               |     ``type=dict list=true``                |
|                               |     ``destination=192.168.127.12/24,``           |
|                               |     ``nexthop=172.16.58.3``                   |
+-------------------------------+--------------------------------------------+
|Creates a subnet with a        |                                            |
|specified set of dns name      |                                            |
|servers.                       |                                            |
|                               |                                            |
|                               |     ``$ neutron subnet-create test-net1``  |
|                               |     ``172.16.17.32/24 --dns-nameservers``      |
|                               |     ``list=true 8.8.4.4 8.8.8.8``          |
+-------------------------------+--------------------------------------------+
|Displays all ports and         |                                            |
|IPs allocated on a network.    |                                            |
|                               |                                            |
|                               | ``$ neutron port-list --network_id NET_ID``|
+-------------------------------+--------------------------------------------+

**Advanced Networking operations**
<commit_msg>[admin-guide] command error in use networking<commit_after>==============
Use Networking
==============

You can manage OpenStack Networking services by using the service
command. For example:

.. code-block:: console

   # service neutron-server stop
   # service neutron-server status
   # service neutron-server start
   # service neutron-server restart

Log files are in the ``/var/log/neutron`` directory.

Configuration files are in the ``/etc/neutron`` directory.

Administrators and tenants can use OpenStack Networking to build
rich network topologies. Administrators can create network
connectivity on behalf of tenants.

Core Networking API features
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

After you install and configure Networking, tenants and administrators
can perform create-read-update-delete (CRUD) API networking operations
by using the Networking API directly or neutron command-line interface
(CLI). The neutron CLI is a wrapper around the Networking API. Every
Networking API call has a corresponding neutron command.

The CLI includes a number of options. For details, see the `OpenStack
End User Guide <http://docs.openstack.org/user-guide/index.html>`__.

Basic Networking operations
---------------------------

To learn about advanced capabilities available through the neutron
command-line interface (CLI), read the networking section in the
`OpenStack End User
Guide <http://docs.openstack.org/user-guide/index.html>`__.

This table shows example neutron commands that enable you to complete
basic network operations:

+-------------------------+-------------------------------------------------+
| Operation               | Command                                         |
+=========================+=================================================+
|Creates a network.       |                                                 |
|                         |                                                 |
|                         |     ``$ neutron net-create net1``               |
+-------------------------+-------------------------------------------------+
|Creates a subnet that is |                                                 |
|associated with net1.    |                                                 |
|                         |                                                 |
|                         |     ``$ neutron subnet-create``                 |
|                         |     ``net1 10.0.0.0/24``                        |
+-------------------------+-------------------------------------------------+
|Lists ports for a        |                                                 |
|specified tenant.        |                                                 |
|                         |                                                 |
|                         |     ``$ neutron port-list``                     |
+-------------------------+-------------------------------------------------+
|Lists ports for a        |                                                 |
|specified tenant         |                                                 |
|and displays the ``id``, |                                                 |
|``fixed_ips``,           |                                                 |
|and ``device_owner``     |                                                 |
|columns.                 |                                                 |
|                         |                                                 |
|                         |     ``$ neutron port-list -c id``               |
|                         |     ``-c fixed_ips -c device_owner``            |
+-------------------------+-------------------------------------------------+
|Shows information for a  |                                                 |
|specified port.          |                                                 |
|                         |     ``$ neutron port-show PORT_ID``             |
+-------------------------+-------------------------------------------------+

**Basic Networking operations**

.. note::

   The ``device_owner`` field describes who owns the port. A port whose
   ``device_owner`` begins with:

   -  ``network`` is created by Networking.

   -  ``compute`` is created by Compute.

Administrative operations
-------------------------

The administrator can run any :command:`neutron` command on behalf of
tenants by specifying an Identity ``tenant_id`` in the command, as
follows:

.. code-block:: console

   $ neutron net-create --tenant-id TENANT_ID NETWORK_NAME

For example:

.. code-block:: console

   $ neutron net-create --tenant-id 5e4bbe24b67a4410bc4d9fae29ec394e net1

.. note::

   To view all tenant IDs in Identity, run the following command as an
   Identity service admin user:

   .. code-block:: console

      $ openstack project list

Advanced Networking operations
------------------------------

This table shows example Networking commands that enable you to complete
advanced network operations:

+-------------------------------+--------------------------------------------+
| Operation                     | Command                                    |
+===============================+============================================+
|Creates a network that         |                                            |
|all tenants can use.           |                                            |
|                               |                                            |
|                               |     ``$ neutron net-create``               |
|                               |     ``--shared public-net``                |
+-------------------------------+--------------------------------------------+
|Creates a subnet with a        |                                            |
|specified gateway IP address.  |                                            |
|                               |                                            |
|                               |   ``$ neutron subnet-create``              |
|                               |   ``--gateway 10.0.0.254 net1 10.0.0.0/24``|
+-------------------------------+--------------------------------------------+
|Creates a subnet that has      |                                            |
|no gateway IP address.         |                                            |
|                               |                                            |
|                               |     ``$ neutron subnet-create``            |
|                               |     ``--no-gateway net1 10.0.0.0/24``      |
+-------------------------------+--------------------------------------------+
|Creates a subnet with DHCP     |                                            |
|disabled.                      |                                            |
|                               |                                            |
|                               |   ``$ neutron subnet-create``              |
|                               |   ``net1 10.0.0.0/24 --enable-dhcp=False`` |
+-------------------------------+--------------------------------------------+
|Specifies a set of host routes |                                            |
|                               |                                            |
|                               |     ``$ neutron subnet-create``            |
|                               |     ``test-net1 172.16.17.32/24 --host-routes``|
|                               |     ``type=dict list=true``                |
|                               |     ``destination=192.168.127.12/24,``           |
|                               |     ``nexthop=172.16.58.3``                   |
+-------------------------------+--------------------------------------------+
|Creates a subnet with a        |                                            |
|specified set of dns name      |                                            |
|servers.                       |                                            |
|                               |                                            |
|                               |     ``$ neutron subnet-create test-net1``  |
|                               |     ``172.16.17.32/24 --dns-nameservers``      |
|                               |     ``list=true 8.8.4.4 8.8.8.8``          |
+-------------------------------+--------------------------------------------+
|Displays all ports and         |                                            |
|IPs allocated on a network.    |                                            |
|                               |                                            |
|                               | ``$ neutron port-list --network_id NET_ID``|
+-------------------------------+--------------------------------------------+

**Advanced Networking operations**

{'fraction_non_alphanumeric': 0.22033706594276667, 'fraction_numerical': 0.012668250197941409, 'mean_word_length': 0.6523079798168566, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 22, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 230, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3820090', 'n_tokens_mistral': 3308, 'n_tokens_neox': 2995, 'n_words': 888}