virter icon indicating copy to clipboard operation
virter copied to clipboard

using macvtap interface

Open vphan13 opened this issue 1 year ago • 0 comments

I'm attempting to use macvlans with virter. I've successfully added a macvlan bridge interface on my virter host using:

nmcli connection add type macvlan dev enp4s0 mode bridge tap yes ifname **_vmbridge0_**
nmcli connection modify macvlan-vmbridge0 ipv6.method "disabled"
nmcli connection modify macvlan-vmbridge0 ipv4.method "disabled"

I run

virter vm --memory 4GiB --vcpus 2 run rocky-9 --name node1 --id 133 --wait-ssh

In virtual-machine-manager I can edit the node1 vm by:

  1. adding a new virtual network interface, with a network source of Macvtap device
  2. Device name vmbridge0

Rebooting the VM it now comes up with a dhcp address on my local lan on the second newly added interface.
I would like to be able to associate my vmbridge0 device with a new virter network so that the above can all be done from the virter cli

virter network add internal -m bridge

This command works to add another network, but there is no interface associated with it under the Bridge column

virter network ls
DEBU[0000] Using config file: /home/user1/.config/virter/virter.toml
Name                      Forward-Type  IP-Range          Domain  DHCP                           Bridge  
internal                  bridge                                                                         
default (virter default)  nat           192.168.122.1/24          192.168.122.2-192.168.122.254  virbr0 

However, attempting to start a new VM with the internal network results in an error

virter vm run rocky-9 --id 131 --nic type=network,source=internal
Failed to start VM 131: could not create (start) domain: internal error: network 'internal' uses a direct mode, but has no forward dev and no interface pool

Looks like the internal network is not associated with a bridge device.

I don't see any obvious options in virter network add to associate a bridge device name with a newly created network.

vphan13 avatar Oct 31 '24 06:10 vphan13