0

At the moment I have been playing around with some VMs and networking recently (just for the learning experiance), at the moment I have an interface on the host called "veth0" connected to the VM, here is the relevent part of the VMs config:

<interface type='ethernet'>                     
  <mac address='52:54:00:cb:80:51'/>
  <target dev='veth0'/>                            
  <model type='e1000e'/>                                                           
  <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
</interface>

The VM is setup to be a DHCP server, so it can give the host an IP over this interface. This works fine if I run "dhcpcd vath0". The interface gets an ip and the host and guest can communicate fine.

However, when I get NetworkManager to manage this interface, it doesn't work. When I try to activate the interface it just fails, with this error:

Error: Failed to add/activate new connection: cannot get interface name due to failed to determine interface name: error determine name for tun

"sudo nmcli connection show" also shows that NetworkManager for some strange reason misidentifies the interface as a tun interface, when it's really a veth interface. I have a feeling that that might be the reason I am getting the error above, so would anybody know of a way to manually set an interfaces type in NetworkManager (or some other possible solution to my issue)? Strangely, if I run dhcpcd on the interface and leave it running while I get netwrkmanager to activate the interface, then kill dhcpcd, NetworkManager continues to manage the interface just fine on it's own until I decide to deactivate the interface (where if I try to reactivate it again the above error shows back up)

2
  • libvirt.org/formatdomain.html#generic-ethernet-connection : type ethernet means it will be a tun/tap device if the hypervisor is QEMU/KVM (rather than LXC), even if you choose a misleading name for it. – A.B Oct 26 '20 at 13:54
  • @A.B Oh wow, thanks for informing me about that. I setup this VM about a week ago and I had read somewhere that this is how you create veth devices for VMs, they must have been talking about containers instead. Any idea on how to get a veth device connected to the VM? Or I suppose how I would get NetworkManager to treat the tun device as I want it to? – Sol33t303 Oct 27 '20 at 0:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.