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

smartdns导致openwrt路由器重启后死机 #1844

Closed
qwerttvv opened this issue Oct 26, 2024 · 9 comments
Closed

smartdns导致openwrt路由器重启后死机 #1844

qwerttvv opened this issue Oct 26, 2024 · 9 comments

Comments

@qwerttvv
Copy link

最近把路由器换了,编译了新固件,刷好以后,都按以前旧的来配置,然后重启路由器就死机,表现就是客户端不能获取正确ip,只有个169.254.174.210的地址,拔插路由器电源重新开机也不行,就彻底歇菜了,经一系列固件和软件的排查,最后发现是smartdns导致的

因为重启后路由器直接死了,所以没有日志可查……

程序版本是目前最新的
https://github.com/pymumu/smartdns/tree/84f217dbd19f97e30f24af640ddb4cd21ae1e3ec
luci是配套js版本的
https://github.com/pymumu/smartdns/tree/84f217dbd19f97e30f24af640ddb4cd21ae1e3ec/package/luci
自己编译的,环境是ghcr.io/openwrt/sdk:aarch64_cortex-a53-openwrt-23.05

新旧路由器区别一个是内核以前4.x,现在6.x,一个是luci以前lua现在js,估计相关的还有openssl以前1.x现在3.x不过我装了1.x兼容库,但是编译环境也是官方新的23.05啊……

我把我配置贴过来吧

server-name smartdns
speed-check-mode tcp:443,tcp:80,ping
prefetch-domain yes
serve-expired yes
cache-size 333333
dnsmasq-lease-file /tmp/dhcp.leases
rr-ttl-min 600
log-size 64K
log-num 0
log-level off
audit-size 64K
audit-num 1
response-mode fastest-ip
cache-persist yes
cache-file /etc/smartdns/smartdns.cache
force-qtype-SOA  65
resolv-file /tmp/resolv.conf.d/resolv.conf.auto
bind :53535@br-lan 
bind :53535@lo 
bind :5335@br-lan  -no-speed-check -group fly -no-dualstack-selection -force-aaaa-soa -force-https-soa
bind :5335@lo  -no-speed-check -group fly -no-dualstack-selection -force-aaaa-soa -force-https-soa 
server-https https://1.12.12.12/dns-query  -no-check-certificate 
server-https https://223.5.5.5/dns-query  -no-check-certificate 
server 180.76.76.76  
server 180.184.1.1  
server 114.114.114.114  
server 117.50.10.10  
server-https https://8.8.8.8/dns-query  -no-check-certificate -group fly -exclude-default-group 
server-https https://1.1.1.1/dns-query  -no-check-certificate -group fly -exclude-default-group 
server-https https://208.67.222.222/dns-query  -no-check-certificate -group fly -exclude-default-group 
server-https https://9.9.9.9/dns-query  -no-check-certificate -group fly -exclude-default-group 
server-https https://185.222.222.222/dns-query  -no-check-certificate -group fly -exclude-default-group 
domain-set -name domain-forwarding-list -file /etc/smartdns/domain-forwarding.list
domain-rules /domain-set:domain-forwarding-list/  -nameserver fly -speed-check-mode tcp:443,tcp:80,ping -address #6
domain-set -name domain-block-list -file /etc/smartdns/domain-block.list
domain-rules /domain-set:domain-block-list/ -address #
conf-file /etc/smartdns/address.conf
conf-file /etc/smartdns/blacklist-ip.conf
conf-file /etc/smartdns/custom.conf

其它的还有dnsmasq的缓存设置为0,就是关了,还有些自定义如下

nameserver /cloudflare-dns.com/fly
nameserver /one.one.one.one/fly
nameserver /dns.google/fly
nameserver /quad9.net/fly
nameserver /opendns.com/fly
nameserver /dns.sb/fly
nameserver /google.com/fly
nameserver /youtube.com/fly
nameserver /telegram.org/fly
nameserver /t.me/fly

max-reply-ip-num 12
audit-enable no
cache-file /usr/smartdns.cache

#cloudflare ip-alias
ip-set -name cloudflare-ipv4 -file /usr/cfipv4.txt
ip-rules ip-set:cloudflare-ipv4 -ip-alias 104.18.228.90,104.18.226.59,XXXXXXX

ip-set -name cloudflare-ipv6 -file /usr/cfipv6.txt
ip-rules ip-set:cloudflare-ipv6 -ip-alias 2606:4700::fd08:1f6d:7a41:507b,2606:4700::d5c8:7866:93dc:754d,XXXX

/usr/cfipv4.txt
/usr/cfipv6.txt
/usr/smartdns.cache
这仨文件都在,直接拷贝的旧的,缓存的话因为会切回旧的路由器继续正常用,所以常用常新,也会一直拷

现在只要路由器不重启,程序正常运行是完全没问题的,包括重启程序也没问题,但是一重启路由器,路由器就歇菜了

固件的话,我编译了最新lean的(已经可以用js的luci),还有openwrt官方主线开发版的,还有ImmortalWrt主线开发版,也下了几个别人编译好的固件,都不行……

@qwerttvv
Copy link
Author

上次一个dns问题我一开始以为smartdns的事儿,还跟这里问了半天,最后问来问去,是ss rust的一个第三方dns组件的问题…

这次,我就是自己编译的固件只有基本的组件,没任何软件,然后自己一个一个手工安装,最后试到smartdns时候发现问题,应该排除别的了吧……

@PikuZheng
Copy link
Contributor

建议将smartdns开debug日志并写入持久存储,观察重启后卡在哪一步(不过我猜是smartdns启动时br-lan不存在

@qwerttvv
Copy link
Author

路由器死机了,进不去,开什么日志也看不了,现在死了就只能进去uboot重刷了,一刷就什么都没了……

@qwerttvv
Copy link
Author

一会儿我把绑br-lan的选项去掉试试

@PikuZheng
Copy link
Contributor

路由器死机了,进不去,开什么日志也看不了,现在死了就只能进去uboot重刷了,一刷就什么都没了……

是死机啊 不是单纯的客户端获取不到ip?

@qwerttvv
Copy link
Author

路由器死机了,进不去,开什么日志也看不了,现在死了就只能进去uboot重刷了,一刷就什么都没了……

是死机啊 不是单纯的客户端获取不到ip?

是死了,而且获取不到ip,手动指定配置ip也连不上网了,连不上路由器

@qwerttvv
Copy link
Author

试了一晚上,造成死机的原因,我那些自定义设置都排除了,缓存持久化选项排除了,绑定br-lan排除了

因为死机了捅屁股进uboot很费劲,刚刚一不留神把旁边的光纤线搞断了,现在手机热点上来的……今天不试了……

@qwerttvv
Copy link
Author

死机的原因继续排除了dnsmasq-lease-file /tmp/dhcp.leases的启用与否
还排除了端口用53和非53,也就是主服务还是dnsmasq上游

@qwerttvv
Copy link
Author

qwerttvv commented Oct 28, 2024

大早起刷牙突然一琢磨,感觉破案了我去……

init.d目录下文件是在的,但是rc.d下就没有smartdns的影子

这不就重启路由器以后,smartdns就不启动,dnsmasq启动就会出错,路由器就卡死了……

赶紧手动一个19一个82,我重启试试

我靠,果然猜的没错,正常重启了

我没试/etc/init.d/smartdns enable,忘了,直接新建的一个19一个82

@pymumu @PikuZheng

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants