set up minecraft port forwarding on lunasa

This commit is contained in:
insects 2024-09-01 21:25:43 +02:00
parent 7d57b2c17c
commit 189fcafde9

View file

@ -41,6 +41,7 @@
443
1935 # the RTMP port for OwnCast
6667 # irc plaintext
25565 # minecraft
];
services.owncast = {
@ -192,5 +193,30 @@
};
};
services.tailscale.enable = true;
networking.nftables = {
enable = true;
ruleset = ''
table ip nat {
chain PREROUTING {
type nat hook prerouting priority dstnat; policy accept;
iifname "enp1s0" tcp dport 25565 dnat to 100.66.105.22:25565
}
}
'';
};
networking.nat = {
enable = true;
internalInterfaces = [ "enp1s0" ];
externalInterface = "tailscale0";
forwardPorts = [
{
destination = "100.66.105.22:25565";
proto = "tcp";
sourcePort = 25565;
}
];
};
system.stateVersion = "23.11";
}