We’ll install Neutron Server on Control node which Keystone/Glance/Nova API are already installed.For our case, the control node runs all openstack services. Before writing this part of the tutorial, i had covered the following parts:

Openstack Liberty Lab Part One: Setup Networking and all Prerequisites

Openstack Liberty Lab Part Two: Install Openstack Packages

Openstack Liberty Lab Part Three: Configuring Keystone identity service

Openstack Liberty Lab Part Four: Configuring Glance Image Service

Openstack Liberty Lab Part Five: Configure Nova Compute Service

Follow steps provided below to get Neutron server running:

  1. Configure Database on MariaDB for Neutron
[root@controller ~]# 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 neutron@'localhost' identified by 'moonstack';
Query OK, 0 rows affected (0.00 sec) 
MariaDB [(none)]> grant all privileges on neutron.* to neutron@'%' 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 user,and assign admin role, add endpoints
  • Add neutron user
[root@controller ~]# 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 |
+--------------------+----------------------------------+
[root@controller ~]# openstack role add --project service --user neutron admin 
[root@controller ~]#
  •  Add service entry:
 [root@controller ~]# openstack service create --name neutron --description "OpenStack Networking service" network 
+--------------------+------------------------------------------------------------------+
| Field             | Value                                                         |
+-------------------+------------------------------------------------------------------+
| description | OpenStack Networking service            |
| enabled      | True                                                        |
| id                | 808a8785807d4b8fafaaac947852654d |
| name         | neutron                                                    |
| type           | network                                                   |
+-----------------+------------------------------------------------------------------+
[root@controller ~]#
  • Add endpoint:
[root@controller ~]# export controller=192.168.1.60 
[root@controller ~]# 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                                  |
+--------------+-------------------------------------------------------------------------+
[root@controller ~]# 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         |
+--------------+----------------------------------+
[root@controller ~]# 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 Neutron Server.

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

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

Edit the /etc/neutron/plugins/ml2/ml2_conf.ini file and complete the following actions:
In the [ml2] section, enable flat, VLAN, and VXLAN networks:

  •   [ml2] section section
[root@controller ~]# openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 type_drivers flat
[root@controller ~]# openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 tenant_network_types flat
[root@controller ~]# openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 mechanism_drivers linuxbridge,l2population
[root@controller ~]# openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 extension_drivers port_security
[root@controller ~]#
  • ml2_type_flat
[root@controller ~]# openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2_type_flat flat_networks public
[root@controller ~]#
  •   securitygroup section
 [root@controller ~]# openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini securitygroup enable_ipset  True
  1. Configure the Linux bridge agent
[root@controller ~]# openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini linux_bridge physical_interface_mappings public:eth1
[root@controller ~]# openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini agent prevent_arp_spoofing True
[root@controller ~]# openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup enable_security_group True
[root@controller ~]# openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup firewall_driver neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
  1. Configure the layer-3 agent
[root@controller ~]# openstack-config --set /etc/neutron/l3_agent.ini DEFAULT interface_driver neutron.agent.linux.interface.BridgeInterfaceDriver
[root@controller ~]# openstack-config --set /etc/neutron/l3_agent.ini DEFAULT external_network_bridge
  1. DHCP agent
[root@controller ~]# openstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT interface_driver neutron.agent.linux.interface.BridgeInterfaceDriver
[root@controller ~]# openstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT dhcp_driver neutron.agent.linux.dhcp.Dnsmasq
[root@controller ~]# openstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT enable_isolated_metadata True
  1. Configure the metadata agent
[root@controller ~]# openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT auth_uri http://192.168.1.60:5000
[root@controller ~]# openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT auth_url http://192.168.1.60:35357  
[root@controller ~]# openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT auth_region RegionOne  
[root@controller ~]# openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT auth_plugin password  
[root@controller ~]# openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT project_domain_id  default
[root@controller ~]# openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT user_domain_id default
[root@controller ~]# openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT project_name  service 
[root@controller ~]# openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT username  neutron
[root@controller ~]# openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT password  moonstack
[root@controller ~]# openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT nova_metadata_ip  192.168.1.60 
[root@controller ~]# openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT metadata_proxy_shared_secret moonstack
  1. Configure Compute to use Networking
[root@controller ~]# openstack-config --set /etc/nova/nova.conf neutron url http://192.168.1.60:9696 
[root@controller ~]# openstack-config --set /etc/nova/nova.conf neutron auth_url http://192.168.1.60:35357 
[root@controller ~]# openstack-config --set /etc/nova/nova.conf neutron auth_plugin password
[root@controller ~]# openstack-config --set /etc/nova/nova.conf neutron project_domain_id  default
[root@controller ~]# openstack-config --set /etc/nova/nova.conf neutron user_domain_id  default
[root@controller ~]# openstack-config --set /etc/nova/nova.conf neutron region_name RegionOne
[root@controller ~]# openstack-config --set /etc/nova/nova.conf neutron project_name service 
[root@controller ~]# openstack-config --set /etc/nova/nova.conf neutron username neutron 
[root@controller ~]# openstack-config --set /etc/nova/nova.conf neutron password moonstack
[root@controller ~]# openstack-config --set /etc/nova/nova.conf neutron service_metadata_proxy  True
[root@controller ~]# openstack-config --set /etc/nova/nova.conf neutron metadata_proxy_shared_secret  moonstack
  1. The Networking service initialization scripts expect a symbolic link /etc/neutron/plugin.ini pointing to the ML2 plug-in configuration file, /etc/neutron/plugins/ml2/ml2_conf.ini. If this symbolic link does not exist, create it using the following command:
[root@controller ~]# ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
  1. Populate the database:
[root@controller ~]# 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 Networking services and configure them to start when the system boots.For both networking options:
[root@controller ~]# systemctl enable neutron-server.service   neutron-linuxbridge-agent.service neutron-dhcp-agent.service   neutron-metadata-agent.service
  • Start:
[root@controller ~]# systemctl start neutron-server.service   neutron-linuxbridge-agent.service neutron-dhcp-agent.service   neutron-metadata-agent.service
  • Check status:
[root@controller ~]# 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.
[root@controller ~]#
  1. List loaded extensions to verify successful launch of the neutron-server process:
  • Create environment variable load file
[root@controller ~]# vim ~/admin-rc

Add following contents, 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 source the file

[root@controller ~]# chmod 600 ~/admin-rc
[root@controller ~]# source ~/admin-rc
[root@controller ~]# echo "source ~/admin-rc " >> ~/.bash_profile

Then:

[root@controller ~]# neutron ext-list

  1. Create Flat Network.
[root@controller ~]# neutron net-create public --shared --provider:physical_network public --provider:network_type flat
  1. Create subnet:
[root@controller ~]# 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. You may create VLAN network if you’ve vlan configured in your Home,office network.
PREVIOUS TUTORIAL:

Openstack Liberty Lab Part Five: Configure Nova Compute Service

NEXT TUTORIAL:

Openstack Liberty Lab Part Seven: Configure Horizon Dashboard Service