Connect instances to multiple VLANs

Associate instances with VLANs by using trunks or VLAN transparent networks.

A trunk is a collection of ports that enables you to route network traffic to multiple VLANs by using tags. Compared to access ports which can only send and receive network traffic on one VLAN, trunks typically offer lower latency and higher bandwidth. In RHOSO environments, a trunk consists of a parent port with one or more subports associated with the parent.

VLAN trunks support VLAN-aware instances by combining VLANs into a single trunked port. For example, a project data network can use VLANs or tunneling segmentation (GENEVE), while the instances see the traffic tagged with VLAN IDs. Network packets are tagged immediately before they are injected to the instance and do not need to be tagged throughout the entire network.

With a VLAN transparent network, you set up VLAN tagging in the VM instances. The VLAN tags are transferred over the network and consumed by the instances on the same VLAN, and ignored by other instances and devices. In a VLAN transparent network, the VLANs are managed in the instance. You do not need to set up the VLAN in the OpenStack Networking Service (neutron).

The following table compares certain features of VLAN trunks and VLAN transparent networks:

Trunk Transparent

Mechanism driver support

ML2/OVN

ML2/OVN

VLAN setup managed by

OpenStack Networking Service (neutron)

VM instance

IP assignment

Assigned by DHCP.

Configured in the instance.

VLAN ID

Fixed. Instances must use the VLAN ID configured in the trunk.

Flexible. You can set the VLAN ID in the instance.

Implementing a trunk for VLAN-tagged traffic consists of the following steps:

  1. Create a parent port, and use it to create a trunk.
  2. Create one or more subports and associate them with the parent port.
  3. Create a sub-interface that tags traffic for the VLAN associated with the subport.
  4. When you create an instance, specify the parent port ID as the vNIC for the instance.