OpenStack Network Management with Neutron

OpenStack Network Management with Neutron

In Openstack, the component which handles networking services for other modules is called Neutron. It is responsible for defining networks, IP assignment, subnet management, Vlans tags, etc. For more information about Neutron, please refer to OpenStack’s official documentation at: https://wiki.openstack.org/wiki/Neutron

Notes:
  • Before you can start using Neutron, make sure the OpenStack Command Line Interface tools are installed on your workstation
  • Since the Vlan & subnet assignment per customer is done by Internap at the account creation, many Neutron features are not available to customers.
  • Many other Neutron features are locked security purposes as well.

Here are a few examples of what is available with Neutron at Internap:

  • List your networks with neutron net-list
$ neutron net-list
+--------------------------------------+------------------+-----------------------------------------------------+
| id                                   | name             | subnets                                             |
+--------------------------------------+------------------+-----------------------------------------------------+
| 1944a5e0-2f95-4f58-bec4-82b8acb19548 | inap-1258-LAN618 | 0599a705-e27c-472a-b598-5a87e8a76abb 10.248.2.72/29 |
+--------------------------------------+------------------+-----------------------------------------------------+
  • List your subnets using neutron subnet-list
$ neutron subnet-list
+--------------------------------------+------+----------------+------------------------------------------------+
| id                                   | name | cidr           | allocation_pools                               |
+--------------------------------------+------+----------------+------------------------------------------------+
| 0599a705-e27c-472a-b598-5a87e8a76abb |      | 10.248.2.72/29 | {"start": "10.248.2.76", "end": "10.248.2.78"} |
+--------------------------------------+------+----------------+------------------------------------------------+
  • Show the details of a specific network with neutron net-show network_uuid
$ neutron net-show 1944a5e0-2f95-4f58-bec4-82b8acb19548
+---------------------------+--------------------------------------+
| Field                     | Value                                |
+---------------------------+--------------------------------------+
| admin_state_up            | True                                 |
| id                        | 1944a5e0-2f95-4f58-bec4-82b8acb19548 |
| mtu                       | 0                                    |
| name                      | inap-1258-LAN618                     |
| provider:network_type     | vlan                                 |
| provider:physical_network | physnet0                             |
| provider:segmentation_id  | 618                                  |
| router:external           | False                                |
| shared                    | False                                |
| status                    | ACTIVE                               |
| subnets                   | 0599a705-e27c-472a-b598-5a87e8a76abb |
| tenant_id                 |                                      |
+---------------------------+--------------------------------------+
  • Show the details of a specific subnet using neutron subnet-show subnet_uuid
$ neutron subnet-show 0599a705-e27c-472a-b598-5a87e8a76abb
+-------------------+------------------------------------------------+
| Field             | Value                                          |
+-------------------+------------------------------------------------+
| allocation_pools  | {"start": "10.248.2.76", "end": "10.248.2.78"} |
| cidr              | 10.248.2.72/29                                 |
| dns_nameservers   |                                                |
| enable_dhcp       | False                                          |
| gateway_ip        | 10.248.2.73                                    |
| host_routes       |                                                |
| id                | 0599a705-e27c-472a-b598-5a87e8a76abb           |
| ip_version        | 4                                              |
| ipv6_address_mode |                                                |
| ipv6_ra_mode      |                                                |
| name              |                                                |
| network_id        | 1944a5e0-2f95-4f58-bec4-82b8acb19548           |
| subnetpool_id     |                                                |
| tenant_id         |                                                |
+-------------------+------------------------------------------------+
  • List all the neutron ports with neutron port-list
$ neutron port-list
+--------------------------------------+------+-------------------+------------------------------------------------------------------------------------+
| id                                   | name | mac_address       | fixed_ips                                                                          |
+--------------------------------------+------+-------------------+------------------------------------------------------------------------------------+
| 8b6b24af-4e02-450e-9186-911a2409ae09 |      | fa:16:3e:3f:4c:c2 | {"subnet_id": "4e27fb34-f058-469d-8bf9-eab7c2cfb695", "ip_address": "10.248.2.77"} |
+--------------------------------------+------+-------------------+------------------------------------------------------------------------------------+
  • Show the details of a specific port using neutron port-show
$ neutron port-show 8b6b24af-4e02-450e-9186-911a2409ae09
+-----------------------+------------------------------------------------------------------------------------+
| Field                 | Value                                                                              |
+-----------------------+------------------------------------------------------------------------------------+
| admin_state_up        | True                                                                               |
| allowed_address_pairs |                                                                                    |
| binding:vnic_type     | normal                                                                             |
| device_id             | bdc7221c-0e8c-44b7-8950-a1db6a50b93a                                               |
| device_owner          | compute:nova                                                                       |
| extra_dhcp_opts       |                                                                                    |
| fixed_ips             | {"subnet_id": "4e27fb34-f058-469d-8bf9-eab7c2cfb695", "ip_address": "10.248.2.77"} |
| id                    | 8b6b24af-4e02-450e-9186-911a2409ae09                                               |
| mac_address           | fa:16:3e:3f:4c:c2                                                                  |
| name                  |                                                                                    |
| network_id            | c17465cf-36b1-4a38-8c72-990257f6fc8d                                               |
| security_groups       | 3e849963-5d51-48b8-8c84-131ba7b73138                                               |
| status                | DOWN                                                                               |
| tenant_id             |                                                                                    |
+-----------------------+------------------------------------------------------------------------------------+
  • Create a Neutron port to either reserve an IP from the Neutron DHCP, or to add an additionnal NIC to a AgileCLOUD server using neutron port-create
$ neutron port-create 1944a5e0-2f95-4f58-bec4-82b8acb19548 --fixed-ip ip_address=10.248.2.76
Created a new port:
+-----------------------+------------------------------------------------------------------------------------+
| Field                 | Value                                                                              |
+-----------------------+------------------------------------------------------------------------------------+
| admin_state_up        | True                                                                               |
| allowed_address_pairs |                                                                                    |
| binding:vnic_type     | normal                                                                             |
| device_id             |                                                                                    |
| device_owner          |                                                                                    |
| fixed_ips             | {"subnet_id": "0599a705-e27c-472a-b598-5a87e8a76abb", "ip_address": "10.248.2.76"} |
| id                    | a083fd6d-6999-4e86-a0b3-5e9afb85ed76                                               |
| mac_address           | fa:16:3e:72:60:2d                                                                  |
| name                  |                                                                                    |
| network_id            | 1944a5e0-2f95-4f58-bec4-82b8acb19548                                               |
| security_groups       | 3e849963-5d51-48b8-8c84-131ba7b73138                                               |
| status                | DOWN                                                                               |
| tenant_id             |                                                                                    |
+-----------------------+------------------------------------------------------------------------------------+
  • Update an existing port, for example to add a 2nd IP on that port using neutron port-update
$ neutron port-update --fixed-ip subnet_id=0599a705-e27c-472a-b598-5a87e8a76abb,ip_address=10.248.2.78 a083fd6d-6999-4e86-a0b3-5e9afb85ed76
Updated port: a083fd6d-6999-4e86-a0b3-5e9afb85ed76