The officially official Devuan Forum!

You are not logged in.

#1 2024-10-08 23:34:34

VPigEePMUn7X
Member
Registered: 2024-10-08
Posts: 5  

[SOLVED] libvirt: issue with default route changing to vnet after starting VM

I am experiencing connectivity issues on my Devuan host machine when starting a VM using virt-manager.
The VM is configured to use default virbr0 NAT network. It is getting usual 192.168.122.x IP from DHCP.

Upon starting the VM, a new network interface (vnet1) is created in the host. The routing table changes on Devuan host, becoming the default route:
$ ip route
0.0.0.0 dev vnet2 scope link
default dev vnet2 scope link
default via 192.168.1.1 dev eth0
(...)

This change leads to loss of internet connectivity on the host, and it prevents internet from ever working in the guest as well, as it tries to route traffic through the vnet interface, which does not have a valid internet connection. In the example above, we can see vnet2 because I tried adding another NIC to the VM, every time result is the same, guest NIC is activated, vnet is spawned, changing default route for entire host.

I don't know why this happens, I did not experience it on Debian host from which I just migrated.

When all VMs are closed, or their NICs are removed, internet works normally in Devuan host:

$ ip route
default via 192.168.1.1 dev eth0
(...)

Expected behaviour is of course virbr0 NAT network working normally without affecting the host's internet access.
Any insights appreciated!

Last edited by VPigEePMUn7X (2024-10-08 23:36:19)

Offline

#2 2024-10-09 00:23:39

VPigEePMUn7X
Member
Registered: 2024-10-08
Posts: 5  

Re: [SOLVED] libvirt: issue with default route changing to vnet after starting VM

Ok I figured it out.... it's ConnMan. It seems to be incompatible with libvirt. ConnMan is installed by default in Devuan. When I uninstalled ConnMan and installed NetworkManager, the problem went away. Then I uninstalled NetworkManager too and left the built-in, basic ifupdown and /etc/network/interfaces file. It still works. Something in ConnMan causes libvirt to go haywire and spawn all these vnet networks. It's not happening when ifupdown or NetworkManager manages it. That's how it looks like when the host has got internet working and virbr0 NAT for VMs is working too:

$ ip route
default via 192.168.1.1 dev eth0 
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.182 
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1

Offline

#3 2024-10-09 11:31:41

Altoid
Member
Registered: 2017-05-07
Posts: 1,585  

Re: [SOLVED] libvirt: issue with default route changing to vnet after starting VM

Hello:

VPigEePMUn7X wrote:

... uninstalled ConnMan and installed NetworkManager, the problem went away.

I had quite a few issues with connman and although they were (apparently) solved, I was not able to understand how I got it done.

Nor was I able to find out just wtf connman does, when it does it and most importantly, why it does it.

For the moment I am at peace with it but am looking to purge my system of it once I either get the old/reliable WiCD installed or just go the way you have, with basic ifupdown and /etc/network/interfaces file.

Seeing that you are already there, here's a useful page you may want to have a look at.

Best,

A.

Offline

#4 2024-10-09 18:06:31

VPigEePMUn7X
Member
Registered: 2024-10-08
Posts: 5  

Re: [SOLVED] libvirt: issue with default route changing to vnet after starting VM

Thanks for sharing useful ifupdown page. I've saved it, it may be useful in the future. Right now, this static homeserver which I am configuring, remains connected by one Ethernet cable 24/7/365, there is nothing to configure smile I hope it will stay that way.

Offline

Board footer