ansible-edda/playbooks/filesystem/yggdrasil/usr/local/sbin/post-up-br0-ipv4.nft.j2

21 lines
683 B
Plaintext
Raw Normal View History

2022-09-24 00:15:46 +02:00
#!/usr/bin/env -S nft -f
2022-09-25 16:00:40 +02:00
table ip br0_ipv4 {
2022-09-24 00:15:46 +02:00
chain prerouting {
type nat hook prerouting priority -100;
2022-11-15 23:01:51 +01:00
iif {{ ethx }} tcp dport { 80, 443 } dnat to {{ services['lrproxy'].address }};
iif {{ ethx }} tcp dport {{ services['git'].ssh_port }} dnat to {{ services['git'].address }};
2022-09-24 00:15:46 +02:00
}
2022-09-25 16:00:40 +02:00
chain input {
type filter hook input priority 0;
ct state established,related accept;
iif br0 ip daddr {{ subnet }} drop;
}
2022-09-24 00:15:46 +02:00
chain postrouting {
type nat hook postrouting priority 100;
iif br0 oif {{ ethx }} masquerade;
}
}