ModuleList / akashaProxy

better transparent proxy module (based clash)
GNU General Public License v3.0
139 stars 16 forks source link

[BUG] 1.配置启用Tun但是模块无法开启Tun /2.Tproxy模式下切换网络就断网 #32

Open LennoC opened 2 weeks ago

LennoC commented 2 weeks ago

须知

你的使用的root管理器是?

Magisk Alpha

问题描述

1.配置启用Tun但是模块无法开启Tun

我已在配置里启用Tun,并正常使用Tun模式多日。但偶尔会发生修改配置文件后就无法启用Tun的情况,此时开启模块会启用Tproxy模式,(*Tproxy这里还有个问题,日志里会出现“设备阉割了Tproxy-TCP/DUP”的提示,但能用),如果注释Tproxy端口会提示“Tproxy/Tun须启用一个”。 临时解决方法:MT管理器新建个文本把配置复制过去并改名,用该配置文件就能正常启用Tun了。

针对该问题建议加入网络模式选项 mode: Tun/Tproxy/**

2. Tproxy模式下切换网络就断网

启用Tproxy模式会在dashboard出现两句提示,日志里会出现“设备阉割了Tproxy-TCP/DUP”的提示,但能用。 Tproxy模式下,切换网络,从Wifi切至联通5G/4G或来回切换,会导致没有网络,有时候重启模块有效,有时候必须重启手机。 用过Box4Magisk也是如此,猜测是回环了。有时候会在clash日志里看到lookback等字样,但是没有保存下日志。

我的配置文件,脱敏并删去大部分规则相关项目。

没有启用黑白名单。 config-脱敏删去规则后.txt

模块日志

kernel.log内容: time="2024-10-10T02:51:15.053222815+08:00" level=info msg="Start initial configuration in progress" time="2024-10-10T02:51:15.055373596+08:00" level=info msg="Geodata Loader mode: memconservative" time="2024-10-10T02:51:15.055386826+08:00" level=info msg="Geosite Matcher implementation: succinct" time="2024-10-10T02:51:15.056432919+08:00" level=info msg="Initial configuration complete, total time: 3ms"

Magisk Alpha日志: magisk_log_2024-10-10T11.40.21.log

复现步骤

.......
### 1.配置启用Tun但是模块无法开启Tun
这个现象其实经常发生在修改了配置文件Tun相关之后,小概率发生在电脑端修改了配置文件再覆盖回安卓、修改了端口。
一个尝试复现的操作,按照example里的tun配置,只末尾加上了auto-direct:true。此时修改tun.enable:false,启用模块、关闭,再修改tun.enable:true,此时启用模块有一定概率无法启用tun,而且这个时候怎么改配置都不行。需要新建文本把配置复制过去,启用这个新文本配置。

### 2. Tproxy模式下切换网络就断网
Tproxy模式下切换网络几乎百分百复现。所以我无法使用Tproxy模式。

问题截图

No response

heinu123 commented 2 weeks ago

tun应该是匹配字符串问题(大概)

heinu123 commented 2 weeks ago

关于tproxy的报错使用tools目录下的sh脚本启动看看是否存在相关报错 或许是iptables问题

heinu123 commented 2 weeks ago

tproxy切换WiFi/手机流量导致断网我也不明白:( 可能是切换了网卡导致的的问题吧

LennoC commented 2 weeks ago

tun应该是匹配字符串问题(大概)

大概率是,建议直接出个Mode切换选项吧。我最近遇到的次数越来越多了,改次配置就得换个文本文件。

关于tproxy的报错使用tools目录下的sh脚本启动看看是否存在相关报错 或许是iptables问题

我看了start.sh脚本就是readme里的那行命令,我一直是用快捷方式shell调用该命令启动关闭的。在MT终端里调用也会有这两行提示,但是BOX4没有,而且TPROXY正常使用。

tproxy切换WiFi/手机流量导致断网我也不明白:( 可能是切换了网卡导致的的问题吧

百分百复现,我几乎没办法使用tproxy……跟一些群讨论大概率是回环,手机流量可能有公网IPV6导致。 Tun据说相对Tproxy更耗电,一直倒是想切回Tproxy模式的。

heinu123 commented 2 weeks ago

tun应该是匹配字符串问题(大概)

大概率是,建议直接出个Mode切换选项吧。我最近遇到的次数越来越多了,改次配置就得换个文本文件。

关于tproxy的报错使用tools目录下的sh脚本启动看看是否存在相关报错 或许是iptables问题

我看了start.sh脚本就是readme里的那行命令,我一直是用快捷方式shell调用该命令启动关闭的。在MT终端里调用也会有这两行提示,但是BOX4没有,而且TPROXY正常使用。

tproxy切换WiFi/手机流量导致断网我也不明白:( 可能是切换了网卡导致的的问题吧

百分百复现,我几乎没办法使用tproxy……跟一些群讨论大概率是回环,手机流量可能有公网IPV6导致。 Tun据说相对Tproxy更耗电,一直倒是想切回Tproxy模式的。

粘贴shell输出内容看看 关闭大概率应该不是ipv6导致的 因为不只是数据流量有ipv6,可能只是切换数据流量是网卡变动导致的

LennoC commented 2 weeks ago

粘贴shell输出内容看看 关闭大概率应该不是ipv6导致的 因为不只是数据流量有ipv6,可能只是切换数据流量是网卡变动导致的

通过MT管理器执行start.sh的输出,这次没有那两行提示了…… 此时我去dashboard里关闭启动也没有阉割tproxy的提示了 :(

info: 已开启代理udp chown: /data/clash/adguard/AdGuardHome: No such file or directory chmod: /data/clash/adguard/AdGuardHome: No such file or directory info: 自动更新clashMeta内核定时已开启. info: 代理模式:blacklist info: clashMeta内核已启动. info: 已跳过端口检查. info: 当前为:tproxy模式.

cat: /data/clash/run/appuid.list.tmp: No such file or directory cat: /data/clash/run/appuid.list: No such file or directory iptables v1.8.7 (legacy): option "--to-ports" requires an argument Try iptables -h' or 'iptables --help' for more information. iptables v1.8.7 (legacy): option "--to-ports" requires an argument Tryiptables -h' or 'iptables --help' for more information. cat: /data/clash/run/lastmobile: No such file or directory info: iptables规则已应用.

[进程已结束 - 按回车关闭]

附带一个执行stop.sh的输出 ata/clash/tools/stop.sh; exit &>/dev/null < info: 已停止clashMeta内核. Cannot find device "Meta" iptables: Bad rule (does a matching rule exist in that chain?). iptables: Bad rule (does a matching rule exist in that chain?). iptables: No chain/target/match by that name. iptables: Too many links. iptables: No chain/target/match by that name. iptables: Too many links. RTNETLINK answers: No such file or directory Cannot find device "Meta" ip6tables: Bad rule (does a matching rule exist in that chain?). ip6tables: Bad rule (does a matching rule exist in that chain?). ip6tables v1.8.7 (legacy): Couldn't find target `CLASH_OUT'

Try ip6tables -h' or 'ip6tables --help' for more information. ip6tables: No chain/target/match by that name. ip6tables: No chain/target/match by that name. ip6tables v1.8.7 (legacy): Couldn't find targetCLASH_PRE'

Try `ip6tables -h' or 'ip6tables --help' for more information. ip6tables: No chain/target/match by that name. ip6tables: No chain/target/match by that name. ip6tables: Bad rule (does a matching rule exist in that chain?). RTNETLINK answers: No such file or directory info: iptables规则已清空.

[进程已结束 - 按回车关闭]

heinu123 commented 2 weeks ago

Tun据说相对Tproxy更耗电,一直倒是想切回Tproxy模式的。

没有人进行过严谨的实验证明tun比tproxy更耗电。计较这点耗电量不如直接关机更为省电

tproxy还要进行流量转发 tun则是虚拟网卡,我本人使用tproxy遇到过各种各样的问题实际上我不是很想修tproxy了:( ps:现在的tproxy大部分操作还是源自于上游(dashboard作者)

LennoC commented 2 weeks ago

Tun据说相对Tproxy更耗电,一直倒是想切回Tproxy模式的。

没有人进行过严谨的实验证明tun比tproxy更耗电。计较这点耗电量不如直接关机更为省电

tproxy还要进行流量转发 tun则是虚拟网卡,我本人使用tproxy遇到过各种各样的问题实际上我不是很想修tproxy了:( ps:现在的tproxy大部分操作还是源自于上游(dashboard作者)

好的,那我继续tun吧,tproxy我也是遇到各种问题。 话说,我一直以为上游是CHIZI-0618的BOX4呢。