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.
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.
@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: sys-subsystem-net-devices-enp0s20f0u1.device: Job sys-subsystem-net-devices-enp0s20f0u1.device/start timed out.
Jun 22 22:55:15 terra14 systemd: Timed out waiting for device /sys/subsystem/net/devices/enp0s20f0u1.
Jun 22 22:55:15 terra14 systemd: Dependency failed for Address configuration of enp0s20f0u1.
Jun 22 22:55:15 terra14 systemd: network-addresses-enp0s20f0u1.service: Job network-addresses-enp0s20f0u1.service/start failed with result 'dependency'.
Jun 22 22:55:15 terra14 systemd: 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
networking.dhcpcd.wait = "background";