2024-02-12 17:17:59 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
{
|
2024-04-07 13:57:51 +00:00
|
|
|
networking.firewall.enable = true;
|
2024-02-12 17:17:59 +00:00
|
|
|
networking.nat.enable = false;
|
2024-02-25 16:53:54 +00:00
|
|
|
boot = {
|
|
|
|
kernelModules = [ "nf_nat_ftp" ];
|
|
|
|
kernel.sysctl = {
|
|
|
|
"net.ipv4.conf.all.forwarding" = true;
|
|
|
|
"net.ipv4.conf.default.forwarding" = true;
|
2024-02-12 17:17:59 +00:00
|
|
|
};
|
2024-02-25 16:53:54 +00:00
|
|
|
};
|
2024-02-12 17:17:59 +00:00
|
|
|
|
2024-04-07 13:57:51 +00:00
|
|
|
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
|
|
|
}
|
2024-04-07 13:57:51 +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
|
|
|
}
|
2024-02-18 12:39:54 +00:00
|
|
|
'';
|
|
|
|
};
|
2024-02-12 17:17:59 +00:00
|
|
|
}
|