pymumu / smartdns

A local DNS server to obtain the fastest website IP for the best Internet experience, support DoT, DoH. 一个本地DNS服务器,获取最快的网站IP,获得最佳上网体验,支持DoH,DoT。
https://pymumu.github.io/smartdns/
GNU General Public License v3.0
7.92k stars 1.05k forks source link

nft 添加 ipset 错误 #1745

Open cresky-github opened 1 month ago

cresky-github commented 1 month ago

问题现象
不是所有nft动作都失败,但遇有失败

nftset add failed, family:inet, table:PROXY.NAT, set:ipset_smartdns, error:File exists nftset add failed, family:inet, table:PROXY.NAT, set:ipset_smartdns, error:ip is invalid nftset add failed, family:inet, table:PROXY.NAT, set:ipset_smartdns, error:No such file or directory nftset add failed, family:inet, table:PROXY.NAT, set:ipset_smartdns, error:Resource temporarily unavailable

目前,只发现有4 种情况

这4 种错误,是什么意思 啊?

PikuZheng commented 1 month ago

nftset add failed, family:inet, table:PROXY.NAT, set:ipset_smartdns, error:File exists

nft存在,但尝试重复创建。这个应该没影响

nftset add failed, family:inet, table:PROXY.NAT, set:ipset_smartdns, error:ip is invalid

nft是ipv4表,但尝试添加ipv6记录?或者ip/子网 不匹配

nftset add failed, family:inet, table:PROXY.NAT, set:ipset_smartdns, error:No such file or directory

nft不存在,但尝试添加记录

nftset add failed, family:inet, table:PROXY.NAT, set:ipset_smartdns, error:Resource temporarily unavailable

猜测是没权限(nft需要root

以上都是我的猜测(平时用ipt不用nft

cresky-github commented 1 month ago

error:File exists 对我来说,很重要。 因为,要拿去分流的,查nftset了,确实没记录。

error:ip is invalid 应该是测速失败造成的,应该是不能访问的那种IP,或者是 timeout。对我没什么实质影响。

cresky-github commented 1 month ago

貌似返回多个IP时, 最后一个IP发生概率 更大。

PikuZheng commented 1 month ago

error:File exists 对我来说,很重要。 因为,要拿去分流的,查nftset了,确实没记录。

也可能ipset里已经有对应的ip(段)了。比如存在192.168.0.0/16,那么添加192.168.1.0/24就会报File exists

cresky-github commented 1 month ago

error:File exists 对我来说,很重要。 因为,要拿去分流的,查nftset了,确实没记录。

也可能ipset里已经有对应的ip(段)了。比如存在192.168.0.0/16,那么添加192.168.1.0/24就会报File exists

再去验证一下这说法。 再折腾折腾,看看能否解决问题。 如若不能,只能另想它法。