Compare commits
2 Commits
5f756ae514
...
cc96dc072f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cc96dc072f | ||
|
|
c064d277ca |
@@ -46,6 +46,10 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
networking = {
|
||||||
|
firewall.allowedTCPPorts = [ 8096 ];
|
||||||
|
};
|
||||||
|
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
pkgs.jellyfin
|
pkgs.jellyfin
|
||||||
pkgs.jellyfin-web
|
pkgs.jellyfin-web
|
||||||
|
|||||||
@@ -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
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user