fix: output routing

This commit is contained in:
root
2026-04-15 00:11:52 +04:00
parent 0553dc8d70
commit b78e53ee23
+9 -2
View File
@@ -79,6 +79,10 @@ _init_vars() {
_validate_config() {
_log "config: validating uci syntax" "debug"
if [ -f "/etc/config/xray-manager" ]; then
sed -i 's/^ \+/ /g' /etc/config/xray-manager
fi
local dns_confdir
dns_confdir=$(uci -q get dhcp.@dnsmasq[0].confdir)
if [ -z "$dns_confdir" ] || ! echo "$dns_confdir" | grep -q "$DNSMASQ_DIR"; then
@@ -127,7 +131,7 @@ _nft_init() {
nft flush chain ip "$TABLE" prerouting
nft add rule ip "$TABLE" prerouting fib daddr type local accept
nft add chain ip "$TABLE" output { type filter hook output priority -150 \; policy accept \; } 2>/dev/null
nft add chain ip "$TABLE" output { type route hook output priority -150 \; policy accept \; } 2>/dev/null
nft flush chain ip "$TABLE" output
nft add rule ip "$TABLE" output fib daddr type local accept
@@ -355,7 +359,10 @@ _run() {
config_foreach _process_section "xray-list" "exclude"
_log "main: applying proxy bypass" "debug"
[ -n "$PROXY_SERVERS" ] && nft add rule ip "$TABLE" output ip daddr "@s_proxy_servers" accept 2>/dev/null
if [ -n "$PROXY_SERVERS" ]; then
_process_item "proxy_servers" "$PROXY_SERVERS" "ip" "out" "0"
nft add rule ip "$TABLE" output ip daddr "@s_proxy_servers" accept 2>/dev/null
fi
_log "main: applying tproxy rules" "debug"
mode_chain="prerouting"; config_foreach _process_section "xray-list" "main_rules"