Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: 偶尔会出现直连失败, 同时代理正常. #718

Closed
xiaoshengshuohua opened this issue Dec 6, 2024 · 19 comments
Closed

[Bug]: 偶尔会出现直连失败, 同时代理正常. #718

xiaoshengshuohua opened this issue Dec 6, 2024 · 19 comments
Labels
bug Something isn't working

Comments

@xiaoshengshuohua
Copy link

Describe the Bug you encountered

偶尔出现直连网络失败, 同时代理网络正常.

关闭passwall2之后, 直连网络恢复正常, 重新启动passwall2直连与代理网络都正常.

Steps to reproduce this Bug

随机出现, 无法随时复现.

What you want to implement

...

Log information

daemon.err dnsmasq[9271]: nftset inet passwall2 passwall2_global_whitelist netlink: Error: cache initialization failed: Resource busy

Screenshot

...

System related information

passwall2: 24.11.19-r1

Other Information

...

@xiaoshengshuohua xiaoshengshuohua added the bug Something isn't working label Dec 6, 2024
@zjmsjla
Copy link

zjmsjla commented Dec 7, 2024

顶,我也是,并且我是用几个小时后一定会出现直连全部无法连接

@xsj684135
Copy link

我也有这个情况,你看看是不是这样的?
#691
我的症状是dnsmasqCPU占用高,导致DNS无响应,奇怪的是国内无法访问,国外正常

@xiaoshengshuohua
Copy link
Author

@zjmsjla @xsj684135 我禁用了 Sing-box 和 Passwall2的缓存, 目前来看貌似没出现这种问题了.

@xsj684135
Copy link

@zjmsjla @xsj684135 我禁用了 Sing-box 和 Passwall2的缓存, 目前来看貌似没出现这种问题了.

方便截个图看看吗,我没找到这个东西在哪关

@xiaoshengshuohua
Copy link
Author

@zjmsjla @xsj684135 我禁用了 Sing-box 和 Passwall2的缓存, 目前来看貌似没出现这种问题了.

方便截个图看看吗,我没找到这个东西在哪关

/usr/share/passwall2/app.sh: DNS_CACHE=$(config_t_get global dns_cache 1) 改成 DNS_CACHE=$(config_t_get global dns_cache 0)

Sing-box不用管.

@zjmsjla
Copy link

zjmsjla commented Dec 11, 2024

@zjmsjla @xsj684135 我禁用了 Sing-box 和 Passwall2的缓存, 目前来看貌似没出现这种问题了.

我禁用缓存,然后把passwall2和sing-box都更新到最新,好像也正常了,目前用起来没什么毛病

@xiaorouji
Copy link
Owner

It may be a dnsmasq nftset performance issue.
Try using the iptables+dnsmasq+ipset combination.

@xsj684135
Copy link

@zjmsjla @xsj684135 我禁用了 Sing-box 和 Passwall2的缓存, 目前来看貌似没出现这种问题了.

我禁用缓存,然后把passwall2和sing-box都更新到最新,好像也正常了,目前用起来没什么毛病

把缓存关掉之后目前我也没出现这个情况了

@xiaorouji
Copy link
Owner

Has anyone tested it with the latest version?

@fmsonic
Copy link

fmsonic commented Dec 14, 2024

passwall2中 直连 DNS 解析结果写入到 IPSe。看看是否有开启,开启了关闭试试看

@xiaoshengshuohua
Copy link
Author

Has anyone tested it with the latest version?

暂时没有出现这种问题, 不过最新版总感觉有点问题, 偶尔首次访问一些国外网站加载非常缓慢, 我用的是nftables.

dnsmasq.conf:
conf-file=/etc/dnsmasq.conf
domain-needed
localise-queries
read-ethers
expand-hosts
bind-dynamic
local-service
cache-size=0
dns-forward-max=1500
edns-packet-max=1232
domain=lan
local=/lan/
server=192.168.11.11#6053
addn-hosts=/tmp/hosts
min-cache-ttl=0
max-cache-ttl=0
stop-dns-rebind
rebind-localhost-ok
user=dnsmasq
group=dnsmasq




