On 5/7/24 10:30, Felix Miata wrote:
I think there are more than one. One thing is to check what is enabled, then
disable or uninstall whatever owns the unit(s):

        systemctl list-unit-files | egrep 'net|dhcp'

Do the same with whatever "manages" /etc/resolv.conf, and create a regular file 
of
your own design.

I don't use VMs, but I did several hours ago instruct several hours ago using
systemd-network to setup static IP service for a *buntu user who couldn't get
netplan sorted:

There seems to be some misunderstanding here.

dhcpd services for a vm are provided by the host running the vm. Depending on the vm software e.g. KVM/QEMU or VMWare Workstation there will be different mechanisms to configure or disable this service to the vm client.

However it is not necessary if you configure the vm client using the systemd networking client service - as the OP has done.

More relevant is explicitly disabling any competing network clients on the vm that may affect things like DNS.

I recommend :

sudo systemctl disable NetworkManager.service
sudo systemctl stop NetworkManager.service
sudo systemctl mask NetworkManager.service

sudo systemctl disable systemd-networkd
sudo systemctl stop systemd-networkd
sudo systemctl mask systemd-networkd

I reiterate that if DNS resolution is needed it needs to be set in /etc/hosts and/or in /etc/resolv.conf

(I also use systemd-networkd in preference to the other two types of client networking)

Reply via email to