blob: f45d4f78a3e1ff4138647eb3c9cd8897f9993ee7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
{ ... }:
let
baseTCP = [
22000 # Syncthng
5352 # Zeroconf for spotifyd
];
baseUDP = [
22000 # Syncthing
22027 # Syncthing
16555 # Wireguard
5353 # Mdns (Spotify)
];
baseTCPRanges = [
{
from = 1714;
to = 1764;
} # KDE-CONNECT
];
baseUDPRanges = [
{
from = 1714;
to = 1764;
} # KDE-CONNECT
];
secureTCP = [
22
80
433
5900 # SSH HTTP VNC
];
secureUDP = [
5900
];
secureTCPRanges = [
];
secureUDPRanges = [
];
in
{
environment.etc.hosts.mode = "0644";
networking.nftables.enable = true;
networking.firewall = {
enable = false;
checkReversePath = false;
allowedTCPPorts = baseTCP;
allowedUDPPorts = baseUDP;
allowedUDPPortRanges = baseUDPRanges;
allowedTCPPortRanges = baseTCPRanges;
interfaces = {
"nix-laptop" = {
allowedTCPPorts = secureTCP;
allowedUDPPorts = secureUDP;
allowedUDPPortRanges = secureUDPRanges;
allowedTCPPortRanges = secureTCPRanges;
};
};
trustedInterfaces = [
"docker0"
"br-*"
"veth*"
"vnet*"
"virbr*"
];
};
}
|