<commit_before>---
title: Neutron with OVS and VLANs
category: networking
authors: adarazs, dneary, jlewis, rbowen, rkukura, rvaknin
wiki_category: Networking
wiki_title: Neutron with OVS and VLANs
wiki_revision_count: 27
wiki_last_updated: 2013-12-18
---

__NOTOC__

# Neutron Installation with OVS and VLANs (Grizzly)

### Preface

#### Components

Neutron consists of the following components:

**`Neutron` `service`**` - the API service.`
**`Neutron` `metadata` `agent`**` - proxies metadata requests from instances even in isolated networks to nova-api.`
**`L2` `agent`**` - agent which talks with the layer 2 plugin like OVS (Open vSwitch) or LB (Linux bridge) etc.`
**`L3` `agent`**` - layer 3 agent which mainly responsible for the routing and NAT (used for floating IP <--> private IP convertions).`
**`DHCP` `agent`**` - responsible to provide a private IP address to an instance that looks for his address.`

#### Some Notes

All components can be installed in one machine or distributed to different machines (and all the in-between variants).

L2 agent should run on all machines except for the Neutron service machine (unless Neutron service resides with other component in the same machine).

It's possible to install multiple L3/DHCP/metadata agents.

### Installation (packstack)

#### Installation Machines

The following packstack configuration define where each component is installed:

      CONFIG_QUANTUM_SERVER_HOST=ip
      CONFIG_QUANTUM_L3_HOSTS=ip_or_comma_separated_ips
      CONFIG_QUANTUM_DHCP_HOSTS=ip_or_comma_separated_ips
      CONFIG_QUANTUM_METADATA_HOSTS=ip_or_comma_separated_ips

Can hostnames be used instead of IPs?

#### Layer 2 Configuration

The following packstack configuration defines L2 tenant network allocation as VLANs:

      CONFIG_QUANTUM_OVS_TENANT_NETWORK_TYPE=vlan
      CONFIG_QUANTUM_OVS_VLAN_RANGES=inter-vlan:1200:1205
      # inter-vlan - the name of the physical_network used for the VLANs
      # 1200:1205 - the range of VLANs available for tenant network allocation
       
      CONFIG_QUANTUM_OVS_BRIDGE_MAPPINGS=inter-vlan:br-instances
      # mapping from the physical_network name to the bridge name
      # inter-vlan - the name of the physical_network used for the VLANs
      # br-instances - the bridge name
      CONFIG_QUANTUM_OVS_BRIDGE_IFACES=br-instances:eth0
      # mapping from the bridge name to the physical interface name
      # br-instances - the bridge name
      # eth0 - the interface name

For a VLAN configuration you will need:

*   a network interface (i.e. "eth0") on each compute and network node connected to a switch that is configured to trunk a set of VLANs (i.e. 1200-1205)
*   a name (i.e."'inter-vlan") for the physical_network (the switch or set of switches) to which these interfaces are connected
*   a name (i.e. "br-instances") for the OVS bridge that will be connected to these interfaces on each node

Note: You can specify non-continuous ranges of VLANs in this form:

      CONFIG_QUANTUM_OVS_VLAN_RANGES=inter-vlan:182:182,inter-vlan:206:207

This specifies that the VLANs 182 and 206-207 on physical_network "inter-vlan" are available for allocation as tenant networks.

It is also possible to configure multiple physical_networks, each with separate ranges of VLANs available for tenant networks on each, by mapping them to separate OVS bridges and interfaces, but details are not covered here.

#### Workaround for Unsupported NIC Driver

Working with unsupported NIC drivers (like "be2net") might lead to hangs in TCP connections when VLANs are used with OVS. In order to workaround this issue, you can enable "VLAN Splinters" for the interface:

Run the following command on all L2 agent machines after packstack installation:

      ovs-vsctl set interface eth0 other-config:enable-vlan-splinters=true

More infor can be found in: <https://www.redhat.com/archives/rhos-list/2013-June/msg00066.html>

#### External Network Access Method

By default, the L3 agent uses a separate bridge ("br-ex") to access the external network, which works fine for simple cases where the external network is on a separate interface from the tenant networks and is not VLAN tagged. In this example, we instead use a provider network on the same bridge and interface as the tenant networks for the external network. Change the following in packstack's answer file:

      CONFIG_QUANTUM_L3_EXT_BRIDGE=provider
      # Special value "provider" disables use of external bridge

#### Other - get familiar with, no changes required

Keep the following parameters with their default values:

      CONFIG_QUANTUM_INSTALL=y
      CONFIG_QUANTUM_USE_NAMESPACES=y
      # namespaces allow you to create 2 subnets with the same IPs without any collisions.
      CONFIG_QUANTUM_L2_PLUGIN=openvswitch

### Post-Install Configuration

Basic Neutron post-install configuration includes:

*   creation of tenants' private networks and subnets
*   creation of the external network and subnet
*   creation and configuration of routers<commit_msg>Workaround for Unsupported NIC Driver<commit_after>---
title: Neutron with OVS and VLANs
category: networking
authors: adarazs, dneary, jlewis, rbowen, rkukura, rvaknin
wiki_category: Networking
wiki_title: Neutron with OVS and VLANs
wiki_revision_count: 27
wiki_last_updated: 2013-12-18
---

