7.9. Configure the L3 Agent
Follow the steps listed in this procedure to configure the L3 agent. All steps listed in this procedure must be performed on the network node while logged in as the
root user.
Procedure 7.18. Configuring the L3 Agent
Configuring Authentication
- Set the authentication strategy (
auth_strategy) configuration key tokeystoneusing theopenstack-configcommand.#openstack-config --set /etc/neutron/metadata_agent.ini \DEFAULT auth_strategy keystone - Set the authentication host (
auth_host) configuration key to the IP address or host name of the Identity server.#openstack-config --set /etc/neutron/metadata_agent.ini \keystone_authtoken auth_host IPReplace IP with the IP address or host name of the Identity server. - Set the administration tenant name (
admin_tenant_name) configuration key to the name of the tenant that was created for the use of the networking services. Examples in this guide use services.#openstack-config --set /etc/neutron/metadata_agent.ini \keystone_authtoken admin_tenant_name services - Set the administration user name (
admin_user) configuration key to the name of the user that was created for the use of the networking services. Examples in this guide use neutron.#openstack-config --set /etc/neutron/metadata_agent.ini \keystone_authtoken admin_user neutron - Set the administration password (
admin_password) configuration key to the password that is associated with the user specified in the previous step.#openstack-config --set /etc/neutron/metadata_agent.ini \keystone_authtoken admin_password PASSWORDNote
When used inadmin_password, the $ and " " (space-bar) special characters must be properly escaped. Escape the $ incomplex$passwordwith a second $ to becomecomplex$$password. Escape the " " (space-bar) char with quotation marks:complex passwordbecomes"complex password".
Configuring the Interface Driver
Set the value of theinterface_driverconfiguration key in the/etc/neutron/l3_agent.inifile based on the networking plug-in being used. Execute only the configuration step that applies to the plug-in used in your environment.Open vSwitch Interface Driver
#openstack-config --set /etc/neutron/l3_agent.ini \DEFAULT interface_driver neutron.agent.linux.interface.OVSInterfaceDriverLinux Bridge Interface Driver
#openstack-config --set /etc/neutron/l3_agent.ini \DEFAULT interface_driver neutron.agent.linux.interface.BridgeInterfaceDriver
Configuring External Network Access
The L3 agent connects to external networks using either an external bridge or an external provider network. When using the Open vSwitch plug-in either approach is supported. When using the Linux Bridge plug-in only the use of an external provider network is supported. Choose the approach that is most appropriate for the environment.Using an External Bridge
To use an external bridge you must create and configure it. Finally the OpenStack networking configuration must be updated to use it. This must be done on each system hosting an instance of the L3 agent.- Use the
ovs-ctlcommand to create the external bridge namedbr-ex.#ovs-vsctl add-br br-ex - Ensure that the
br-exdevice persists on reboot by creating a/etc/sysconfig/network-scripts/ifcfg-br-exfile with these contents:DEVICE=br-ex DEVICETYPE=ovs TYPE=OVSBridge ONBOOT=yes BOOTPROTO=none
- Ensure that the value of the
external_network_bridgeconfiguration key in the/etc/neutron/l3_agent.inifile isbr-ex. This ensures that the L3 agent will use the external bridge.#openstack-config --set /etc/neutron/l3_agent.ini \DEFAULT external_network_bridge br-ex
Using a Provider Network
To connect the L3 agent to external networks using a provider network you must first have created the provider network. You must also have created a subnet and router to associate with it. The unique identifier of the router will be required to complete these steps.The value of theexternal_network_bridgeconfiguration key in the/etc/neutron/l3_agent.inifile must be blank. This ensures that the L3 agent does not attempt to use an external bridge.#openstack-config --set /etc/neutron/l3_agent.ini \DEFAULT external_network_bridge ""
Starting the L3 Agent
- Use the
servicecommand to start theneutron-l3-agentservice.#service neutron-l3-agent start - Use the
chkconfigcommand to ensure that theneutron-l3-agentservice will be started automatically in the future.#chkconfig neutron-l3-agent on
Starting the Metadata Agent
The OpenStack networking metadata agent allows virtual machine instances to communicate with the compute metadata service. It runs on the same hosts as the Layer 3 (L3) agent.- Use the
servicecommand to start theneutron-metadata-agentservice.#service neutron-metadata-agent start - Use the
chkconfigcommand to ensure that theneutron-metadata-agentservice will be started automatically in the future.#chkconfig neutron-metadata-agent on
The L3 agent has been configured and started.Enable leastrouter scheduling
The leastrouter scheduler enumerates L3 Agent router assignment, and consequently schedules the router to the L3 Agent with the fewest routers. This differs from the ChanceScheduler behaviour, which randomly selects from the candidate pool of L3 Agents. Enable the leastrouter scheduler by changing therouter_scheduler_driveroption in theneutron.conffile:router_scheduler_driver=neutron.scheduler.l3_agent_scheduler.LeastRoutersScheduler
The router is scheduled once connected to a network. Unschedule the router using theneutroncommand:
Assign the router with using the#neutron l3-agent-router-remove [l3 node] [router]neutroncommand:#neutron l3-agent-router-add [l3 node] [router]