Weird routing that I didn't configure messes LAN networking up

Hi!

Ever since I’ve configured a static IP on my homelab, the routing table is messed up. I can ping google, or the gateway, but there is no route to other PCs on my LAN. Neither from the homelab, nor from other PCs. My routing table when nothing works is this (192.168.178.2 is the local IP of my homelab):

prunebutt@homelab:~/ > ip route show
default via 192.168.178.1 dev eno2 proto static
192.168.100.11 dev ve-someContainer scope link
192.168.100.12 dev ve-someOtherContainer scope link
192.168.178.0/24 dev eno1 proto kernel scope link src 192.168.178.2 linkdown
192.168.178.1 dev eno2 proto static scope link

And it works after I do ip route del 192.168.178.0/24. But I have to do it every time I reboot.

I could add a systemd-service, but it seems to me that somewhere my configuration adds the faulty route. But after I tried to configure the explicit route seen below, nothing changed:

networking = {
  useDHCP = false;
  interfaces.eno2.ipv4 = {
    routes = [
      {
        address = 192.168.178.0;
        prefixLength = 24;
        via = 192.168.178.1;
        options.scope = "global";
      }
    ];
    addresses = [
      {
        address = "192.168.178.2";
        prefixLength = 24;
      }
    ];
  };
};

What am I missing? Where does the weird route come from?

I’m also having trouble with remotely unlocking my LUKS drive in the initram and I’m suspecting that this is also the reason why that doesn’t work. Although I’ll probably open another if I find the reason behind the faulty routing and it’s still not fixed.

The route is somehow added for eno1, which is the wrong interface and is down.

Did you previously use eno1? Is eno1 in your configuration somewhere?

No, eno1 is completely unused.

Although I have remote boot disk unlocking active and I use autoconf in the kernel parameters to test the device:

boot.kernelParams = [ "ip=${static_ip}::${gateway}:255.255.255.0:${hostName}:" ];

I’m thinking of switching to systemd.network configuration, since that’s recommended. But I haven’t found the time yet.

Ah! I think that might be your problem. You aren’t specifying the device there. Does changing that to

boot.kernelParams = [ "ip=${static_ip}::${gateway}:255.255.255.0:${hostName}:eno2" ];

fix things?

Doing this may also be required

boot.kernelParams = [ "ip=${static_ip}::${gateway}:255.255.255.0:${hostName}:eno2:off" ];

the params are ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>:… so that sets device to eno2 and ensures any auto conf is off.

Bingo! That fixed both issues! Thanks a lot! :smiley: