Prevent waiting for network devices

Hi.

I’ve a laptop with an ethernet adapter which I only plugin from time to time. I added

networking.interfaces.enp0s20u1u1.useDHCP = true

The problem is that when the adapter is not plugged in the boot process hangs for 90 seconds. I wonder if there’s any possibility to stick with the configuration but prevent that hanging boot.

Thanks
Benjamin

I am not sure if there is an easy way to do exactly what you are asking but on laptops I tend to set useDHCP to false and use Network Manager instead with:

networking.networkmanager.enable = true;

Network Manager handles things like that in a more dynamic way and also eases the process of connecting to wireless networks.

Thanks for mentioning networkmanager. I’ll give it a shot.

1 Like

@asbachb are you still using network manager? I have the same problem (only my adapter is the device enp0s20f0u1 ;- ) I was hoping I could get around network manager for I don’t know what reason, maybe old prejudices.

These are the relevant messages from the boot log:

Jun 22 22:55:15 terra14 systemd[1]: sys-subsystem-net-devices-enp0s20f0u1.device: Job sys-subsystem-net-devices-enp0s20f0u1.device/start timed out.
Jun 22 22:55:15 terra14 systemd[1]: Timed out waiting for device /sys/subsystem/net/devices/enp0s20f0u1.
Jun 22 22:55:15 terra14 systemd[1]: Dependency failed for Address configuration of enp0s20f0u1.
Jun 22 22:55:15 terra14 systemd[1]: network-addresses-enp0s20f0u1.service: Job network-addresses-enp0s20f0u1.service/start failed with result 'dependency'.
Jun 22 22:55:15 terra14 systemd[1]: sys-subsystem-net-devices-enp0s20f0u1.device: Job sys-subsystem-net-devices-enp0s20f0u1.device/start failed with result 'timeout'.

@lucc, maybe try

systemd.network.wait-online.anyInterface = true; # block for no more than one interface

or if using dhcpcd, try

networking.dhcpcd.wait = "background";