Add nftables config to home-gw ignition
All checks were successful
ShellCheck / shellcheck (push) Successful in 36s

This commit is contained in:
Mathieu Strypsteen 2024-08-08 11:34:34 +02:00
parent 94562bac53
commit ee71250f17
Signed by: mathieu
GPG key ID: 782A42E461BC6824

View file

@ -7,6 +7,26 @@ storage:
inline: |
net.ipv4.ip_forward = 1
net.ipv6.conf.all.forwarding = 1
- path: /etc/sysconfig/nftables.conf
overwrite: true
contents:
inline: |
flush ruleset
table inet nat {
chain prerouting {
type nat hook prerouting priority 0
tcp dport 80 dnat ip to 10.0.0.2
tcp dport 80 dnat ip6 to [fd00::2]
tcp dport 443 dnat ip to 10.0.0.2
tcp dport 443 dnat ip6 to [fd00::2]
tcp dport 18089 dnat ip to 10.0.0.2
tcp dport 18089 dnat ip6 to [fd00::2]
}
chain postrouting {
type nat hook postrouting priority 0
oifname gateway masquerade
}
}
passwd:
users:
- name: root