bogus-priv
conf-file=/usr/share/dnsmasq/rfc6761.conf




port=11400
conf-dir=/tmp/etc/passwall2/acl/default/dnsmasq.d
server=127.0.0.1#15353
no-poll
no-resolv
dnsmasq.conf.cfg01411c:
# auto-generated config file from /etc/config/dhcp
conf-file=/etc/dnsmasq.conf
dhcp-authoritative
domain-needed
no-resolv
localise-queries
read-ethers
enable-ubus=dnsmasq
expand-hosts
bind-dynamic
local-service
cache-size=0
dns-forward-max=1500
edns-packet-max=1232
domain=lan
local=/lan/
server=192.168.11.11#6053
addn-hosts=/tmp/hosts
dhcp-leasefile=/tmp/dhcp.leases
min-cache-ttl=0
max-cache-ttl=0
stop-dns-rebind
rebind-localhost-ok
dhcp-broadcast=tag:needs-broadcast
conf-dir=/tmp/dnsmasq.cfg01411c.d
user=dnsmasq
group=dnsmasq


dhcp-ignore-names=tag:dhcp_bogus_hostname
conf-file=/usr/share/dnsmasq/dhcpbogushostname.conf


bogus-priv
conf-file=/usr/share/dnsmasq/rfc6761.conf
dhcp-range=set:lan,192.168.11.100,192.168.11.249,255.255.255.0,12h
no-dhcp-interface=pppoe-wan





@xiaorouji
Copy link
Owner

xiaorouji commented Dec 14, 2024

@xiaoshengshuohua 把這個文件解壓後覆蓋路由器 /usr/share/passwall2裡面的app.sh
app.zip
然後再試試。
注:是的,新版修改了DNS邏輯,為避免侵入原53端口的DNS服務,passwall2會自己啟動一個專門的DNS,默認會給需要代理的設備劫持,而不需要代理的則走默認的53端口DNS服務。務必把Dnsmasq的DNS重定向(劫持)給關掉。否則可能會衝突!

@xiaorouji
Copy link
Owner

xiaorouji commented Dec 14, 2024

關閉DNS那個重定向並覆蓋app.sh文件後,記得重啟下passwall2,或者乾脆直接重啟設備。

@xiaoshengshuohua
Copy link
Author

關閉DNS那個重定向並覆蓋app.sh文件後,記得重啟下passwall2,或者乾脆直接重啟設備。

好的.
我用的官方24.10版本的, dnsmasq没有DNS重定向这些选项,

@xiaorouji
Copy link
Owner

xiaorouji commented Dec 14, 2024

沒有就不用管~~~直接覆蓋文件試試

@xiaoshengshuohua
Copy link
Author

沒有就不用管~~~直接覆蓋文件試試

首次访问加载缓慢的问题得到解决.

@yk271
Copy link
Contributor

yk271 commented Dec 14, 2024

@xiaoshengshuohua 把這個文件解壓後覆蓋路由器 /usr/share/passwall2裡面的app.sh app.zip 然後再試試。 注:是的,新版修改了DNS邏輯,為避免侵入原53端口的DNS服務,passwall2會自己啟動一個專門的DNS,默認會給需要代理的設備劫持,而不需要代理的則走默認的53端口DNS服務。務必把Dnsmasq的DNS重定向(劫持)給關掉。否則可能會衝突!

我觉得可以再优化一下,@lwb1978 之前在 passwall 那边对 Dnsmasq 里的 DNS 重定向做了处理,参考之前的代码,如果开了就把它关掉😂
https://github.com/xiaorouji/openwrt-passwall/blob/aaafdc3e469047853dda6e707f24990b83373ef5/luci-app-passwall/root/usr/share/passwall/nftables.sh#L808-L809

@xiaorouji
Copy link
Owner

@yk271
已經 commit 了

@yk271
Copy link
Contributor

yk271 commented Dec 14, 2024

@yk271 已經 commit 了

刚看到,感谢大佬

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants