Openstack Liberty Lab Part VI: Configure Neutron Network Services

You can download this article in PDF format via the link below to support us.Download the guide in PDF formatClose

We will install Neutron Server on the control node where Keystone / Glance / Nova API has been installed. For us, the control node will run all openstack services. Before writing this part of the tutorial, I have introduced the following parts:

Openstack Liberty Lab Part 1: Setting up the network and all prerequisites

Openstack Liberty Lab Part 2: Install the Openstack software package

Openstack Liberty Lab Part 3: Configure Keystone Identity Service

Openstack Liberty Lab Part 4: Configure Glance Image Service

Openstack Liberty Lab Part V: Configure Nova Computing Service

Please follow the steps provided below to run the Neutron server:

  1. Configure the database for Neutron on MariaDB
[[email protected] ~]# mysql -u root -p 
Enter password: 
Welcome to the MariaDB monitor. Commands end with ; or g.
Your MariaDB connection id is 61
Server version: 5.5.44-MariaDB MariaDB Server Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others. 
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement. 
MariaDB [(none)]> create database neutron; 
Query OK, 1 row affected (0.00 sec) 
MariaDB [(none)]> grant all privileges on neutron.* to [email protected]'localhost' identified by 'moonstack';
Query OK, 0 rows affected (0.00 sec) 
MariaDB [(none)]> grant all privileges on neutron.* to [email protected]'%' identified by 'moonstack'; 
Query OK, 0 rows affected (0.00 sec) 
MariaDB [(none)]> flush privileges; 
Query OK, 0 rows affected (0.00 sec) 
MariaDB [(none)]> exit
Bye
  1. Add Neutron users, and assign administrator roles, add endpoints
  • Add Neutron User
[[email protected] ~]# openstack user create --domain default --project service --password moonstack neutron 
+--------------------+----------------------------------+
| Field              | Value                         |
+--------------------+----------------------------------+
| default_project_id | 9c3ec09f5e08442eb211612f99cd22ad |
| domain_id             | default |
| enabled                 | True |
| id                          | f90899de1b014d0395d5fbd5334f06e7 |
| name                     | neutron |
+--------------------+----------------------------------+
[[email protected] ~]# openstack role add --project service --user neutron admin 
[[email protected] ~]#
  • Add service entry:
 [[email protected] ~]# openstack service create --name neutron --description "OpenStack Networking service" network 
+--------------------+------------------------------------------------------------------+
| Field             | Value                                                         |
+-------------------+------------------------------------------------------------------+
| description | OpenStack Networking service            |
| enabled      | True                                                        |
| id                | 808a8785807d4b8fafaaac947852654d |
| name         | neutron                                                    |
| type           | network                                                   |
+-----------------+------------------------------------------------------------------+
[[email protected] ~]#
  • Add endpoint:
[[email protected] ~]# export controller=192.168.1.60 
[[email protected] ~]# openstack endpoint create --region RegionOne network admin http://$controller:9696
+--------------+-----------------------------------------------------------------------+
| Field        | Value                                                                 |
+--------------+-----------------------------------------------------------------------+
| enabled    | True                                                                |
| id              | 737cb6ac59af4514908079b3d6e2de               |
| interface  | admin                                                             |
| region       | RegionOne                                                    |
| region_id    | RegionOne                                                   |
| service_id   | 808a8785807d4b8fafaaac947852654d      |
| service_name | neutron                                                    |
| service_type | network                                                     |
| url          | http://192.168.1.60:9696                                  |
+--------------+-------------------------------------------------------------------------+
[[email protected] ~]# openstack endpoint create --region RegionOne network public http://$controller:9696 
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id                | 3a7627983be94e4090061144187fcd7b |
| interface    | public                           |
| region       | RegionOne                        |
| region_id   | RegionOne                        |
| service_id   | 808a8785807d4b8fafaaac947852654d |
| service_name | neutron                          |
| service_type | network                          |
| url          | http://192.168.1.60:9696         |
+--------------+----------------------------------+
[[email protected] ~]# openstack endpoint create --region RegionOne network internal http://$controller:9696 
+--------------+------------------------------------------------------+
| Field        | Value                                             |
+--------------+------------------------------------------------------+
| enabled      | True                                            |
| id           | cb7e7803ff874f87838382ff228d1aea |
| interface    | internal                                       |
| region       | RegionOne                                    |
| region_id    | RegionOne                                    |
| service_id   | 808a8785807d4b8fafaaac947852654d |
| service_name | neutron                                    |
| service_type | network                                     |
| url          | http://192.168.1.60:9696                |
+--------------+-------------------------------------------------------+
  1. Configure the Neutron server.

Edit the /etc/neutron/neutron.conf file and complete the following operations:

  • Default part
