Compare commits

...

2 Commits

Author SHA1 Message Date
Alexander Heldt
cc96dc072f manatee: Open jellyfin port 2026-01-06 17:05:02 +00:00
Alexander Heldt
c064d277ca manatee: Ensure local traffic works next to VPN 2026-01-06 17:04:53 +00:00
2 changed files with 15 additions and 5 deletions

View File

@@ -46,6 +46,10 @@ in
}; };
}; };
networking = {
firewall.allowedTCPPorts = [ 8096 ];
};
environment.systemPackages = [ environment.systemPackages = [
pkgs.jellyfin pkgs.jellyfin
pkgs.jellyfin-web pkgs.jellyfin-web

View File

@@ -1,4 +1,7 @@
{ ... }: { ... }:
let
hostAddress = "192.168.50.203";
in
{ {
networking = { networking = {
hostName = "manatee"; hostName = "manatee";
@@ -15,7 +18,7 @@
ipv4 = { ipv4 = {
addresses = [ addresses = [
{ {
address = "192.168.50.203"; address = hostAddress;
prefixLength = 24; prefixLength = 24;
} }
]; ];
@@ -34,11 +37,14 @@
}; };
}; };
# Route packets from machines local IP back to router
localCommands = '' localCommands = ''
# Add the rule only if it doesn't exist yet (idempotent) # Ensure local LAN traffic uses the main table, e.g. responds to the local machine
ip rule list | grep -q "from 192.168.50.203 lookup 100" || \ ip rule list | grep -q "192.168.50.0/24 lookup main" || \
ip rule add from 192.168.50.203 lookup 100 priority 5000 ip rule add to 192.168.50.0/24 lookup main priority 4999
# All other traffic from this IP uses Table 100 (e.g. responds to router and back out)
ip rule list | grep -q "from ${hostAddress} lookup 100" || \
ip rule add from ${hostAddress} lookup 100 priority 5000
''; '';
}; };
} }