no route to host error message means the network interface is not up and running yet.
Have you perhaps saved your network configuration as per-user settings? If so, then NetworkManager won't have access to that network configuration until you log in, and so cannot set up the network interface.
If you configure the network interface using a graphical user interface, there is usually a checkbox for "every user can use these settings", or something similar. If you check it, that network configuration will be saved as system-wide configuration, and will be usable whether or not you're logged in, allowing NetworkManager to complete network set-up during boot. But if you don't tick that box, that network configuration will be available for your user account only, requiring you to log in locally first.
This is intended mostly for making certain WiFi or VPN connections private: for example, user
kiddy might only have access to an adult-content-filtered, bedtime-restricted WiFi network at home, but user
daddy might also have access to a different, unrestricted "man-cave" WiFi network plus a work VPN connection. But I think the default setting when making a new network configuration is "per-user", which may come as a surprise when configuring a basic wired network connection.
If you have the settings in the form of a
.nmconnection file, two steps are needed to make that connection usable system-wide without requiring any specific user to login:
- if the connection file has a
permissions= line, delete that line completely.
- move the connection file to
/etc/NetworkManager/system-connections/ directory, if it isn't already there.