[[email protected] ~]# openstack-config --set /etc/neutron/neutron.conf DEFAULT auth_strategy keystone
[[email protected] ~]# openstack-config --set /etc/neutron/neutron.conf DEFAULT core_plugin ml2
[[email protected] ~]# openstack-config --set /etc/neutron/neutron.conf DEFAULT service_plugins router
[[email protected] ~]# openstack-config --set /etc/neutron/neutron.conf DEFAULT  dhcp_agent_notification True 
[[email protected] ~]# openstack-config --set /etc/neutron/neutron.conf DEFAULT allow_overlapping_ips  True
[[email protected] ~]# openstack-config --set /etc/neutron/neutron.conf DEFAULT rpc_backend rabbit
[[email protected] ~]# openstack-config --set /etc/neutron/neutron.conf DEFAULT notify_nova_on_port_status_changes True
[[email protected] ~]# openstack-config --set /etc/neutron/neutron.conf DEFAULT notify_nova_on_port_data_changes True
[[email protected] ~]# openstack-config --set /etc/neutron/neutron.conf DEFAULT nova_url http://192.168.1.60:8774/v2
[[email protected] ~]#
  • Database part
[[email protected] ~]# openstack-config --set /etc/neutron/neutron.conf database connection mysql://neutron:[email protected]/neutron
  • keystone_authtoken part
[[email protected] ~]# openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_uri http://192.168.1.60:5000
[[email protected] ~]# openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_url http://192.168.1.60:35357
[[email protected] ~]# openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_plugin password
[[email protected] ~]# openstack-config --set /etc/neutron/neutron.conf keystone_authtoken project_domain_id default
[[email protected] ~]# openstack-config --set /etc/neutron/neutron.conf keystone_authtoken user_domain_id default
[[email protected] ~]# openstack-config --set /etc/neutron/neutron.conf keystone_authtoken project_name service
[[email protected] ~]# openstack-config --set /etc/neutron/neutron.conf keystone_authtoken username neutron
[[email protected] ~]# openstack-config --set /etc/neutron/neutron.conf keystone_authtoken password moonstack
  • New Star Festival
[[email protected] ~]# openstack-config --set /etc/neutron/neutron.conf nova auth_url http://192.168.1.60:35357
[[email protected] ~]# openstack-config --set /etc/neutron/neutron.conf nova auth_plugin password
[[email protected] ~]# openstack-config --set /etc/neutron/neutron.conf nova project_domain_id default
[[email protected] ~]# openstack-config --set /etc/neutron/neutron.conf nova user_domain_id default
[[email protected] ~]# openstack-config --set /etc/neutron/neutron.conf nova region_name RegionOne
[[email protected] ~]# openstack-config --set /etc/neutron/neutron.conf nova project_name service
[[email protected] ~]# openstack-config --set /etc/neutron/neutron.conf nova username nova
[[email protected] ~]# openstack-config --set /etc/neutron/neutron.conf nova password moonstack
  • oslo_messaging_rabbit part
[[email protected] ~]# openstack-config --set /etc/neutron/neutron.conf oslo_messaging_rabbit rabbit_host 192.168.1.60
[[email protected] ~]# openstack-config --set /etc/neutron/neutron.conf oslo_messaging_rabbit rabbit_port   5672
[[email protected] ~]# openstack-config --set /etc/neutron/neutron.conf oslo_messaging_rabbit rabbit_userid guest
[[email protected] ~]# openstack-config --set /etc/neutron/neutron.conf oslo_messaging_rabbit rabbit_password moonstack
  1. Configure Modular Layer 2 (ML2) plugins

edit /etc/neutron/plugins/ml2/ml2_conf.ini File and complete the following: in [ml2] Part, enable plane, VLAN and VXLAN network:

  • [ml2] section
[[email protected] ~]# openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 type_drivers flat
[[email protected] ~]# openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 tenant_network_types flat
[[email protected] ~]# openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 mechanism_drivers linuxbridge,l2population
[[email protected] ~]# openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 extension_drivers port_security
[[email protected] ~]#
  • ml2_type_flat
[[email protected] ~]# openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2_type_flat flat_networks public
[[email protected] ~]#
  • Security group part
 [[email protected] ~]# openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini securitygroup enable_ipset  True
  1. Configure Linux bridge agent
[[email protected] ~]# openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini linux_bridge physical_interface_mappings public:eth1
[[email protected] ~]# openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini agent prevent_arp_spoofing True
[[email protected] ~]# openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup enable_security_group True
[[email protected] ~]# openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup firewall_driver neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
  1. Configure three-tier proxy
