NixOS-Configs/hosts/common/networking.nix

34 lines
698 B
Nix

{ config, lib, pkgs, ... }: {
# Common networking configuration
networking = {
networkmanager.enable = true;
enableIPv6 = true;
useDHCP = false;
dhcpcd.enable = false;
firewall = {
enable = true;
trustedInterfaces = ["tailscale0" "wt0"];
checkReversePath = "loose";
allowedUDPPorts = [config.services.tailscale.port];
allowedTCPPortRanges = [
{
from = 1714;
to = 1764;
}
];
allowedUDPPortRanges = [
{
from = 1714;
to = 1764;
}
];
allowedTCPPorts = [22 80 443 8384];
};
nameservers = [
"1.1.1.1"
"8.8.8.8"
];
};
# DNS
}