summaryrefslogtreecommitdiff
path: root/hosts/cirrus
diff options
context:
space:
mode:
authorGrigory Shipunov2023-01-30 23:30:48 +0100
committerGrigory Shipunov2023-01-30 23:32:34 +0100
commitb1823c1d2cf6c91dc0213e49b720814d1ac11767 (patch)
treed05012dfdc1360708abf53d7677939024273d29a /hosts/cirrus
parent85b7b3f3708cd2c19beec17dff1637f87eeb8aa5 (diff)
add port forward for music
Diffstat (limited to 'hosts/cirrus')
-rw-r--r--hosts/cirrus/wireguard-server.nix22
1 files changed, 21 insertions, 1 deletions
diff --git a/hosts/cirrus/wireguard-server.nix b/hosts/cirrus/wireguard-server.nix
index 45c3dcb..a869294 100644
--- a/hosts/cirrus/wireguard-server.nix
+++ b/hosts/cirrus/wireguard-server.nix
@@ -1,7 +1,27 @@
{ config, ... }:
{
- networking.firewall.allowedUDPPorts = [ 51820 51821 ];
+ networking.firewall = {
+ allowedUDPPorts = [
+ # wireguards
+ 51820
+ 51821
+ ];
+ allowedTCPPorts = [
+ # port forward ssh to music
+ 2020
+ ];
+ # port-forward ssh to the music machine
+ extraCommands = ''
+ iptables -t nat -I PREROUTING -p tcp --dport 2020 -j DNAT --to-destination 10.34.45.101:22
+ '';
+ extraStopCommands = ''
+ iptables -t nat -D PREROUTING -p tcp --dport 2020 -j DNAT --to-destination 10.34.45.101:22 || true
+ '';
+ };
+
+
networking.wireguard.enable = true;
+
systemd.network = {
# oxalab
netdevs."oxalab" = {