Prerequisites
Before you configure OpenStack Networking, you must enable certain kernel networking functions.
Edit
/etc/sysctl.conf
to contain the following:net.ipv4.ip_forward=1 net.ipv4.conf.all.rp_filter=0 net.ipv4.conf.default.rp_filter=0
Implement the changes:
# sysctl -p
To install the Networking components
# yum install openstack-neutron openstack-neutron-ml2 \ openstack-neutron-openvswitch
To configure the Networking common components
The Networking common component configuration includes the authentication mechanism, message broker, and plug-in.
Configure Networking to use the Identity service for authentication:
Replace
NEUTRON_PASS
with the password you chose for theneutron
user in the Identity service.# openstack-config --set /etc/neutron/neutron.conf DEFAULT \ auth_strategy keystone # openstack-config --set /etc/neutron/neutron.conf keystone_authtoken \ auth_uri http://
controller
:5000 # openstack-config --set /etc/neutron/neutron.conf keystone_authtoken \ auth_hostcontroller
# openstack-config --set /etc/neutron/neutron.conf keystone_authtoken \ auth_protocol http # openstack-config --set /etc/neutron/neutron.conf keystone_authtoken \ auth_port 35357 # openstack-config --set /etc/neutron/neutron.conf keystone_authtoken \ admin_tenant_name service # openstack-config --set /etc/neutron/neutron.conf keystone_authtoken \ admin_user neutron # openstack-config --set /etc/neutron/neutron.conf keystone_authtoken \ admin_passwordNEUTRON_PASS
Configure Networking to use the message broker:
# openstack-config --set /etc/neutron/neutron.conf DEFAULT \ rpc_backend neutron.openstack.common.rpc.impl_qpid # openstack-config --set /etc/neutron/neutron.conf DEFAULT \ qpid_hostname
controller
Configure Networking to use the Modular Layer 2 (ML2) plug-in and associated services:
# openstack-config --set /etc/neutron/neutron.conf DEFAULT \ core_plugin ml2 # openstack-config --set /etc/neutron/neutron.conf DEFAULT \ service_plugins router
Note We recommend adding
verbose = True
to the[DEFAULT]
section in/etc/neutron/neutron.conf
to assist with troubleshooting.Comment out any lines in the
[service_providers]
section.
To configure the Layer-3 (L3) agent
The Layer-3 (L3) agent provides routing services for instance virtual networks.
Run the following commands:
# openstack-config --set /etc/neutron/l3_agent.ini DEFAULT \ interface_driver neutron.agent.linux.interface.OVSInterfaceDriver # openstack-config --set /etc/neutron/l3_agent.ini DEFAULT \ use_namespaces True
Note We recommend adding
verbose = True
to the[DEFAULT]
section in/etc/neutron/l3_agent.ini
to assist with troubleshooting.
To configure the DHCP agent
The DHCP agent provides DHCP services for instance virtual networks.
Run the following commands:
# openstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT \ interface_driver neutron.agent.linux.interface.OVSInterfaceDriver # openstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT \ dhcp_driver neutron.agent.linux.dhcp.Dnsmasq # openstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT \ use_namespaces True
Note We recommend adding
verbose = True
to the[DEFAULT]
section in/etc/neutron/dhcp_agent.ini
to assist with troubleshooting.
To configure the metadata agent
The metadata agent provides configuration information such as credentials for remote access to instances.
Run the following commands:
Replace
NEUTRON_PASS
with the password you chose for theneutron
user in the Identity service. ReplaceMETADATA_SECRET
with a suitable secret for the metadata proxy.# openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT \ auth_url http://
controller
:5000/v2.0 # openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT \ auth_region regionOne # openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT \ admin_tenant_name service # openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT \ admin_user neutron # openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT \ admin_passwordNEUTRON_PASS
# openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT \ nova_metadata_ipcontroller
# openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT \ metadata_proxy_shared_secretMETADATA_SECRET
Note We recommend adding
verbose = True
to the[DEFAULT]
section in/etc/neutron/metadata_agent.ini
to assist with troubleshooting.Note Perform the next two steps on the controller node.
On the controller node, configure Compute to use the metadata service:
Replace
METADATA_SECRET
with the secret you chose for the metadata proxy.# openstack-config --set /etc/nova/nova.conf DEFAULT \ service_neutron_metadata_proxy true # openstack-config --set /etc/nova/nova.conf DEFAULT \ neutron_metadata_proxy_shared_secret
METADATA_SECRET
On the controller node, restart the Compute API service:
# service openstack-nova-api restart
To configure the Modular Layer 2 (ML2) plug-in
The ML2 plug-in uses the Open vSwitch (OVS) mechanism (agent) to build virtual networking framework for instances.
Run the following commands:
Replace
INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS
with the IP address of the instance tunnels network interface on your network node. This guide uses10.0.1.21
for the IP address of the instance tunnels network interface on the network node.# openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 \ type_drivers gre # openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 \ tenant_network_types gre # openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 \ mechanism_drivers openvswitch # openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2_type_gre \ tunnel_id_ranges 1:1000 # openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ovs \ local_ip
INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS
# openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ovs \ tunnel_type gre # openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ovs \ enable_tunneling True # openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini securitygroup \ firewall_driver neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver # openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini securitygroup \ enable_security_group True
To configure the Open vSwitch (OVS) service
The OVS service provides the underlying virtual networking framework
for instances. The integration bridge br-int
handles
internal instance network traffic within OVS. The external bridge
br-ext
handles external instance network traffic
within OVS. The external bridge requires a port on the physical external
network interface to provide instances with external network access.
In essence, this port bridges the virtual and physical external
networks in your environment.
Start the OVS service and configure it to start when the system boots:
# service openvswitch start # chkconfig openvswitch on
Add the integration bridge:
# ovs-vsctl add-br br-int
Add the external bridge:
# ovs-vsctl add-br br-ex
Add a port to the external bridge that connects to the physical external network interface:
Replace
INTERFACE_NAME
with the actual interface name. For example, eth2 or ens256.# ovs-vsctl add-port br-ex
INTERFACE_NAME
Note Depending on your network interface driver, you may need to disable Generic Receive Offload (GRO) to achieve suitable throughput between your instances and the external network.
To temporarily disable GRO on the external network interface while testing your environment:
# ethtool -K
INTERFACE_NAME
gro off
To finalize the installation
The Networking service initialization scripts expect a symbolic link
/etc/neutron/plugin.ini
pointing to the configuration file associated with your chosen plug-in. Using the ML2 plug-in, for example, the symbolic link must point to/etc/neutron/plugins/ml2/ml2_conf.ini
. If this symbolic link does not exist, create it using the following commands:# ln -s plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
Due to a packaging bug, the Open vSwitch agent initialization script explicitly looks for the Open vSwitch plug-in configuration file rather than a symbolic link
/etc/neutron/plugin.ini
pointing to the ML2 plug-in configuration file. Run the following commands to resolve this issue:# cp /etc/init.d/neutron-openvswitch-agent /etc/init.d/neutron-openvswitch-agent.orig # sed -i 's,plugins/openvswitch/ovs_neutron_plugin.ini,plugin.ini,g' /etc/init.d/neutron-openvswitch-agent
Start the Networking services and configure them to start when the system boots:
# service neutron-openvswitch-agent start # service neutron-l3-agent start # service neutron-dhcp-agent start # service neutron-metadata-agent start # chkconfig neutron-openvswitch-agent on # chkconfig neutron-l3-agent on # chkconfig neutron-dhcp-agent on # chkconfig neutron-metadata-agent on