diff --git a/homeproxy/root/etc/homeproxy/scripts/generate_client.uc b/homeproxy/root/etc/homeproxy/scripts/generate_client.uc index a766db1b..e33b0a52 100755 --- a/homeproxy/root/etc/homeproxy/scripts/generate_client.uc +++ b/homeproxy/root/etc/homeproxy/scripts/generate_client.uc @@ -129,10 +129,10 @@ if (match(proxy_mode, /redirect/)) { self_mark = uci.get(uciconfig, 'infra', 'self_mark') || '100'; redirect_port = uci.get(uciconfig, 'infra', 'redirect_port') || '5331'; } -if (match(proxy_mode), /tproxy/) +if (match(proxy_mode, /tproxy/)) if (main_udp_node !== 'nil' || routing_mode === 'custom') tproxy_port = uci.get(uciconfig, 'infra', 'tproxy_port') || '5332'; -if (match(proxy_mode), /tun/) { +if (match(proxy_mode, /tun/)) { tun_name = uci.get(uciconfig, uciinfra, 'tun_name') || 'singtun0'; tun_addr4 = uci.get(uciconfig, uciinfra, 'tun_addr4') || '172.19.0.1/30'; tun_addr6 = uci.get(uciconfig, uciinfra, 'tun_addr6') || 'fdfe:dcba:9876::1/126'; diff --git a/luci-app-passwall/Makefile b/luci-app-passwall/Makefile index e330ec17..cb4c7245 100644 --- a/luci-app-passwall/Makefile +++ b/luci-app-passwall/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-passwall -PKG_VERSION:=26.6.2 +PKG_VERSION:=26.7.1 PKG_RELEASE:=1 PKG_PO_VERSION:=$(PKG_VERSION) diff --git a/luci-app-passwall/root/usr/share/passwall/iptables.sh b/luci-app-passwall/root/usr/share/passwall/iptables.sh index 1eb3b769..17cc8b15 100755 --- a/luci-app-passwall/root/usr/share/passwall/iptables.sh +++ b/luci-app-passwall/root/usr/share/passwall/iptables.sh @@ -829,8 +829,19 @@ update_wan_sets() { } } +set_tproxy_sysctl() { + # Disable IPv4 rp_filter for TPROXY compatibility. + sysctl -w net.ipv4.conf.all.rp_filter=0 >/dev/null 2>&1 + sysctl -w net.ipv4.conf.default.rp_filter=0 >/dev/null 2>&1 + local f + for f in /proc/sys/net/ipv4/conf/*/rp_filter; do + echo 0 > "$f" 2>/dev/null + done +} + add_firewall_rule() { echolog "开始加载 iptables 防火墙规则..." + set_tproxy_sysctl ipset -! create $IPSET_LOCAL nethash maxelem 1048576 ipset -! create $IPSET_WAN nethash maxelem 1048576 ipset -! create $IPSET_LAN nethash maxelem 1048576 diff --git a/luci-app-passwall/root/usr/share/passwall/nftables.sh b/luci-app-passwall/root/usr/share/passwall/nftables.sh index 1a5d50b4..ec857321 100755 --- a/luci-app-passwall/root/usr/share/passwall/nftables.sh +++ b/luci-app-passwall/root/usr/share/passwall/nftables.sh @@ -891,11 +891,22 @@ update_wan_sets() { } } +set_tproxy_sysctl() { + # Disable IPv4 rp_filter for TPROXY compatibility. + sysctl -w net.ipv4.conf.all.rp_filter=0 >/dev/null 2>&1 + sysctl -w net.ipv4.conf.default.rp_filter=0 >/dev/null 2>&1 + local f + for f in /proc/sys/net/ipv4/conf/*/rp_filter; do + echo 0 > "$f" 2>/dev/null + done +} + add_firewall_rule() { echolog "开始加载 nftables 防火墙规则..." gen_nft_tables add_script_mwan3 mwan3_start + set_tproxy_sysctl gen_nftset $NFTSET_WAN ipv4_addr 0 "-1" gen_nftset $NFTSET_VPS ipv4_addr 0 "-1" gen_nftset $NFTSET_GFW ipv4_addr "2d" 0