diff --git a/luci-app-passwall/Makefile b/luci-app-passwall/Makefile index df130d29e..fa9c39db7 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:=4.56 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_CONFIG_DEPENDS:= \ CONFIG_PACKAGE_$(PKG_NAME)_Iptables_Transparent_Proxy \ diff --git a/luci-app-passwall/root/usr/share/passwall/app.sh b/luci-app-passwall/root/usr/share/passwall/app.sh index f30cd9d46..c4f350d2e 100755 --- a/luci-app-passwall/root/usr/share/passwall/app.sh +++ b/luci-app-passwall/root/usr/share/passwall/app.sh @@ -1377,10 +1377,11 @@ stop() { stop_crontab source $APP_PATH/helper_dnsmasq.sh del source $APP_PATH/helper_dnsmasq.sh restart no_log=1 + [ -s "$TMP_PATH/bridge_nf_ipt" ] && sysctl -w net.bridge.bridge-nf-call-iptables=$(cat $TMP_PATH/bridge_nf_ipt) >/dev/null 2>&1 + [ -s "$TMP_PATH/bridge_nf_ip6t" ] && sysctl -w net.bridge.bridge-nf-call-ip6tables=$(cat $TMP_PATH/bridge_nf_ip6t) >/dev/null 2>&1 rm -rf ${TMP_PATH} rm -rf /tmp/lock/${CONFIG}_script.lock echolog "清空并关闭相关程序和缓存完成。" - /etc/init.d/sysctl restart exit 0 } diff --git a/luci-app-passwall/root/usr/share/passwall/iptables.sh b/luci-app-passwall/root/usr/share/passwall/iptables.sh index b72c68c6f..5956c3d55 100755 --- a/luci-app-passwall/root/usr/share/passwall/iptables.sh +++ b/luci-app-passwall/root/usr/share/passwall/iptables.sh @@ -1224,8 +1224,14 @@ add_firewall_rule() { # dns_hijack "force" [ -n "${is_tproxy}" -o -n "${udp_flag}" ] && { + bridge_nf_ipt=$(sysctl -e -n net.bridge.bridge-nf-call-iptables) + echo -n $bridge_nf_ipt > $TMP_PATH/bridge_nf_ipt sysctl -w net.bridge.bridge-nf-call-iptables=0 >/dev/null 2>&1 - [ "$PROXY_IPV6" == "1" ] && sysctl -w net.bridge.bridge-nf-call-ip6tables=0 >/dev/null 2>&1 + [ "$PROXY_IPV6" == "1" ] && { + bridge_nf_ip6t=$(sysctl -e -n net.bridge.bridge-nf-call-ip6tables) + echo -n $bridge_nf_ip6t > $TMP_PATH/bridge_nf_ip6t + sysctl -w net.bridge.bridge-nf-call-ip6tables=0 >/dev/null 2>&1 + } } echolog "防火墙规则加载完成!" } diff --git a/luci-app-passwall/root/usr/share/passwall/nftables.sh b/luci-app-passwall/root/usr/share/passwall/nftables.sh index 2cf4e0466..cfe716fe9 100755 --- a/luci-app-passwall/root/usr/share/passwall/nftables.sh +++ b/luci-app-passwall/root/usr/share/passwall/nftables.sh @@ -1226,8 +1226,14 @@ add_firewall_rule() { # dns_hijack "force" [ -n "${is_tproxy}" -o -n "${udp_flag}" ] && { + bridge_nf_ipt=$(sysctl -e -n net.bridge.bridge-nf-call-iptables) + echo -n $bridge_nf_ipt > $TMP_PATH/bridge_nf_ipt sysctl -w net.bridge.bridge-nf-call-iptables=0 >/dev/null 2>&1 - [ "$PROXY_IPV6" == "1" ] && sysctl -w net.bridge.bridge-nf-call-ip6tables=0 >/dev/null 2>&1 + [ "$PROXY_IPV6" == "1" ] && { + bridge_nf_ip6t=$(sysctl -e -n net.bridge.bridge-nf-call-ip6tables) + echo -n $bridge_nf_ip6t > $TMP_PATH/bridge_nf_ip6t + sysctl -w net.bridge.bridge-nf-call-ip6tables=0 >/dev/null 2>&1 + } } echolog "防火墙规则加载完成!" }