1
0
Fork 0
mirror of https://github.com/mdlayher/homelab.git synced 2024-12-14 11:47:32 +00:00

nixos/routnerr-2: allow Minecraft through firewall

Signed-off-by: Matt Layher <mdlayher@gmail.com>
This commit is contained in:
Matt Layher 2020-11-02 15:11:14 -05:00
parent d704aa65ae
commit 85b6f1e2cd
No known key found for this signature in database
GPG key ID: 77BFE531397EDE94

View file

@ -14,6 +14,7 @@ let
http = "80";
https = "443";
mdns = "5353";
minecraft = "25565";
plex = "32400";
ssh = "22";
unifi_device = "8080";
@ -262,6 +263,12 @@ in {
}
} tcp dport {${ports.ssh}, ${ports.consrv}} counter accept comment "IPv6 SSH"
# Minecraft running on server.
ip daddr ${vars.server_ipv4} tcp dport ${ports.minecraft} counter accept comment "server TCPv4 Minecraft"
ip6 daddr ${vars.server_ipv6} tcp dport ${ports.minecraft} counter accept comment "server TCPv6 Minecraft"
ip daddr ${vars.server_ipv4} udp dport ${ports.minecraft} counter accept comment "server UDPv4 Minecraft"
ip6 daddr ${vars.server_ipv6} udp dport ${ports.minecraft} counter accept comment "server UDPv6 Minecraft"
# Plex running on server.
ip daddr ${vars.server_ipv4} tcp dport ${ports.plex} counter accept comment "server IPv4 Plex"
ip6 daddr ${vars.server_ipv6} tcp dport ${ports.plex} counter accept comment "server IPv6 Plex"
@ -309,12 +316,14 @@ in {
chain prerouting_wans {
tcp dport {
${ports.minecraft},
${ports.plex},
${ports.unifi_device},
${ports.unifi_web},
} dnat ${vars.server_ipv4} comment "server TCPv4 DNAT"
udp dport {
${ports.minecraft},
${ports.unifi_stun},
} dnat ${vars.server_ipv4} comment "server UDPv4 DNAT"