Using KVM with macvtap and VLANs for VM

kvm-virtualizationlinux-networkingvirtual-machinesvlan

I want to use the optimizations given for the ASAv (Page 18) which should run with KVM.
I am using Ubuntu 14.04 LTS and I should configure macvtap for an higher performance.

It just says the following in the guide by Cisco:

macvtap—High performance Linux bridge; you can use macvtap instead of a Linux bridge. Note that you must configure specific settings to use macvtap instead of the Linux bridge.

I found some tutorial and I set up the two macvtap bridges for my 2 VLANs 1654 and 1664:

sudo ip link add link eth0.1654 name macvtap1654 type macvtap mode bridge

sudo ip link add link eth1.1664 name macvtap1664 type macvtap mode bridge

Unfortunately I cannot choose them when configuring the network devices with virt-manager.
Obviously, the specific settings are not set.
I don't know what else to configure thus I can use this optimization for my virtual machine.

Thanks for reading and Helping.

Best Answer

...better late to the party than to never show up at all

The changes are separate from Macvtaps and Macvlans.

We need to create the vlan interface prior to creating the macvtap for the KVM bridge.

https://manpages.debian.org/buster/vlan/vlan-interfaces.5.en.html

So I'm actually creating the vlan interface in my /etc/network/interfaces config

allow-hotplug enp1s0f0
auto enp1s0f0
iface enp1s0f0 inet static
    address 10.8.0.50
    netmask 255.255.240.0
    gateway 10.8.0.1
    dns-nameservers 10.10.10.10 10.80.0.5

Now here, I add the Vlan interface(s), you can keep stacking as many trunked vlans that you have tagged here. (Note the incoming NIC to this server has multiple tagged vlans coming from the switch it's connected to) ...

auto enp1s0f0.4
iface enp1s0f0.4 inet static 
  address 10.80.0.2
  netmask 255.255.255.0
  gateway 10.80.0.1

auto enp1s0f0.10
iface enp1s0f0.4 inet static 
  address 10.10.0.2
  netmask 255.255.255.0
  gateway 10.10.0.1

Restart your networking

NOW add the macvtap to the enp1s0f0.4 interface

ip link add link enp1s0f0.4 name macbaby address 52:54:00:b8:cc:bb type macvtap mode bridge

You'll now be able to see that macbaby macvtap in virt-manager, and if you set it as the nic on your guest, your VM should come up on 10.80.0.0/24 dchp.

Related Topic