tangled
alpha
login
or
join now
devins.page
/
flake
0
fork
atom
configurations for my servers and desktops
nix
nixos
flake
dots
dotfiles
0
fork
atom
overview
issues
pulls
pipelines
feat: nftables
devins.page
3 months ago
55adcc77
1f6e3b0d
+33
-1
2 changed files
expand all
collapse all
unified
split
hosts
bluepill-proxy
services
caddy.nix
nftables.nix
+1
-1
hosts/bluepill-proxy/services/caddy.nix
···
1
1
{...}: {
2
2
-
networking.firewall.allowedTCPPorts = [22 80 443];
2
2
+
networking.firewall.allowedTCPPorts = [80 443];
3
3
4
4
services.caddy = {
5
5
enable = true;
+32
hosts/bluepill-proxy/services/nftables.nix
···
1
1
+
{pkgs, ...}: {
2
2
+
networking.sysctl = {
3
3
+
"net.ipv4.ip_forward" = 1;
4
4
+
"net.ipv6.conf.all.forwarding" = 1;
5
5
+
};
6
6
+
7
7
+
networking.firewall = {
8
8
+
enable = true;
9
9
+
allowedTCPPorts = [25565];
10
10
+
allowedUDPPorts = [25565 24454 19132];
11
11
+
};
12
12
+
13
13
+
networking.nftables = {
14
14
+
enable = true;
15
15
+
extraRules = ''
16
16
+
table ip nat {
17
17
+
chain prerouting {
18
18
+
type nat hook prerouting priority dstnat; policy accept;
19
19
+
tcp dport 25565 dnat to 100.109.134.42:25565;
20
20
+
udp dport 25565 dnat to 100.109.134.42:25565;
21
21
+
udp dport 24454 dnat to 100.109.134.42:24454;
22
22
+
udp dport 19132 dnat to 100.109.134.42:19132;
23
23
+
}
24
24
+
25
25
+
chain postrouting {
26
26
+
type nat hook postrouting priority srcnat; policy accept;
27
27
+
ip daddr 100.109.134.42 snat to 100.108.47.83;
28
28
+
}
29
29
+
}
30
30
+
'';
31
31
+
};
32
32
+
}