Create database for Neutron service
CREATE DATABASE neutron;
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
exit
Create neutron user and add admin role
. admin-openrc
openstack user create --domain default --password-prompt neutron
openstack role add --project homelab --user neutron admin
Create service entity and end points
openstack service create --name neutron --description "OpenStack Networking" network
openstack endpoint create --region RegionOne network public http://controller:9696
openstack endpoint create --region RegionOne network internal http://controller:9696
openstack endpoint create --region RegionOne network admin http://controller:9696
Preferring to go with Self Service Networks option – Install the required components
apt install -y neutron-server neutron-plugin-ml2 neutron-linuxbridge-agent neutron-dhcp-agent neutron-metadata-agent neutron-l3-agent
Update /etc/neutron/neutron.conf with following configurations in respective sections
[DEFAULT]
core_plugin = ml2
service_plugins = router
allow_overlapping_ips = true
transport_url = rabbit://openstack:password@controller
auth_strategy = keystone
notify_nova_on_port_status_changes = true
notify_nova_on_port_data_changes = true
[database]
connection = mysql+pymysql://neutron:password@controller/neutron
[keystone_authtoken]
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = homelab
username = neutron
password = password
[nova]
auth_url = http://controller:5000
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = homelab
username = nova
password = password
[oslo_concurrency]
lock_path = /var/lib/neutron/tmp
Configure the Modular Layer 2 (ML2) plug-in – edit /etc/neutron/plugins/ml2/ml2_conf.ini and update the following configurations in respective sections
[ml2]
type_drivers = flat,vlan,vxlan
tenant_network_types = vxlan
mechanism_drivers = linuxbridge,l2population
extension_drivers = port_security
[ml2_type_flat]
flat_networks = provider
[ml2_type_vxlan]
vni_ranges = 1:1000
[securitygroup]
enable_ipset = true
Configure the Linux bridge agent – edit /etc/neutron/plugins/ml2/linuxbridge_agent.ini and update the following configurations in respective sections
[linux_bridge]
physical_interface_mappings = provider:eno2
[vxlan]
enable_vxlan = true
local_ip = 10.99.1.3
l2_population = true
[securitygroup]
enable_security_group = true
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
Configure the layer-3 agent – edit /etc/neutron/l3_agent.ini
[DEFAULT]
interface_driver = linuxbridge
Configure the DHCP agent – edit /etc/neutron/dhcp_agent.ini
and update the following configurations
[DEFAULT]
interface_driver = linuxbridge
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = true
Configure the metadata agent – Edit /etc/neutron/metadata_agent.ini
[DEFAULT]
nova_metadata_host = controller
metadata_proxy_shared_secret = password
Configure the Compute service to use the Networking service – Edit the /etc/nova/nova.conf
[neutron]
auth_url = http://controller:5000
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = homelab
username = neutron
password = password
service_metadata_proxy = true
metadata_proxy_shared_secret = password
Populate the database
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
Restart the Compute API service, Networking services
service nova-api restart
service neutron-server restart
service neutron-linuxbridge-agent restart
service neutron-dhcp-agent restart
service neutron-metadata-agent restart
service neutron-l3-agent restart
Verify
openstack network agent list
+--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+
| ID | Agent Type | Host | Availability Zone | Alive | State | Binary |
+--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+
| 1999125d-e584-4746-b0fc-43b1ec496266 | L3 agent | controller | nova | :-) | UP | neutron-l3-agent |
| 3ba9cd5b-0259-4237-8aa2-49d79857401d | DHCP agent | controller | nova | :-) | UP | neutron-dhcp-agent |
| 9c45cf40-0908-45d1-a408-56a9956c2fe3 | Metadata agent | controller | None | :-) | UP | neutron-metadata-agent |
| fd074e21-ded1-4ba9-a0f5-7de5535d46da | Linux bridge agent | controller | None | :-) | UP | neutron-linuxbridge-agent |
+--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+