Updated iptables

This commit is contained in:
2025-07-19 22:00:49 +03:00
parent ddc354a919
commit d4ba4ccf01

View File

@@ -3,6 +3,8 @@
# Очистка старой цепочки
iptables -t nat -F CLASH_REDIR 2>/dev/null
iptables -t nat -X CLASH_REDIR 2>/dev/null
iptables -t nat -F OUTPUT 2>/dev/null
iptables -t nat -X OUTPUT 2>/dev/null
# Создание пользовательской цепочки
iptables -t nat -N CLASH_REDIR
@@ -22,4 +24,7 @@ iptables -t nat -I OUTPUT -m owner --uid-owner clash -j RETURN
# Применяем CLASH_REDIR ко всем TCP
iptables -t nat -C OUTPUT -p tcp -j CLASH_REDIR 2>/dev/null || \
iptables -t nat -A OUTPUT -p tcp -j CLASH_REDIR
iptables -t nat -A OUTPUT -p tcp -j CLASH_REDIR
iptables -t nat -C PREROUTING -i wt0 -p tcp -j REDIRECT --to-port 7892 2>/dev/null || \
iptables -t nat -A PREROUTING -i wt0 -p tcp -j REDIRECT --to-port 7892