[[email protected] ~]# openstack-config --set /etc/neutron/l3_agent.ini DEFAULT interface_driver neutron.agent.linux.interface.BridgeInterfaceDriver
[[email protected] ~]# openstack-config --set /etc/neutron/l3_agent.ini DEFAULT external_network_bridge
  1. DHCP proxy
[[email protected] ~]# openstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT interface_driver neutron.agent.linux.interface.BridgeInterfaceDriver
[[email protected] ~]# openstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT dhcp_driver neutron.agent.linux.dhcp.Dnsmasq
[[email protected] ~]# openstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT enable_isolated_metadata True
  1. Configure Metadata Agent
[[email protected] ~]# openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT auth_uri http://192.168.1.60:5000
[[email protected] ~]# openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT auth_url http://192.168.1.60:35357  
[[email protected] ~]# openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT auth_region RegionOne  
[[email protected] ~]# openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT auth_plugin password  
[[email protected] ~]# openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT project_domain_id  default
[[email protected] ~]# openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT user_domain_id default
[[email protected] ~]# openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT project_name  service 
[[email protected] ~]# openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT username  neutron
[[email protected] ~]# openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT password  moonstack
[[email protected] ~]# openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT nova_metadata_ip  192.168.1.60 
[[email protected] ~]# openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT metadata_proxy_shared_secret moonstack
  1. Configure calculations to use the network
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf neutron url http://192.168.1.60:9696 
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf neutron auth_url http://192.168.1.60:35357 
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf neutron auth_plugin password
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf neutron project_domain_id  default
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf neutron user_domain_id  default
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf neutron region_name RegionOne
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf neutron project_name service 
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf neutron username neutron 
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf neutron password moonstack
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf neutron service_metadata_proxy  True
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf neutron metadata_proxy_shared_secret  moonstack
  1. The network service initialization script requires a symbolic link /etc/neutron/plugin.ini Point to the ML2 plugin configuration file, /etc/neutron/plugins/ml2/ml2_conf.ini. If this symbolic link does not exist, use the following command to create it:
[[email protected] ~]# ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
  1. Populate the database:
[[email protected] ~]# su -s /bin/sh -c "neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head" neutron
  1. Start the network service and configure it to start at system startup. For the two network options:
[[email protected] ~]# systemctl enable neutron-server.service   neutron-linuxbridge-agent.service neutron-dhcp-agent.service   neutron-metadata-agent.service
  • Start:
[[email protected] ~]# systemctl start neutron-server.service   neutron-linuxbridge-agent.service neutron-dhcp-agent.service   neutron-metadata-agent.service
  • Check status:
