Add Wireguard playbook and first commit

This commit is contained in:
2026-08-29 16:07:57 +03:00
parent 4b1d5e4c66
commit 1ed3f0f5b6
18 changed files with 438 additions and 1 deletions

View File

@@ -0,0 +1,47 @@
#!/usr/sbin/nft -f
flush ruleset
table inet filter {
set home_net {
type ipv4_addr
flags interval
comment "Home subnet"
elements = {100.222.5.0/24}
}
set iot_net {
type ipv4_addr
flags interval
comment "iOT subnet"
elements = {100.222.6.0/24}
}
set vpn_net {
type ipv4_addr
flags interval
comment "iOT subnet"
elements = {100.222.11.0/24}
}
chain input {
type filter hook input priority filter; policy drop;
iif lo accept comment "Accept any localhost trafic"
ct state invalid drop comment "Drop invalid connection"
fib daddr . iif type != {local, broadcast, multicast} drop
ct state { established, related } accept
#meta l4proto { icmp, ipv6-icmp } accept comment "Accept ICMP"
tcp dport 22 accept comment "Allow ssh connection from home subnet"
ip saddr @vpn_net tcp dport 53 accept comment "Allow ssh connection from home subnet"
ip saddr @vpn_net udp dport 53 accept comment "Allow ssh connection from home subnet"
udp dport {{ wireguard_port }} accept comment "Wireguard port"
}
chain forward {
type filter hook forward priority filter;
}
chain output {
type filter hook output priority filter;
}
}