I’m creating a “solved” help issue just in case anyone runs into the same issue. Hope that’s okay for this forum!
I upgraded from NixOS 24.05 to 26.05 and after upgrading, I was no longer able to SSH to the machine.
step 1: get back into the machine
I wasn’t able to SSH into the machine anymore, and I hadn’t set a root password, so I needed to get back in somehow. I was using Hetzner which has a “rescue” console, so I was able to use the rescue console to get back in like this:
# mount the hard drive
mkdir /mnt/nix
mount /dev/sda1 /mnt/nix
# generate a new password
openssl passwd -6 "some password"
# manually edit /etc/shadow to put the password hash into /etc/shadow
vim /etc/shadow
After that, I was able to log in to the console using the Hetzner web UI, with the root password I’d set
step 2: diagnose the issue
The SSH server was running, but ip route show showed that there was no default route set.
After I set a default route with ip route add default via 172.31.1.1 , I was able to SSH to the machine again. I got the default gateway IP address from my networking.nix config file.
step 3: why is the default gateway missing?
When I ran systemctl status network-addresses-eth0.service , I saw this error message:
adding address fe80::9400:2ff:fed0:8c08/64... 'ip addr add fe80::9400:2ff:fed0:8c08/64 dev
Then:
network-addresses-eth0.service: Main process exited, code=exited, status=1/FAILURE
network-addresses-eth0.service: Failed with result 'exit-code'.
Failed to start Address configuration of eth0.
step 4: the fix
The solution was to remove the IP address from the error message from my networking.nix. I’m not sure exactly why I had that IP address there in the first place or why it needed to be removed (I don’t understand much about IPv6), but removing that IP did make the network come back up again.
ipv6.addresses = [
{ address="2a01:redacted::1"; prefixLength=64; }
-{ address=“fe80::9400:2ff:fed0:8c08”; prefixLength=64; }];