added new roles

This commit is contained in:
pyrschtjag committed 2026-10-18 12:34:19 +04:00
1 parent d10d28a0d7
commit 04bfb22e48
73 files changed
+990 -96

No files matched your search

@@ -26,6 +26,13 @@ table inet filter {
iifname tun0 ip saddr {{ hostvars['workuter']['ip'] }} oifname tun0 ip daddr {{ hostvars['rbpi4']['ip'] }} tcp dport 22 counter accept
iifname tun0 ip saddr {{ hostvars['oyacoi-odcm']['ip'] }} oifname tun0 ip daddr {{ hostvars['xiawrt']['ip'] }} tcp dport 22 counter accept
iifname tun0 ip saddr {{ hostvars['oyacoi-odcm']['ip'] }} oifname tun0 ip daddr {{ hostvars['rbpi4']['ip'] }} tcp dport 22 counter accept
iifname tun0 ip saddr {{ hostvars['nginx']['ip'] }} oifname tun0 ip daddr {{ hostvars['xiawrt']['ip'] }} tcp dport 8080 counter accept
iifname tun0 ip saddr {{ hostvars['zabbix']['ip'] }} oifname tun0 ip daddr {{ hostvars['xiawrt']['ip'] }} tcp dport 10050 counter accept
iifname tun0 ip saddr {{ hostvars['zabbix']['ip'] }} oifname tun0 ip daddr {{ hostvars['rbpi4']['ip'] }} tcp dport 10050 counter accept
iifname tun0 ip saddr 10.1.0.0/24 oifname tun0 ip daddr {{ hostvars['rbpi4']['ip'] }} tcp dport 80 counter accept
iifname tun0 ip saddr 10.1.0.0/24 oifname tun0 ip daddr {{ hostvars['rbpi4']['ip'] }} tcp dport 443 counter accept
iifname tun0 ip saddr 10.2.0.0/24 oifname tun0 ip daddr {{ hostvars['rbpi4']['ip'] }} tcp dport 80 counter accept
iifname tun0 ip saddr 10.2.0.0/24 oifname tun0 ip daddr {{ hostvars['rbpi4']['ip'] }} tcp dport 443 counter accept
}
chain output {
type filter hook output priority filter;
@@ -4,31 +4,38 @@ flowtable ft {
}
chain input {
type filter hook input priority filter; policy drop;
ct state established,related accept
ct state invalid drop
iif lo accept
meta mark 0x00000001 accept
iifname br-eth0 tcp dport 22 accept
iifname eth0.11 tcp dport 22 accept
iifname tun0 tcp dport 22 accept
iifname { br-eth0, eth0.2, eth0.3, eth0.4, eth0.10, eth0.11, eth0.12 } tcp dport 61219 accept
iifname { br-eth0, eth0.2, eth0.3, eth0.4, eth0.10, eth0.11, eth0.12 } udp dport 61219 accept
iifname { br-eth0, eth0.2, eth0.3, eth0.4, eth0.10, eth0.11, eth0.12 } udp dport 53 accept
iifname { br-eth0, eth0.2, eth0.3, eth0.4, eth0.10, eth0.11, eth0.12 } tcp dport 53 accept
iifname eth0.3 udp dport 67 accept
iifname eth1 udp dport 68 accept
ct state established,related counter accept comment "input: established/related"
ct state invalid counter drop comment "input: invalid"
iif lo counter accept comment "input: loopback"
meta mark 0x00000001 counter accept comment "input: marked packets"
iifname br-eth0 tcp dport 22 counter accept comment "br-eth0 -> router"
iifname eth0.11 tcp dport 22 counter accept comment "eth0.11 -> router"
iifname tun0 tcp dport 22 counter accept comment "tun0 -> router"
iifname { br-eth0, eth0.2, eth0.3, eth0.4, eth0.10, eth0.11, eth0.12 } tcp dport 61219 counter accept comment "lan -> tproxy"
iifname { br-eth0, eth0.2, eth0.3, eth0.4, eth0.10, eth0.11, eth0.12 } udp dport 61219 counter accept comment "lan -> tproxy"
iifname { br-eth0, eth0.2, eth0.3, eth0.4, eth0.10, eth0.11, eth0.12 } udp dport 53 counter accept comment "lan -> dns"
iifname { br-eth0, eth0.2, eth0.3, eth0.4, eth0.10, eth0.11, eth0.12 } tcp dport 53 counter accept comment "lan -> dns"
iifname { eth0.2, eth0.3 } udp dport 32108 counter accept comment "lan -> mihome broadcast"
iifname { br-eth0, eth0.2, eth0.12 } udp dport 1900 counter accept comment "lan -> minidlna"
iifname eth0.3 udp dport 67 counter accept comment "lan -> dhcp"
iifname eth1 udp dport 68 counter accept comment "wan -> dhcp"
include "/etc/nftables.d/90-input.nft"
}
chain forward {
type filter hook forward priority filter; policy drop;
ct state established,related accept
ct state invalid drop
iifname { br-eth0, eth0.2, eth0.3, eth0.4, eth0.10, eth0.11, eth0.12 } oifname eth1 ct state new flow add @ft
iifname { br-eth0, eth0.2, eth0.3, eth0.4, eth0.10, eth0.11, eth0.12 } oifname eth1 accept
tcp flags syn tcp option maxseg size set rt mtu
ct state established,related counter accept comment "forward: established/related"
ct state invalid counter drop comment "drop invalid"
iifname { br-eth0, eth0.2, eth0.3, eth0.4, eth0.10, eth0.11, eth0.12 } oifname eth1 ct state new counter flow add @ft comment "lan -> eth0 flowtable offload"
iifname { br-eth0, eth0.2, eth0.3, eth0.4, eth0.10, eth0.11, eth0.12 } oifname eth1 counter accept comment "lan -> eth0"
iifname eth0.3 ip saddr {{ hostvars['camera0'].ip }} oifname "eth0.2" meta l4proto udp counter accept comment "camera0 -> eth0.2"
iifname eth0.2 oifname eth0.3 ip daddr {{ hostvars["camera0"].ip }} meta l4proto udp counter accept comment "eth0.2 -> camera0"
iifname { br-eth0, eth0.2 } oifname eth0.12 ip daddr {{ hostvars["minidlna"].ip }} tcp dport 8200 counter accept comment "lan -> minidlna"
iifname eth0.12 oifname { br-eth0, eth0.2 } ip saddr {{ hostvars["minidlna"].ip }} meta l4proto udp counter accept comment "minidlna -> lan"
tcp flags syn counter tcp option maxseg size set rt mtu comment "forward: mss clamp to route mtu"
include "/etc/nftables.d/90-forward.nft"
}
chain output {
type route hook output priority filter; policy accept;
oifname "eth0.3" ip daddr 10.2.0.255 udp dport 32108 counter ip daddr set 255.255.255.255 comment "camera0 broadcast rewrite"
include "/etc/nftables.d/90-output.nft"
}