Networking.interfaces.<name>.ipv4.routes not working?

I am trying to route traffic through a specific gateway. On the commandline I can add the specific route using this ip command:

ip r add via

I am trying to replicate this using my system config:

networking.interfaces.ens18.ipv4.routes = [{
  address = "";
  prefixLength = "24";
  via = "";

but that does not seem to do anything at all.
Am I misunderstanding what this option does?

i have same problem

i was fix use ifconfig up after this route added and after reboot its works too

you can try this magic :slight_smile:

sudo ifconfig ens18 up