[[email protected] ~]# systemctl status  neutron-server.service   neutron-linuxbridge-agent.service neutron-dhcp-agent.service   neutron-metadata-agent.service
● neutron-server.service - OpenStack Neutron Server
   Loaded: loaded (/usr/lib/systemd/system/neutron-server.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2016-03-29 00:19:10 EAT; 8min ago
 Main PID: 3255 (neutron-server)
   CGroup: /system.slice/neutron-server.service
           ├─3255 /usr/bin/python2 /usr/bin/neutron-server --config-file /usr/share/neutron/neut...
           ├─3316 /usr/bin/python2 /usr/bin/neutron-server --config-file /usr/share/neutron/neut...
           ├─3317 /usr/bin/python2 /usr/bin/neutron-server --config-file /usr/share/neutron/neut...
           ├─3318 /usr/bin/python2 /usr/bin/neutron-server --config-file /usr/share/neutron/neut...
           ├─3319 /usr/bin/python2 /usr/bin/neutron-server --config-file /usr/share/neutron/neut...
           └─3320 /usr/bin/python2 /usr/bin/neutron-server --config-file /usr/share/neutron/neut...

Mar 29 00:19:07 controller systemd[1]: Starting OpenStack Neutron Server...
Mar 29 00:19:08 controller neutron-server[3255]: No handlers could be found for logger "neutro...a"
Mar 29 00:19:10 controller systemd[1]: Started OpenStack Neutron Server.
Mar 29 00:19:15 controller systemd[1]: Started OpenStack Neutron Server.
Mar 29 00:27:30 controller systemd[1]: Started OpenStack Neutron Server.

● neutron-linuxbridge-agent.service - OpenStack Neutron Linux Bridge Agent
   Loaded: loaded (/usr/lib/systemd/system/neutron-linuxbridge-agent.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2016-03-29 00:19:07 EAT; 8min ago
 Main PID: 3256 (neutron-linuxbr)
   CGroup: /system.slice/neutron-linuxbridge-agent.service
           ├─3256 /usr/bin/python2 /usr/bin/neutron-linuxbridge-agent --config-file /usr/share/n...
           ├─3295 sudo neutron-rootwrap-daemon /etc/neutron/rootwrap.conf
           └─3297 /usr/bin/python2 /usr/bin/neutron-rootwrap-daemon /etc/neutron/rootwrap.conf

Mar 29 00:19:07 controller systemd[1]: Started OpenStack Neutron Linux Bridge Agent.
Mar 29 00:19:07 controller systemd[1]: Starting OpenStack Neutron Linux Bridge Agent...
Mar 29 00:19:08 controller neutron-linuxbridge-agent[3256]: No handlers could be found for logg..."
Mar 29 00:19:08 controller sudo[3295]:  neutron : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/...onf
Mar 29 00:19:15 controller systemd[1]: Started OpenStack Neutron Linux Bridge Agent.
Mar 29 00:19:58 controller systemd[1]: Started OpenStack Neutron Linux Bridge Agent.
Mar 29 00:23:33 controller systemd[1]: Started OpenStack Neutron Linux Bridge Agent.
Mar 29 00:27:30 controller systemd[1]: Started OpenStack Neutron Linux Bridge Agent.

● neutron-dhcp-agent.service - OpenStack Neutron DHCP Agent
   Loaded: loaded (/usr/lib/systemd/system/neutron-dhcp-agent.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2016-03-29 00:19:07 EAT; 8min ago
 Main PID: 3257 (neutron-dhcp-ag)
   CGroup: /system.slice/neutron-dhcp-agent.service
           └─3257 /usr/bin/python2 /usr/bin/neutron-dhcp-agent --config-file /usr/share/neutron/...

Mar 29 00:19:07 controller systemd[1]: Started OpenStack Neutron DHCP Agent.
Mar 29 00:19:07 controller systemd[1]: Starting OpenStack Neutron DHCP Agent...
Mar 29 00:19:08 controller neutron-dhcp-agent[3257]: No handlers could be found for logger "os...g"
Mar 29 00:19:15 controller systemd[1]: Started OpenStack Neutron DHCP Agent.
Mar 29 00:27:30 controller systemd[1]: Started OpenStack Neutron DHCP Agent.

● neutron-metadata-agent.service - OpenStack Neutron Metadata Agent
   Loaded: loaded (/usr/lib/systemd/system/neutron-metadata-agent.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2016-03-29 00:19:07 EAT; 8min ago
 Main PID: 3258 (neutron-metadat)
   CGroup: /system.slice/neutron-metadata-agent.service
           ├─3258 /usr/bin/python2 /usr/bin/neutron-metadata-agent --config-file /usr/share/neut...
           ├─3294 /usr/bin/python2 /usr/bin/neutron-metadata-agent --config-file /usr/share/neut...
           └─3296 /usr/bin/python2 /usr/bin/neutron-metadata-agent --config-file /usr/share/neut...

Mar 29 00:19:07 controller systemd[1]: Started OpenStack Neutron Metadata Agent.
Mar 29 00:19:07 controller systemd[1]: Starting OpenStack Neutron Metadata Agent...
Mar 29 00:19:08 controller neutron-metadata-agent[3258]: No handlers could be found for logger...g"
Mar 29 00:19:15 controller systemd[1]: Started OpenStack Neutron Metadata Agent.
Mar 29 00:27:30 controller systemd[1]: Started OpenStack Neutron Metadata Agent.
Hint: Some lines were ellipsized, use -l to show in full.
[[email protected] ~]#
  1. List the loaded extensions to verify whether the neutron server process started successfully:
  • Create environment variable load file
[[email protected] ~]# vim ~/admin-rc

Add the following to change your OS_AUTH_URL and OS_PASSWORD:

export OS_PROJECT_DOMAIN_ID=default
export OS_USER_DOMAIN_ID=default
export OS_PROJECT_NAME=admin
export OS_TENANT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=moonstack
export OS_AUTH_URL=http://192.168.1.60:35357/v3
export OS_IDENTITY_API_VERSION=3

Change permissions and get files

[[email protected] ~]# chmod 600 ~/admin-rc
[[email protected] ~]# source ~/admin-rc
[[email protected] ~]# echo "source ~/admin-rc " >> ~/.bash_profile

then:

[[email protected] ~]# neutron ext-list

  1. Create a flat network.
[[email protected] ~]# neutron net-create public --shared --provider:physical_network public --provider:network_type flat
  1. Create a subnet:
[[email protected] ~]# neutron subnet-create public 192.168.1.0/24 --name public   --allocation-pool start=192.168.1.2,end=192.168.1.9

We created Flat Network in this guide. If you have configured vlan in your home office network, you can create a VLAN network. Previous tutorial:

Openstack Liberty Lab Part V: Configure Nova Computing Service

Next:

Openstack Liberty Lab Part 7: Configure Horizon Dashboard Service

You can download this article in PDF format via the link below to support us.Download the guide in PDF formatClose

Sidebar