__NOTOC__

# Neutron Installation with OVS and VLANs (Grizzly)

### Preface

#### Components

Neutron consists of the following components:

**`Neutron` `service`**` - the API service.`
**`Neutron` `metadata` `agent`**` - proxies metadata requests from instances even in isolated networks to nova-api.`
**`L2` `agent`**` - agent which talks with the layer 2 plugin like OVS (Open vSwitch) or LB (Linux bridge) etc.`
**`L3` `agent`**` - layer 3 agent which mainly responsible for the routing and NAT (used for floating IP <--> private IP convertions).`
**`DHCP` `agent`**` - responsible to provide a private IP address to an instance that looks for his address.`

#### Some Notes

All components can be installed in one machine or distributed to different machines (and all the in-between variants).

L2 agent should run on all machines except for the Neutron service machine (unless Neutron service resides with other component in the same machine).

It's possible to install multiple L3/DHCP/metadata agents.

### Installation (packstack)

#### Installation Machines

The following packstack configuration define where each component is installed:

      CONFIG_QUANTUM_SERVER_HOST=ip
      CONFIG_QUANTUM_L3_HOSTS=ip_or_comma_separated_ips
      CONFIG_QUANTUM_DHCP_HOSTS=ip_or_comma_separated_ips
      CONFIG_QUANTUM_METADATA_HOSTS=ip_or_comma_separated_ips

Can hostnames be used instead of IPs?

#### Layer 2 Configuration

The following packstack configuration defines L2 tenant network allocation as VLANs:

      CONFIG_QUANTUM_OVS_TENANT_NETWORK_TYPE=vlan
      CONFIG_QUANTUM_OVS_VLAN_RANGES=inter-vlan:1200:1205
      # inter-vlan - the name of the physical_network used for the VLANs
      # 1200:1205 - the range of VLANs available for tenant network allocation
       
      CONFIG_QUANTUM_OVS_BRIDGE_MAPPINGS=inter-vlan:br-instances
      # mapping from the physical_network name to the bridge name
      # inter-vlan - the name of the physical_network used for the VLANs
      # br-instances - the bridge name
      CONFIG_QUANTUM_OVS_BRIDGE_IFACES=br-instances:eth0
      # mapping from the bridge name to the physical interface name
      # br-instances - the bridge name
      # eth0 - the interface name

For a VLAN configuration you will need:

*   a network interface (i.e. "eth0") on each compute and network node connected to a switch that is configured to trunk a set of VLANs (i.e. 1200-1205)
*   a name (i.e."'inter-vlan") for the physical_network (the switch or set of switches) to which these interfaces are connected
*   a name (i.e. "br-instances") for the OVS bridge that will be connected to these interfaces on each node

Note: You can specify non-continuous ranges of VLANs in this form:

      CONFIG_QUANTUM_OVS_VLAN_RANGES=inter-vlan:182:182,inter-vlan:206:207

This specifies that the VLANs 182 and 206-207 on physical_network "inter-vlan" are available for allocation as tenant networks.

It is also possible to configure multiple physical_networks, each with separate ranges of VLANs available for tenant networks on each, by mapping them to separate OVS bridges and interfaces, but details are not covered here.

#### Workaround for Unsupported NIC Driver

Working with unsupported NIC drivers (like "be2net") might lead to hangs in TCP connections when VLANs are used with OVS. In order to workaround this issue, you can enable "VLAN Splinters" for the interface:

Run the following command on all L2 agent machines after packstack installation:

      ovs-vsctl set interface eth0 other-config:enable-vlan-splinters=true

More info can be found in: <https://www.redhat.com/archives/rhos-list/2013-June/msg00066.html>

#### External Network Access Method

By default, the L3 agent uses a separate bridge ("br-ex") to access the external network, which works fine for simple cases where the external network is on a separate interface from the tenant networks and is not VLAN tagged. In this example, we instead use a provider network on the same bridge and interface as the tenant networks for the external network. Change the following in packstack's answer file:

      CONFIG_QUANTUM_L3_EXT_BRIDGE=provider
      # Special value "provider" disables use of external bridge

#### Other - get familiar with, no changes required

Keep the following parameters with their default values:

      CONFIG_QUANTUM_INSTALL=y
      CONFIG_QUANTUM_USE_NAMESPACES=y
      # namespaces allow you to create 2 subnets with the same IPs without any collisions.
      CONFIG_QUANTUM_L2_PLUGIN=openvswitch

### Post-Install Configuration

Basic Neutron post-install configuration includes:

*   creation of tenants' private networks and subnets
*   creation of the external network and subnet
*   creation and configuration of routers
{'fraction_non_alphanumeric': 0.059879052245464456, 'fraction_numerical': 0.016456825617130962, 'mean_word_length': 4.3802666666666665, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7386599', 'n_tokens_mistral': 3397, 'n_tokens_neox': 3186, 'n_words': 1225}