Cannot configure VLAN on SR-IOV VF interfaces inside the Virtual Machine

Solution Verified - Updated

Environment

  • Red Hat Virtualization 4.2
  • Red Hat Enterprise Linux 7 (Host)
    • kernel-3.10.0-957.1.3.el7.x86_64
    • ixgbe SR-IOV
  • Red Hat Enterprise Linux 7 (Guest)
    • kernel-3.10.0-693.el7.x86_64

Issue

  • Permission Denied error when bringing up VLAN interfaces inside the Virtual Machine
  • How to configure an ixgbe SR-IOV NIC with several VLANs in a Virtual Machine?

Resolution

In RHV, create a Logical Network with VLAN Tagging and set the tag to 0, use this Network for the SR-IOV vNIC Profile for the vNICs attached to the VMs.

Note that if this network is attached to the hosts, it may create an interface with VLAN 0.

Diagnostic Steps

In the guest:

network[743]: Bringing up interface eth0:  [  OK  ]
kernel: 8021q: 802.1Q VLAN Support v1.8
kernel: 8021q: adding VLAN 0 to HW filter on device eth0
network[743]: Bringing up interface eth0.107:  RTNETLINK answers: Permission denied
ifup[1021]: ERROR: could not add vlan 107 as eth0.107 on dev eth0

Meanwhile in the hypervisor:

kernel: ixgbe 0000:01:00.1 eno2: VF 2 attempted to override administratively set VLAN configuration
              Reload the VF driver to resume operations
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.