config-perso/machines/kat-r86s/router.nix
2024-03-26 16:06:08 +01:00

23 lines
568 B
Nix

{config, lib, pkgs, ...}: {
boot.kernel.sysctl."net.ipv4.ip_forward" = true;
networking.nat = {
enable = true;
internalInterfaces = [ "enp2s0" ];
externalInterface = "enp1s0";
};
networking.interfaces.enp2s0 = {
useDHCP = false;
ipv4.addresses = [{ address = "192.168.42.1"; prefixLength = 24; }];
};
services.dnsmasq = {
enable = true;
settings = {
interface = [ "enp2s0" ];
bind-dynamic = true;
dhcp-option = "3,0.0.0.0";
dhcp-range = "192.168.42.100,192.168.42.254,255.255.255.0,12h";
};
};
}