# NetworkManager vs. systemd-networkd -- neither works fully

## mounty1

Hello, on one machine of my several Gentoo installations, networking works imperfectly.

The machine is an Intel NUC and I am only using the wired interface (eno1).  Until recently I was using the systemd-networkd service with the following:

```
[Match]

name=eno*

[Network]

DHCP=ipv4
```

The DHCP server is configured to serve 192.168.1.60 to the NUC's MAC address.  The NUC obtains the address but there are two problems:The systemd-networkd-wait-online service waits for about two minutes then times out and fails to start.  I don't know for what it is waiting, since the address has been served.  ifconfig -a lists an unconfigured sit0 interface but I don't know what this is or whether systemd-networkd-wait-online is waiting for it to be initialised.More significantly, after about four days, interface eno1 loses its address.  I assume from the delay period that it fails to renegotiate the lease.  Anyway, the only solution is the magic-key reboot sequence (alt-sysreq-REISUB) since there are multiple NFS mounts which systemd wants to unmount.

In an attempt to solve the above, I switched from systemd-networkd to NetworkManager, which is of course an overkill for a single-interface machine:

```
systemctl disable systemd-networkd-wait-online systemd-networkd

systemctl enable NetworkManager NetworkManager-wait-online
```

but this brings it own problems.  Although the machine boots really quickly, the network mounts (NFS mounts in /etc/fstab) are not honoured, and it is necessary to run mount -a to get them.

So neither solution is satisfactory.  AIUI, systemd-networkd is all that should be needed for a single interface, but with the two problems listed above, it is unuseable.  Can anyone suggest a resolution?

----------

## mike155

Why do you use DHCP for this machine? I would configure a static IP address in /etc/systemd/network/wired.network. I use DHCPv4 only for notebooks or smartphones that are connected temporarily to my network. Every device that is connected permanently or that even mounts or exports file systems is configured with a static IP address.

If you want to stay with DHCPv4 for this machine, I would lower the DHCP lease time for this machine to a couple of minutes and start testing. Increase verbosity of DHCP log files and/or use tcpdump and look at the DHCP packets that are sent between your machine and your DHCP server. There surely is a reason why DHCP renewal doesn't work.

----------

## littletux

Adding _netdev to the mount options in /etc/fstab might be sufficient.

----------

