Setting Up a Flat Network with Neutron

Data Network

This setup will allow the VMs to use an existing network. In this example, eth2 is connected to this pre-existing network (192.168.2.0/24) that we want to use for the OpenStack VMs.

All the configuration is done in the node dedicated to Nova Networking.

1. Set up the Open vSwitch bridge:

# ovs-vsctl add-br br-eth2
# ovs-vsctl add-port br-eth2 eth2

2. Set up /etc/network/interfaces (node’s IP is 192.168.2.7):

auto eth2
iface eth2 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

auto br-eth2
iface br-eth2 inet static
address 192.168.2.7
netmask 255.255.255.0

3. Tell Open vSwitch to use the bridge connected to eth2 (br-eth2) and map physnet1 to it /etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini:

[ovs]
network_vlan_ranges = physnet1
bridge_mappings = physnet1:br-eth2

4. Tell Neutron to not to use the metadata proxy in /etc/nova/nova.conf (otherwise you get a HTTP 400 when querying the metadata service):

service_neutron_metadata_proxy=false

Note that the metadata service is managed by Neutron as usual via the neutron-metadata-agent service anyway.

5. Create the network telling to use the physnet1 mapped above to br-eth2:

# neutron net-create flat-provider-network --shared  --provider:network_type flat --provider:physical_network physnet1

6. Create the subnet:

# neutron subnet-create --name flat-provider-subnet --gateway 192.168.2.5 --dns-nameserver 192.168.1.254  --allocation-pool start=192.168.2.100,end=192.168.2.150  flat-provider-network 192.168.2.0/24

That’s it. Now VMs will get an IP of the specified range and will be directly connected to our network via Open vSwitch.

5 thoughts on “Setting Up a Flat Network with Neutron

  1. When I try to create the network in step 5, I get the following error:

    400-{u’NeutronError’: {u’message’: u’Invalid input for operation: Unknown provider:physical_network physnet1.’, u’type’: u’InvalidInput’, u’detail’: u”}}

    I did modify nova.conf as indicated in step 4, and restarted services… any ideas on what’s going wrong?

    • Make sure you defined physnet1 in step 3 with network_vlan_ranges and bridge_mappings in ovs_neutron_plugin.ini and restart the neutron services before proceeding to step 5.

  2. I noticed that you set ‘–dns-nameserver 192.168.1.254′ when you set up your subnet. This is not an address on your 192.168.2.0/24 network.
    I assume this has something to do with resolving the meta-data agent, but I’m not 100% on this. Could you elaborate a little?

    Thanks

    • Sure, as I also specified a gateway (192.168.2.5) the DNS server on 192.168.1.254 can be reached via the defined gateway.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s