This commit is contained in:
Spectre 2024-06-07 01:02:48 +02:00
parent 95ea2899ea
commit 9e441e1aaf
11 changed files with 172 additions and 1 deletions

26
system/networking.nix Normal file
View file

@ -0,0 +1,26 @@
{conf, ...}: {
networking.hostName = conf.hostname;
networking.networkmanager = {
enable = true;
wifi.macAddress = "random";
ethernet.macAddress = "random";
};
networking.firewall = {
enable = true;
allowedTCPPorts = [
22 # ssh
22000 # syncthing
];
extraCommands = ''
ip46tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --sport 51820 -j RETURN
ip46tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --dport 51820 -j RETURN
'';
extraStopCommands = ''
ip46tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --sport 51820 -j RETURN || true
ip46tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --dport 51820 -j RETURN || true
'';
};
}