In order to achieve multiple external networks in Neutron, where each external network has different subnet and default gateway, we need multiple L3 agents. Note: this is only for Havana and below, since Change Id260a239 (developed in Icehouse cycle) multiple external networks can be handled by single l3-agent.
Official documentation has cover on this, I will cover much detail in this article.
br-ex you originally have, we need to create a new OVS bridge
br-ex-2, then add the physical interface connected to that external network to
If there is IP address already associated with that physical interface (eth3), you need to clear it with:
# ip addr del x.y.z.w dev eth3
Create the bridge and add the port:
# ovs-vsctl add-br br-ex-2 # ovs-vsctl add-port br-ex-2 eth3
Same as when you configured
br-ex , configure
/etc/network/interfaces like this:
# We need the section below or eth3 will not be up on boot auto eth3 iface eth3 inet manual up ifconfig $IFACE 0.0.0.0 up up ip link set $IFACE promisc on down ip link set $IFACE promisc off down ifconfig $IFACE down # br-ex-2 should have a IP belongs to that external subnet, default gateway should not be needed, since you already have br-ex auto br-ex-2 iface br-ex-2 inet static address x.y.z.w netmask 255.255.255.0 network x.y.z.0 broadcast x.y.z.255
Each l3-agent has respective
# l3_agent.ini [DEFAULT] host = network external_network_bridge = br-ex metadata_port = 8775 gateway_external_network_id = 9de13fee-fdcf-4343-9a8b-9f04deaf0d41 # Your external network id obtained via neutron net-list router_id = 046c79ed-64f3-40ce-9328-f8b6329e81f4 # Your external router ID obtained via neutron router-list # OVS interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver
# l3_agent-2.ini [DEFAULT] #debug = True host = network-psuedo2 external_network_bridge = br-ex-2 metadata_port = 8775 handle_internal_only_routers = False gateway_external_network_id = cc4ad4e0-e86e-43cf-bcd8-36de71be8b01 router_id = 6e9cc927-73ba-40e4-8d2e-e2a8fca24280 # OVS interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver
host directive distinguishes multiple l3-agents, or they’ll be recognized as the same agent in Neutron.
Also add network-psuedo2 to
/etc/hosts , point to the IP address you set on br-ex-2:
Now just start the agent in commandline:
# /usr/bin/python /usr/bin/neutron-l3-agent --config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/l3_agent-2.ini --log-file=/var/log/neutron/-agent-2.log
Note: I’m not sure if there’s any risk running l3-agent as root, but I have yet to figure out a way to run it as the neutron user. You can also combine