haccfiles/parsons/nftables.nix

23 lines
576 B
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
{
networking.firewall.enable = true;
2024-04-07 14:25:08 +00:00
networking.nat.enable = true;
networking.nftables.enable = true;
networking.nftables.tables.nat = {
family = "ip";
content = ''
chain prerouting {
type nat hook prerouting priority -100
iifname enp35s0 tcp dport { 22 } dnat ${config.containers.forgejo.localAddress}:22
2024-02-25 16:53:54 +00:00
}
chain postrouting {
type nat hook postrouting priority 100
iifname lxcbr0 oifname enp35s0 masquerade
iifname ve-* oifname enp35s0 masquerade
2024-02-25 16:53:54 +00:00
}
'';
};
}