I'm using the latest Raspbian. The network management has changed a lot and perhaps I'm not aware of all the new caveats.
On startup it hangs waiting for the job of dhcpcd. I found several threads where people suggest to disable the dhcpcd5.service. Well this avoids the timeout, but also prevents the interface to be enabled!
First question: why does it take so much time to get an ip? It's not my router. Any other device in my LAN gets the address in a while.
Then I tried a static address. As far as I understand this is not achieved anymore editing the /etc/network/interfaces
file, but instead the /etc/dhcpcd.conf
one:
interface enxb827eb33e91e
static ip_address=192.168.178.200/24
static routers=192.168.178.1
static domain_name_servers=192.168.178.1 8.8.8.8
Second question: even with the static address enabled (it works, by the way) the startup timeout is still there! Why?
Third question: Debian now use the new interface name scheme. I will use this image for different types of Raspberry Pi: B+, 2 and 3. Does the old eth0
is translated to the same address (as above) for all types?
If not, how one should write scripts or configuration files without knowing the actual interface name? It doesn't seem portable to me.
systemd-analyze
on my system shows Startup finished in 1.680s (kernel) + 8.032s (userspace) = 9.713s https://www.tecmint.com/manage-services-using-systemd-and-systemctl-in-linux/ shows various methods of analysis – Milliways Aug 22 '17 at 10:52Startup finished in 11.483s (kernel) + 1min 31.190s (userspace) = 1min 42.674s
. Theblame
parameter reveals that (after some tweaking)17.441s dhcpcd.service
– Mark Aug 22 '17 at 12:18