How to set promisc mode of a NIC in configuration.nix?


#1

I searched available options in nixos options, however, no related option.

Of course I can enable promisc mode in cmd line after booting
ifconfig eth0 promisc

But how can I make it presistent?

Thanks.


#2

not sure there should be nixos options for such specific settings. You could try to write some nix in boot.postBootCommands


#3

You might want to do this via udev and a systemd device unit to avoid potential race conditions if your network interface is initialized after the command is run.