I have destroyed my network by remote deploy via colmena, how do I get it up running again?

I decided to switch my network configuration to systemd-networkd from previous networking.interfaces.

Basically I changed this:

networking.interfaces.ens3.useDHCP = true;

to

systemd.network.networks."10-wan" = {
    matchConfig = "ens3";
    networkConfig = {
      DHCP = "yes";
    };
  };

Then I told colmena to deploy and apply the config to my remote server.

Well it turns out, this causes colmena to stop the network-setup.service and then it fails to launch anything again because the network is down.

I have a web interface onto the server’s console, and I tried to do networkctl reload but that just tells me that systemd-networkd is not running.

Apparently I cannot do nixos-rebuild --rollback switch because this tries to roll back to the ancient config I had before using colmena remote deploy.

What do I need to do to get the network back up running?

Okay I fixed it. Problem was that I forgot to set systemd.network.enable = true.

For anyone else being as intelligent as I was here’s what to do:

Your network will not have a working IP address, so you need to log in through the server’s console and configure it. If this is a server at some provider, look up the IP and gateway assigned to you and do

$ ip addr add 1.2.3.4/22 dev ens3
$ ip route add default via 1.2.3.0 dev ens3

(Use your assign IP address in place of 1.2.3.4/22, your network interface name in place of ens3, and the gateway in place of 1.2.3.0).

This should get your network back up and running.

Afterwards you should be able to deploy the fixed configuration with colmena.

deploy-rs has a feature to prevent this in the first place. That one’s push-based, perhaps colmena could grow such a feature too.

Colmena has an issue for it but it didn’t see much activity :frowning: