Introduction:
OLVM (Oracle Linux Virtualization Manager) is a server virtualization management platform based on oVirt. It allows administrators to manage virtual machines, storage, and networking. VLAN tagging is a networking technique used to segregate network traffic using 802.1Q tags.
Understanding VLAN Tagging in OLVM
When integrating VLANs in OLVM, the goal is to allow different virtual machines (VMs) or networks to coexist on the same physical interface, logically separated using VLAN IDs.
Key Concepts
-
Tagged VLAN: The network traffic carries a VLAN ID (802.1Q tag). Useful when a single physical NIC handles traffic for multiple VLANs.
-
Untagged VLAN: Default VLAN on a port that doesn’t tag outgoing traffic.
-
Logical Networks: In OLVM, a logical network is associated with a VLAN and mapped to a physical NIC or a bridge.
Steps to Configure VLAN Tagging in OLVM
1. Create Logical Networks
Go to the OLVM Admin Portal:
-
Navigate to Networks > Networks tab.
-
Click New to create a new logical network.
-
Specify:
-
Name (e.g.,
VLAN100
) -
Check VLAN tag and enter the VLAN ID (e.g.,
100
) -
Optionally, assign it to a data center or cluster
-
2. Attach the Logical Network to a Host NIC
-
Go to Compute > Hosts.
-
Select a host, click Network Interfaces.
-
Click Setup Host Networks.
-
Drag the VLAN-tagged logical network (e.g.,
VLAN100
) to the desired NIC. -
OLVM will automatically create a VLAN sub-interface (e.g.,
eth0.100
).
3. Configure Bridges (Optional)
If you're using bridged networking:
-
A bridge (e.g.,
ovirtmgmt
) can be created on the VLAN sub-interface (eth0.100
) so VMs can connect to that VLAN.
4. Assign VLAN Networks to VMs
-
When creating or editing a VM, attach a vNIC profile associated with the VLAN-tagged logical network.
-
This allows the VM to send/receive traffic on that VLAN.
Key Considerations for VLAN Tagging in KVM
-
Host NIC Configuration
-
The physical NIC must be connected to a trunk port on the physical switch, allowing it to carry traffic for multiple VLANs.
-
Ensure the switch is correctly configured to support 802.1Q VLAN tagging.
-
-
Bridge and VLAN Interface Setup
-
Use VLAN sub-interfaces (e.g.,
eth0.100
for VLAN 100) or configure VLANs directly on Linux bridges using tools likenmcli
orip
. -
Create separate bridges per VLAN if needed (e.g.,
br100
for VLAN 100), and attach VMs to the appropriate bridge.
-
-
Libvirt Network Configuration
-
If using libvirt, define virtual networks with the appropriate bridge/VLAN interface.
-
Use
<vlan>
elements in the XML to explicitly tag traffic.
-
-
Security
-
VLAN tagging provides logical separation, but it is not a substitute for full isolation—combine with firewalls, SELinux, or AppArmor.
-
Prevent VLAN hopping attacks by disallowing native VLANs or misconfigured trunk ports.
-
-
Performance Impact
-
While VLAN tagging itself has minimal overhead, incorrect configuration (e.g., misaligned MTUs or improperly bridged interfaces) can degrade performance.
-
Monitor throughput and latency after setup.
-
-
VM NIC Support
-
Ensure the VM’s virtual NIC model (e.g., virtio) and guest OS support VLANs if VMs need to perform internal VLAN tagging (e.g., in a nested setup).
-
-
Consistency Across Hosts
-
For cluster environments (e.g., OLVM), ensure all hosts have consistent VLAN bridge and interface configurations to avoid migration or deployment issues.
-
-
Naming and Documentation
-
Use clear naming conventions for VLAN interfaces and bridges (e.g.,
vlan200-br
) to simplify maintenance and troubleshooting.
-
-
Automation and Management Tools
-
Use automation tools (Ansible, scripts) or management platforms (OLVM, oVirt, Cockpit) to standardize VLAN setup and reduce human error.
-
-
Use bonding for high availability if you’re using VLANs on production servers.
-
Ensure switch ports are set to trunk mode to pass VLAN-tagged traffic.
-
Avoid IP conflicts between VLANs.
Comments