37 lines
750 B
Nix
37 lines
750 B
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
{
|
|
boot.kernel.sysctl."net.ipv4.ip_forward" = true;
|
|
|
|
systemd.network = {
|
|
enable = true;
|
|
networks = {
|
|
"uplink" = {
|
|
name = "wlp0s20f3";
|
|
DHCP = "ipv4";
|
|
networkConfig.IPMasquerade = "ipv4";
|
|
};
|
|
"10-enp2s0" = {
|
|
name = "enp2s0";
|
|
address = [ "192.168.2.1/24" ];
|
|
networkConfig.DHCPServer = "yes";
|
|
# dhcpServerConfig = {
|
|
# PoolOffset = 100;
|
|
# PoolSize = 100;
|
|
# BootServerAddress = "192.168.222.1";
|
|
# };
|
|
};
|
|
};
|
|
};
|
|
|
|
networking.nat = {
|
|
enable = true;
|
|
internalInterfaces = [ "enp2s0" ];
|
|
externalInterface = "wlp0s20f3";
|
|
};
|
|
networking.firewall.allowedUDPPorts = [ 67 ];
|
|
}
|