fix: zapret firewall rules

This commit is contained in:
elwrcl committed 2026-03-31 01:02:20 +03:00
1 parent 5b1c526e6a
commit 9f46eb3bbe
2 files changed
+8 -2

No files matched your search

+7 -2
View File
@@ -1,7 +1,6 @@
{ config, pkgs, ... }:
{
# you can make this true if you have problems with zapret
services.cloudflare-warp.enable = false;
services.zapret = {
@@ -26,8 +25,14 @@
networking.enableIPv6 = false;
networking.firewall.extraCommands = ''
iptables -I OUTPUT -p tcp -m multiport --dports 80,443 -m connbytes --connbytes-dir=original --connbytes-mode=packets --connbytes 1:9 -j NFQUEUE --queue-num 200 --queue-bypass
iptables -I OUTPUT -p udp --dport 443 -m connbytes --connbytes-dir=original --connbytes-mode=packets --connbytes 1:9 -j NFQUEUE --queue-num 200 --queue-bypass
iptables -I OUTPUT -m mark --mark 0x40000000/0x40000000 -j RETURN
'';
networking.firewall.extraStopCommands = ''
iptables -D OUTPUT -p tcp -m multiport --dports 80,443 -m connbytes --connbytes-dir=original --connbytes-mode=packets --connbytes 1:9 -j NFQUEUE --queue-num 200 --queue-bypass || true
iptables -D OUTPUT -p udp --dport 443 -m connbytes --connbytes-dir=original --connbytes-mode=packets --connbytes 1:9 -j NFQUEUE --queue-num 200 --queue-bypass || true
iptables -D OUTPUT -m mark --mark 0x40000000/0x40000000 -j RETURN || true
'';
}
}