2024-11-28 15:44:53 +01:00
|
|
|
{ lib, ... }: {
|
|
|
|
boot.kernel.sysctl."net.ipv4.ip_forward" = lib.mkForce true;
|
2024-04-15 09:17:59 +02:00
|
|
|
|
|
|
|
systemd.network = {
|
|
|
|
enable = true;
|
|
|
|
networks = {
|
2024-09-11 18:14:39 +02:00
|
|
|
# "uplink" = {
|
|
|
|
# name = "wlp0s20f3";
|
|
|
|
# DHCP = "ipv4";
|
|
|
|
# networkConfig.IPMasquerade = "ipv4";
|
|
|
|
# };
|
2024-04-15 09:17:59 +02:00
|
|
|
"10-enp2s0" = {
|
|
|
|
name = "enp2s0";
|
|
|
|
address = [ "192.168.2.1/24" ];
|
|
|
|
networkConfig.DHCPServer = "yes";
|
2024-09-11 18:14:39 +02:00
|
|
|
dhcpServerConfig = {
|
|
|
|
PoolOffset = 100;
|
|
|
|
PoolSize = 100;
|
|
|
|
};
|
2024-04-15 09:17:59 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-09-11 18:14:39 +02:00
|
|
|
networking = {
|
|
|
|
nftables = {
|
|
|
|
enable = true;
|
|
|
|
tables.nat = {
|
|
|
|
family = "ip";
|
|
|
|
content = ''
|
|
|
|
chain postrouting {
|
|
|
|
type nat hook postrouting priority 100;
|
|
|
|
ip saddr 192.168.2.0/24 masquerade
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
firewall.allowedUDPPorts = [ 67 ];
|
2024-04-15 09:17:59 +02:00
|
|
|
};
|
|
|
|
}
|