diff options
Diffstat (limited to 'configs')
| -rw-r--r-- | configs/sshd.nix | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/configs/sshd.nix b/configs/sshd.nix index d99ceb5..7fdcc42 100644 --- a/configs/sshd.nix +++ b/configs/sshd.nix @@ -4,13 +4,15 @@ lib.optional (cfg.host.nets?mycelium) cfg.host.nets.mycelium ++ lib.optional (cfg.host.nets?retiolum) cfg.host.nets.retiolum ++ lib.optional (cfg.host.nets?wiregrill) cfg.host.nets.wiregrill; + + cfg.ssh.port = 11423; in { services.openssh = { enable = true; }; tv.iptables.input-internet-accept-tcp = [ "ssh" ]; tv.iptables.extra.nat.OUTPUT = [ - "-o lo -p tcp --dport 11423 -j REDIRECT --to-ports 22" + "-o lo -p tcp --dport ${toString cfg.ssh.port} -j REDIRECT --to-ports 22" ]; tv.iptables.extra4.nat.PREROUTING = map @@ -22,6 +24,6 @@ in { (builtins.filter (net: net.ip6 != null) nets); tv.iptables.extra.nat.PREROUTING = [ "-p tcp --dport 22 -j REDIRECT --to-ports 0" - "-p tcp --dport 11423 -j REDIRECT --to-ports 22" + "-p tcp --dport ${toString cfg.ssh.port} -j REDIRECT --to-ports 22" ]; } |
