2024-03-15 10:46:02 +01:00
|
|
|
{config, lib, pkgs, ...}: {
|
2024-03-26 16:06:08 +01:00
|
|
|
boot.kernel.sysctl."net.ipv4.ip_forward" = true;
|
2024-03-15 10:46:02 +01:00
|
|
|
|
2024-03-26 16:06:08 +01:00
|
|
|
networking.nat = {
|
|
|
|
enable = true;
|
|
|
|
internalInterfaces = [ "enp2s0" ];
|
|
|
|
externalInterface = "enp1s0";
|
|
|
|
};
|
|
|
|
networking.interfaces.enp2s0 = {
|
|
|
|
useDHCP = false;
|
|
|
|
ipv4.addresses = [{ address = "192.168.42.1"; prefixLength = 24; }];
|
2024-03-15 10:46:02 +01:00
|
|
|
};
|
2024-03-26 16:06:08 +01:00
|
|
|
|
2024-03-15 10:46:02 +01:00
|
|
|
services.dnsmasq = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
2024-03-26 16:06:08 +01:00
|
|
|
interface = [ "enp2s0" ];
|
2024-03-15 10:46:02 +01:00
|
|
|
bind-dynamic = true;
|
|
|
|
dhcp-option = "3,0.0.0.0";
|
2024-03-26 16:06:08 +01:00
|
|
|
dhcp-range = "192.168.42.100,192.168.42.254,255.255.255.0,12h";
|
2024-03-15 10:46:02 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|