config-perso/machines/kat-r86s/router.nix

29 lines
802 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; }];
};
networking.interfaces.enp3s0 = {
useDHCP = false;
ipv4.addresses = [{ address = "192.168.222.1"; prefixLength = 24; }];
ipv6.addresses = [{ address = "fd26:baf9:d250:8000::ffff"; prefixLength = 64; }];
};
services.dnsmasq = {
enable = true;
settings = {
interface = [ "enp3s0" ];
bind-dynamic = true;
dhcp-option = "3,0.0.0.0";
dhcp-range = "192.168.222.100,192.168.222.254,255.255.255.0,infinite";
};
};
}