vernesong / OpenClash

A Clash Client For OpenWrt
MIT License
17.81k stars 3.21k forks source link

[Bug] 在运行状态面板里无法切换运行模式 #3544

Closed LovesAsuna closed 11 months ago

LovesAsuna commented 1 year ago

Verify Steps

OpenClash Version

v0.45.141-beta

Bug on Environment

Official OpenWrt

Bug on Platform

Linux-amd64(x86-64)

To Reproduce

在运行状态面板里切换运行模式

Describe the Bug

无法在在运行状态面板里切换运行模式,无论怎么切换都会变回刚启动时的模式,只能从插件设置中切换(因为会重启内核?)

OpenClash Log

OpenClash 调试日志

生成时间: 2023-10-08 10:04:51 插件版本: v0.45.141-beta 隐私提示: 上传此日志前请注意检查、屏蔽公网IP、节点、密码等相关敏感信息


#===================== 系统信息 =====================#

主机型号: QEMU Standard PC (i440FX + PIIX, 1996)
固件版本: OpenWrt 22.03.5 r20134-5f15225c1e
LuCI版本: git-23.093.42303-d58cd69
内核版本: 5.10.176
处理器架构: x86_64

#此项有值时,如不使用IPv6,建议到网络-接口-lan的设置中禁用IPV6的DHCP
IPV6-DHCP: server

DNS劫持: 停用
#DNS劫持为Dnsmasq时,此项结果应仅有配置文件的DNS监听地址
Dnsmasq转发设置: 

#===================== 依赖检查 =====================#

dnsmasq-full: 已安装
coreutils: 已安装
coreutils-nohup: 已安装
bash: 已安装
curl: 已安装
ca-certificates: 已安装
ipset: 已安装
ip-full: 已安装
libcap: 已安装
libcap-bin: 已安装
ruby: 已安装
ruby-yaml: 已安装
ruby-psych: 已安装
ruby-pstore: 已安装
kmod-tun(TUN模式): 已安装
luci-compat(Luci >= 19.07): 已安装
kmod-inet-diag(PROCESS-NAME): 已安装
unzip: 已安装
kmod-nft-tproxy: 未安装

#===================== 内核检查 =====================#

运行状态: 运行中
运行内核:TUN
进程pid: 11590
运行权限: 11590: cap_dac_override,cap_net_bind_service,cap_net_admin,cap_net_raw,cap_sys_ptrace,cap_sys_resource=eip
运行用户: nobody
已选择的架构: linux-amd64

#下方无法显示内核版本号时请确认您的内核版本是否正确或者有无权限
Tun内核版本: 2023.08.17
Tun内核文件: 存在
Tun内核运行权限: 正常

Dev内核版本: v1.15.1-7-g6eee226
Dev内核文件: 存在
Dev内核运行权限: 正常

Meta内核版本: alpha-gefcb278
Meta内核文件: 存在
Meta内核运行权限: 正常

#===================== 插件设置 =====================#

当前配置文件: /etc/openclash/config/东方.yaml
启动配置文件: /etc/openclash/东方.yaml
运行模式: redir-host
默认代理模式: rule
UDP流量转发(tproxy): 启用
自定义DNS: 停用
IPV6代理: 启用
IPV6-DNS解析: 启用
禁用Dnsmasq缓存: 启用
自定义规则: 停用
仅允许内网: 启用
仅代理命中规则流量: 停用
仅允许常用端口流量: 停用
绕过中国大陆IP: 启用
路由本机代理: 启用

#启动异常时建议关闭此项后重试
混合节点: 停用
保留配置: 停用

#启动异常时建议关闭此项后重试
第三方规则: 停用

#===================== 配置文件 =====================#

socks-port: 7891
redir-port: 7892
tproxy-port: 7895
mixed-port: 7893
allow-lan: true
bind-address: "*"
mode: rule
log-level: info
ipv6: true
external-controller: 0.0.0.0:9090
hosts: {}
dns:
  enable: true
  listen: 0.0.0.0:7874
  ipv6: true
  default-nameserver:
  - 119.29.29.29
  - 223.5.5.5
  fake-ip-range: 198.18.0.1/16
  use-hosts: true
  fake-ip-filter:
  - "*.lan"
  - localhost.ptlogin2.qq.com
  - "*.msftconnecttest.com"
  - "*.msftncsi.com"
  - "*.srv.nintendo.net"
  - "*.stun.playstation.net"
  - xbox.*.microsoft.com
  - "*.xboxlive.com"
  - "*.logon.battlenet.com.cn"
  - "*.logon.battle.net"
  - stun.l.google.com
  - "+.*"
  nameserver:
  - 119.29.29.29
  - 223.5.5.5
  enhanced-mode: fake-ip
proxy-groups:
- name: "\U0001F310 国外流量"
  type: select
  proxies:
  - "♻️ 故障切换"
  - "➡️ 直接连接"
  - "\U0001F1F7\U0001F1FA 俄罗斯 01 RT IPv6"
  - "\U0001F1F7\U0001F1FA 俄罗斯 03 CN2 IPv6(2.75倍率)"
  - 卢森堡 01 Cogent(0.5倍率/无版权)
  - "\U0001F1F9\U0001F1FC 台湾 01 HiNet"
  - "\U0001F1F9\U0001F1FC 台湾 02 HiNet"
  - "\U0001F1F9\U0001F1F7 土耳其 01 Cogent"
  - "\U0001F1E7\U0001F1F7 巴西 01 Ascenty"
  - "\U0001F1E9\U0001F1EA 德国 02 GIA CN2(1.9倍率)"
  - "\U0001F1E9\U0001F1EA 德国 03 Cogent/Tata IPv6"
  - "\U0001F1F8\U0001F1EC 新加坡 01 Cogent IPv6(流媒体)"
  - "\U0001F1F8\U0001F1EC 新加坡 02 PCCW(2.4倍率)"
  - "\U0001F1EF\U0001F1F5 日本 03 电信/沪日专线(3倍率)"
  - "\U0001F1EF\U0001F1F5 日本 04 电信/沪日专线(3倍率)"
  - "\U0001F1EF\U0001F1F5 日本 05 NTT IPv6"
  - "\U0001F1EF\U0001F1F5 日本 06 M247 IPv6"
  - "\U0001F1EF\U0001F1F5 日本 08 IIJ"
  - "\U0001F1EF\U0001F1F5 日本 10 IIJ"
  - "\U0001F1EF\U0001F1F5 日本 12 IIJ IPv6"
  - "\U0001F1EF\U0001F1F5 日本 14 IIJ IPv6"
  - "\U0001F1EF\U0001F1F5 日本 16 IIJ"
  - "\U0001F1EF\U0001F1F5 日本 18 IIJ"
  - "\U0001F1EF\U0001F1F5 日本 20 IIJ"
  - "\U0001F1EF\U0001F1F5 日本 22 NTT"
  - "\U0001F1E6\U0001F1FA 澳大利亚 01 NTT IPv6"
  - "\U0001F1FA\U0001F1F2 美国 02 GIA CN2 IPv6"
  - "\U0001F1FA\U0001F1F2 美国 04 GIA CN2 IPv6"
  - "\U0001F1FA\U0001F1F2 美国 05 Cogent IPv6(流媒体)"
  - "\U0001F1EC\U0001F1E7 英国 01 NTT/GTT"
  - "\U0001F1E6\U0001F1F7 阿根廷 01 Telecom"
  - "\U0001F1E6\U0001F1F7 阿根廷 02 Velocom"
  - "\U0001F1F0\U0001F1F7 韩国 01 SK(2.7倍率)"
  - "\U0001F1ED\U0001F1F0 香港 03 电信/沪港专线(2.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 04 电信/沪港专线(2.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 07 移动/深港专线(2倍率)"
  - "\U0001F1ED\U0001F1F0 香港 08 移动/深港专线(2倍率)"
  - "\U0001F1ED\U0001F1F0 香港 09 HKT家宽(0.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 10 HKBN家宽(0.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 11 NTT IPv6"
  - "\U0001F1ED\U0001F1F0 香港 12 Cogent IPv6(流媒体)"
- name: "\U0001F6A5 其他流量"
  type: select
  proxies:
  - "\U0001F310 国外流量"
  - "➡️ 直接连接"
- name: "♻️ 故障切换"
  type: fallback
  proxies:
  - "\U0001F1F7\U0001F1FA 俄罗斯 01 RT IPv6"
  - "\U0001F1F7\U0001F1FA 俄罗斯 03 CN2 IPv6(2.75倍率)"
  - 卢森堡 01 Cogent(0.5倍率/无版权)
  - "\U0001F1F9\U0001F1FC 台湾 01 HiNet"
  - "\U0001F1F9\U0001F1FC 台湾 02 HiNet"
  - "\U0001F1F9\U0001F1F7 土耳其 01 Cogent"
  - "\U0001F1E7\U0001F1F7 巴西 01 Ascenty"
  - "\U0001F1E9\U0001F1EA 德国 02 GIA CN2(1.9倍率)"
  - "\U0001F1E9\U0001F1EA 德国 03 Cogent/Tata IPv6"
  - "\U0001F1F8\U0001F1EC 新加坡 01 Cogent IPv6(流媒体)"
  - "\U0001F1F8\U0001F1EC 新加坡 02 PCCW(2.4倍率)"
  - "\U0001F1EF\U0001F1F5 日本 03 电信/沪日专线(3倍率)"
  - "\U0001F1EF\U0001F1F5 日本 04 电信/沪日专线(3倍率)"
  - "\U0001F1EF\U0001F1F5 日本 05 NTT IPv6"
  - "\U0001F1EF\U0001F1F5 日本 06 M247 IPv6"
  - "\U0001F1EF\U0001F1F5 日本 08 IIJ"
  - "\U0001F1EF\U0001F1F5 日本 10 IIJ"
  - "\U0001F1EF\U0001F1F5 日本 12 IIJ IPv6"
  - "\U0001F1EF\U0001F1F5 日本 14 IIJ IPv6"
  - "\U0001F1EF\U0001F1F5 日本 16 IIJ"
  - "\U0001F1EF\U0001F1F5 日本 18 IIJ"
  - "\U0001F1EF\U0001F1F5 日本 20 IIJ"
  - "\U0001F1EF\U0001F1F5 日本 22 NTT"
  - "\U0001F1E6\U0001F1FA 澳大利亚 01 NTT IPv6"
  - "\U0001F1FA\U0001F1F2 美国 02 GIA CN2 IPv6"
  - "\U0001F1FA\U0001F1F2 美国 04 GIA CN2 IPv6"
  - "\U0001F1FA\U0001F1F2 美国 05 Cogent IPv6(流媒体)"
  - "\U0001F1EC\U0001F1E7 英国 01 NTT/GTT"
  - "\U0001F1E6\U0001F1F7 阿根廷 01 Telecom"
  - "\U0001F1E6\U0001F1F7 阿根廷 02 Velocom"
  - "\U0001F1F0\U0001F1F7 韩国 01 SK(2.7倍率)"
  - "\U0001F1ED\U0001F1F0 香港 03 电信/沪港专线(2.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 04 电信/沪港专线(2.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 07 移动/深港专线(2倍率)"
  - "\U0001F1ED\U0001F1F0 香港 08 移动/深港专线(2倍率)"
  - "\U0001F1ED\U0001F1F0 香港 09 HKT家宽(0.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 10 HKBN家宽(0.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 11 NTT IPv6"
  - "\U0001F1ED\U0001F1F0 香港 12 Cogent IPv6(流媒体)"
  url: http://cp.cloudflare.com/generate_204
  interval: 300
- name: "\U0001F3AC 国际流媒体"
  type: select
  proxies:
  - "\U0001F310 国外流量"
  - "➡️ 直接连接"
  - "\U0001F1F7\U0001F1FA 俄罗斯 01 RT IPv6"
  - "\U0001F1F7\U0001F1FA 俄罗斯 03 CN2 IPv6(2.75倍率)"
  - 卢森堡 01 Cogent(0.5倍率/无版权)
  - "\U0001F1F9\U0001F1FC 台湾 01 HiNet"
  - "\U0001F1F9\U0001F1FC 台湾 02 HiNet"
  - "\U0001F1F9\U0001F1F7 土耳其 01 Cogent"
  - "\U0001F1E7\U0001F1F7 巴西 01 Ascenty"
  - "\U0001F1E9\U0001F1EA 德国 02 GIA CN2(1.9倍率)"
  - "\U0001F1E9\U0001F1EA 德国 03 Cogent/Tata IPv6"
  - "\U0001F1F8\U0001F1EC 新加坡 01 Cogent IPv6(流媒体)"
  - "\U0001F1F8\U0001F1EC 新加坡 02 PCCW(2.4倍率)"
  - "\U0001F1EF\U0001F1F5 日本 03 电信/沪日专线(3倍率)"
  - "\U0001F1EF\U0001F1F5 日本 04 电信/沪日专线(3倍率)"
  - "\U0001F1EF\U0001F1F5 日本 05 NTT IPv6"
  - "\U0001F1EF\U0001F1F5 日本 06 M247 IPv6"
  - "\U0001F1EF\U0001F1F5 日本 08 IIJ"
  - "\U0001F1EF\U0001F1F5 日本 10 IIJ"
  - "\U0001F1EF\U0001F1F5 日本 12 IIJ IPv6"
  - "\U0001F1EF\U0001F1F5 日本 14 IIJ IPv6"
  - "\U0001F1EF\U0001F1F5 日本 16 IIJ"
  - "\U0001F1EF\U0001F1F5 日本 18 IIJ"
  - "\U0001F1EF\U0001F1F5 日本 20 IIJ"
  - "\U0001F1EF\U0001F1F5 日本 22 NTT"
  - "\U0001F1E6\U0001F1FA 澳大利亚 01 NTT IPv6"
  - "\U0001F1FA\U0001F1F2 美国 02 GIA CN2 IPv6"
  - "\U0001F1FA\U0001F1F2 美国 04 GIA CN2 IPv6"
  - "\U0001F1FA\U0001F1F2 美国 05 Cogent IPv6(流媒体)"
  - "\U0001F1EC\U0001F1E7 英国 01 NTT/GTT"
  - "\U0001F1E6\U0001F1F7 阿根廷 01 Telecom"
  - "\U0001F1E6\U0001F1F7 阿根廷 02 Velocom"
  - "\U0001F1F0\U0001F1F7 韩国 01 SK(2.7倍率)"
  - "\U0001F1ED\U0001F1F0 香港 03 电信/沪港专线(2.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 04 电信/沪港专线(2.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 07 移动/深港专线(2倍率)"
  - "\U0001F1ED\U0001F1F0 香港 08 移动/深港专线(2倍率)"
  - "\U0001F1ED\U0001F1F0 香港 09 HKT家宽(0.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 10 HKBN家宽(0.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 11 NTT IPv6"
  - "\U0001F1ED\U0001F1F0 香港 12 Cogent IPv6(流媒体)"
- name: "\U0001F3AC 大陆流媒体国际版"
  type: select
  proxies:
  - "➡️ 直接连接"
  - "\U0001F310 国外流量"
  - "\U0001F1F9\U0001F1FC 台湾 01 HiNet"
  - "\U0001F1F9\U0001F1FC 台湾 02 HiNet"
  - "\U0001F1ED\U0001F1F0 香港 03 电信/沪港专线(2.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 04 电信/沪港专线(2.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 07 移动/深港专线(2倍率)"
  - "\U0001F1ED\U0001F1F0 香港 08 移动/深港专线(2倍率)"
  - "\U0001F1ED\U0001F1F0 香港 09 HKT家宽(0.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 10 HKBN家宽(0.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 11 NTT IPv6"
  - "\U0001F1ED\U0001F1F0 香港 12 Cogent IPv6(流媒体)"
- name: "\U0001F3AE Steam"
  type: select
  proxies:
  - "\U0001F310 国外流量"
  - "➡️ 直接连接"
  - "\U0001F1F7\U0001F1FA 俄罗斯 01 RT IPv6"
  - "\U0001F1F7\U0001F1FA 俄罗斯 03 CN2 IPv6(2.75倍率)"
  - 卢森堡 01 Cogent(0.5倍率/无版权)
  - "\U0001F1F9\U0001F1FC 台湾 01 HiNet"
  - "\U0001F1F9\U0001F1FC 台湾 02 HiNet"
  - "\U0001F1F9\U0001F1F7 土耳其 01 Cogent"
  - "\U0001F1E7\U0001F1F7 巴西 01 Ascenty"
  - "\U0001F1E9\U0001F1EA 德国 02 GIA CN2(1.9倍率)"
  - "\U0001F1E9\U0001F1EA 德国 03 Cogent/Tata IPv6"
  - "\U0001F1F8\U0001F1EC 新加坡 01 Cogent IPv6(流媒体)"
  - "\U0001F1F8\U0001F1EC 新加坡 02 PCCW(2.4倍率)"
  - "\U0001F1EF\U0001F1F5 日本 03 电信/沪日专线(3倍率)"
  - "\U0001F1EF\U0001F1F5 日本 04 电信/沪日专线(3倍率)"
  - "\U0001F1EF\U0001F1F5 日本 05 NTT IPv6"
  - "\U0001F1EF\U0001F1F5 日本 06 M247 IPv6"
  - "\U0001F1EF\U0001F1F5 日本 08 IIJ"
  - "\U0001F1EF\U0001F1F5 日本 10 IIJ"
  - "\U0001F1EF\U0001F1F5 日本 12 IIJ IPv6"
  - "\U0001F1EF\U0001F1F5 日本 14 IIJ IPv6"
  - "\U0001F1EF\U0001F1F5 日本 16 IIJ"
  - "\U0001F1EF\U0001F1F5 日本 18 IIJ"
  - "\U0001F1EF\U0001F1F5 日本 20 IIJ"
  - "\U0001F1EF\U0001F1F5 日本 22 NTT"
  - "\U0001F1E6\U0001F1FA 澳大利亚 01 NTT IPv6"
  - "\U0001F1FA\U0001F1F2 美国 02 GIA CN2 IPv6"
  - "\U0001F1FA\U0001F1F2 美国 04 GIA CN2 IPv6"
  - "\U0001F1FA\U0001F1F2 美国 05 Cogent IPv6(流媒体)"
  - "\U0001F1EC\U0001F1E7 英国 01 NTT/GTT"
  - "\U0001F1E6\U0001F1F7 阿根廷 01 Telecom"
  - "\U0001F1E6\U0001F1F7 阿根廷 02 Velocom"
  - "\U0001F1F0\U0001F1F7 韩国 01 SK(2.7倍率)"
  - "\U0001F1ED\U0001F1F0 香港 03 电信/沪港专线(2.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 04 电信/沪港专线(2.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 07 移动/深港专线(2倍率)"
  - "\U0001F1ED\U0001F1F0 香港 08 移动/深港专线(2倍率)"
  - "\U0001F1ED\U0001F1F0 香港 09 HKT家宽(0.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 10 HKBN家宽(0.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 11 NTT IPv6"
  - "\U0001F1ED\U0001F1F0 香港 12 Cogent IPv6(流媒体)"
- name: "\U0001F310 国际网站"
  type: select
  proxies:
  - "\U0001F310 国外流量"
  - "➡️ 直接连接"
  - "\U0001F1F7\U0001F1FA 俄罗斯 01 RT IPv6"
  - "\U0001F1F7\U0001F1FA 俄罗斯 03 CN2 IPv6(2.75倍率)"
  - 卢森堡 01 Cogent(0.5倍率/无版权)
  - "\U0001F1F9\U0001F1FC 台湾 01 HiNet"
  - "\U0001F1F9\U0001F1FC 台湾 02 HiNet"
  - "\U0001F1F9\U0001F1F7 土耳其 01 Cogent"
  - "\U0001F1E7\U0001F1F7 巴西 01 Ascenty"
  - "\U0001F1E9\U0001F1EA 德国 02 GIA CN2(1.9倍率)"
  - "\U0001F1E9\U0001F1EA 德国 03 Cogent/Tata IPv6"
  - "\U0001F1F8\U0001F1EC 新加坡 01 Cogent IPv6(流媒体)"
  - "\U0001F1F8\U0001F1EC 新加坡 02 PCCW(2.4倍率)"
  - "\U0001F1EF\U0001F1F5 日本 03 电信/沪日专线(3倍率)"
  - "\U0001F1EF\U0001F1F5 日本 04 电信/沪日专线(3倍率)"
  - "\U0001F1EF\U0001F1F5 日本 05 NTT IPv6"
  - "\U0001F1EF\U0001F1F5 日本 06 M247 IPv6"
  - "\U0001F1EF\U0001F1F5 日本 08 IIJ"
  - "\U0001F1EF\U0001F1F5 日本 10 IIJ"
  - "\U0001F1EF\U0001F1F5 日本 12 IIJ IPv6"
  - "\U0001F1EF\U0001F1F5 日本 14 IIJ IPv6"
  - "\U0001F1EF\U0001F1F5 日本 16 IIJ"
  - "\U0001F1EF\U0001F1F5 日本 18 IIJ"
  - "\U0001F1EF\U0001F1F5 日本 20 IIJ"
  - "\U0001F1EF\U0001F1F5 日本 22 NTT"
  - "\U0001F1E6\U0001F1FA 澳大利亚 01 NTT IPv6"
  - "\U0001F1FA\U0001F1F2 美国 02 GIA CN2 IPv6"
  - "\U0001F1FA\U0001F1F2 美国 04 GIA CN2 IPv6"
  - "\U0001F1FA\U0001F1F2 美国 05 Cogent IPv6(流媒体)"
  - "\U0001F1EC\U0001F1E7 英国 01 NTT/GTT"
  - "\U0001F1E6\U0001F1F7 阿根廷 01 Telecom"
  - "\U0001F1E6\U0001F1F7 阿根廷 02 Velocom"
  - "\U0001F1F0\U0001F1F7 韩国 01 SK(2.7倍率)"
  - "\U0001F1ED\U0001F1F0 香港 03 电信/沪港专线(2.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 04 电信/沪港专线(2.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 07 移动/深港专线(2倍率)"
  - "\U0001F1ED\U0001F1F0 香港 08 移动/深港专线(2倍率)"
  - "\U0001F1ED\U0001F1F0 香港 09 HKT家宽(0.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 10 HKBN家宽(0.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 11 NTT IPv6"
  - "\U0001F1ED\U0001F1F0 香港 12 Cogent IPv6(流媒体)"
- name: "\U0001F3E0 大陆流量"
  type: select
  proxies:
  - "➡️ 直接连接"
  - "\U0001F310 国外流量"
  - "\U0001F1F7\U0001F1FA 俄罗斯 01 RT IPv6"
  - "\U0001F1F7\U0001F1FA 俄罗斯 03 CN2 IPv6(2.75倍率)"
  - 卢森堡 01 Cogent(0.5倍率/无版权)
  - "\U0001F1F9\U0001F1FC 台湾 01 HiNet"
  - "\U0001F1F9\U0001F1FC 台湾 02 HiNet"
  - "\U0001F1F9\U0001F1F7 土耳其 01 Cogent"
  - "\U0001F1E7\U0001F1F7 巴西 01 Ascenty"
  - "\U0001F1E9\U0001F1EA 德国 02 GIA CN2(1.9倍率)"
  - "\U0001F1E9\U0001F1EA 德国 03 Cogent/Tata IPv6"
  - "\U0001F1F8\U0001F1EC 新加坡 01 Cogent IPv6(流媒体)"
  - "\U0001F1F8\U0001F1EC 新加坡 02 PCCW(2.4倍率)"
  - "\U0001F1EF\U0001F1F5 日本 03 电信/沪日专线(3倍率)"
  - "\U0001F1EF\U0001F1F5 日本 04 电信/沪日专线(3倍率)"
  - "\U0001F1EF\U0001F1F5 日本 05 NTT IPv6"
  - "\U0001F1EF\U0001F1F5 日本 06 M247 IPv6"
  - "\U0001F1EF\U0001F1F5 日本 08 IIJ"
  - "\U0001F1EF\U0001F1F5 日本 10 IIJ"
  - "\U0001F1EF\U0001F1F5 日本 12 IIJ IPv6"
  - "\U0001F1EF\U0001F1F5 日本 14 IIJ IPv6"
  - "\U0001F1EF\U0001F1F5 日本 16 IIJ"
  - "\U0001F1EF\U0001F1F5 日本 18 IIJ"
  - "\U0001F1EF\U0001F1F5 日本 20 IIJ"
  - "\U0001F1EF\U0001F1F5 日本 22 NTT"
  - "\U0001F1E6\U0001F1FA 澳大利亚 01 NTT IPv6"
  - "\U0001F1FA\U0001F1F2 美国 02 GIA CN2 IPv6"
  - "\U0001F1FA\U0001F1F2 美国 04 GIA CN2 IPv6"
  - "\U0001F1FA\U0001F1F2 美国 05 Cogent IPv6(流媒体)"
  - "\U0001F1EC\U0001F1E7 英国 01 NTT/GTT"
  - "\U0001F1E6\U0001F1F7 阿根廷 01 Telecom"
  - "\U0001F1E6\U0001F1F7 阿根廷 02 Velocom"
  - "\U0001F1F0\U0001F1F7 韩国 01 SK(2.7倍率)"
  - "\U0001F1ED\U0001F1F0 香港 03 电信/沪港专线(2.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 04 电信/沪港专线(2.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 07 移动/深港专线(2倍率)"
  - "\U0001F1ED\U0001F1F0 香港 08 移动/深港专线(2倍率)"
  - "\U0001F1ED\U0001F1F0 香港 09 HKT家宽(0.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 10 HKBN家宽(0.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 11 NTT IPv6"
  - "\U0001F1ED\U0001F1F0 香港 12 Cogent IPv6(流媒体)"
- name: "\U0001F3AC 大陆流媒体"
  type: select
  proxies:
  - "\U0001F3E0 大陆流量"
  - "➡️ 直接连接"
  - "\U0001F1F9\U0001F1FC 台湾 01 HiNet"
  - "\U0001F1F9\U0001F1FC 台湾 02 HiNet"
  - "\U0001F1ED\U0001F1F0 香港 03 电信/沪港专线(2.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 04 电信/沪港专线(2.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 07 移动/深港专线(2倍率)"
  - "\U0001F1ED\U0001F1F0 香港 08 移动/深港专线(2倍率)"
  - "\U0001F1ED\U0001F1F0 香港 09 HKT家宽(0.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 10 HKBN家宽(0.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 11 NTT IPv6"
  - "\U0001F1ED\U0001F1F0 香港 12 Cogent IPv6(流媒体)"
- name: "\U0001F3E0 大陆网站"
  type: select
  proxies:
  - "\U0001F3E0 大陆流量"
  - "➡️ 直接连接"
  - "\U0001F1F7\U0001F1FA 俄罗斯 01 RT IPv6"
  - "\U0001F1F7\U0001F1FA 俄罗斯 03 CN2 IPv6(2.75倍率)"
  - 卢森堡 01 Cogent(0.5倍率/无版权)
  - "\U0001F1F9\U0001F1FC 台湾 01 HiNet"
  - "\U0001F1F9\U0001F1FC 台湾 02 HiNet"
  - "\U0001F1F9\U0001F1F7 土耳其 01 Cogent"
  - "\U0001F1E7\U0001F1F7 巴西 01 Ascenty"
  - "\U0001F1E9\U0001F1EA 德国 02 GIA CN2(1.9倍率)"
  - "\U0001F1E9\U0001F1EA 德国 03 Cogent/Tata IPv6"
  - "\U0001F1F8\U0001F1EC 新加坡 01 Cogent IPv6(流媒体)"
  - "\U0001F1F8\U0001F1EC 新加坡 02 PCCW(2.4倍率)"
  - "\U0001F1EF\U0001F1F5 日本 03 电信/沪日专线(3倍率)"
  - "\U0001F1EF\U0001F1F5 日本 04 电信/沪日专线(3倍率)"
  - "\U0001F1EF\U0001F1F5 日本 05 NTT IPv6"
  - "\U0001F1EF\U0001F1F5 日本 06 M247 IPv6"
  - "\U0001F1EF\U0001F1F5 日本 08 IIJ"
  - "\U0001F1EF\U0001F1F5 日本 10 IIJ"
  - "\U0001F1EF\U0001F1F5 日本 12 IIJ IPv6"
  - "\U0001F1EF\U0001F1F5 日本 14 IIJ IPv6"
  - "\U0001F1EF\U0001F1F5 日本 16 IIJ"
  - "\U0001F1EF\U0001F1F5 日本 18 IIJ"
  - "\U0001F1EF\U0001F1F5 日本 20 IIJ"
  - "\U0001F1EF\U0001F1F5 日本 22 NTT"
  - "\U0001F1E6\U0001F1FA 澳大利亚 01 NTT IPv6"
  - "\U0001F1FA\U0001F1F2 美国 02 GIA CN2 IPv6"
  - "\U0001F1FA\U0001F1F2 美国 04 GIA CN2 IPv6"
  - "\U0001F1FA\U0001F1F2 美国 05 Cogent IPv6(流媒体)"
  - "\U0001F1EC\U0001F1E7 英国 01 NTT/GTT"
  - "\U0001F1E6\U0001F1F7 阿根廷 01 Telecom"
  - "\U0001F1E6\U0001F1F7 阿根廷 02 Velocom"
  - "\U0001F1F0\U0001F1F7 韩国 01 SK(2.7倍率)"
  - "\U0001F1ED\U0001F1F0 香港 03 电信/沪港专线(2.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 04 电信/沪港专线(2.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 07 移动/深港专线(2倍率)"
  - "\U0001F1ED\U0001F1F0 香港 08 移动/深港专线(2倍率)"
  - "\U0001F1ED\U0001F1F0 香港 09 HKT家宽(0.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 10 HKBN家宽(0.5倍率)"
  - "\U0001F1ED\U0001F1F0 香港 11 NTT IPv6"
  - "\U0001F1ED\U0001F1F0 香港 12 Cogent IPv6(流媒体)"
- name: "➡️ 直接连接"
  type: select
  proxies:
  - DIRECT
rules:
- DST-PORT,7895,REJECT
- DST-PORT,7892,REJECT
- IP-CIDR,198.18.0.1/16,REJECT,no-resolve
- RULE-SET,Unbreak,DIRECT
- "RULE-SET,Streaming,\U0001F3AC 国际流媒体"
- "RULE-SET,StreamingSE,\U0001F3AC 大陆流媒体国际版"
- "RULE-SET,Steam,\U0001F3AE Steam"
- "RULE-SET,Global,\U0001F310 国际网站"
- "RULE-SET,StreamingCN,\U0001F3AC 大陆流媒体"
- "RULE-SET,China,\U0001F3E0 大陆网站"
- IP-CIDR,192.168.0.0/16,DIRECT
- IP-CIDR,10.0.0.0/8,DIRECT
- IP-CIDR,172.16.0.0/12,DIRECT
- IP-CIDR,127.0.0.0/8,DIRECT
- IP-CIDR,100.64.0.0/10,DIRECT
- IP-CIDR,224.0.0.0/4,DIRECT
- IP-CIDR,fe80::/10,DIRECT
- "RULE-SET,ChinaIP,\U0001F3E0 大陆流量"
- "MATCH,\U0001F6A5 其他流量"
rule-providers:
  Unbreak:
    type: http
    behavior: classical
    path: "./rule_provider/Unbreak.yaml"
    url: https://ghproxy.com/https://raw.githubusercontent.com/DivineEngine/Profiles/master/Clash/RuleSet/Unbreak.yaml
    interval: 86400
  Streaming:
    type: http
    behavior: classical
    path: "./rule_provider/Streaming.yaml"
    url: https://ghproxy.com/https://raw.githubusercontent.com/DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/Streaming.yaml
    interval: 86400
  StreamingSE:
    type: http
    behavior: classical
    path: "./rule_provider/StreamingSE.yaml"
    url: https://ghproxy.com/https://raw.githubusercontent.com/DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/StreamingSE.yaml
    interval: 86400
  StreamingCN:
    type: http
    behavior: classical
    path: "./rule_provider/StreamingCN.yaml"
    url: https://ghproxy.com/https://raw.githubusercontent.com/DivineEngine/Profiles/master/Clash/RuleSet/StreamingMedia/StreamingCN.yaml
    interval: 86400
  Steam:
    type: http
    behavior: classical
    path: "./rule_provider/Steam.yaml"
    url: https://ghproxy.com/https://raw.githubusercontent.com/DivineEngine/Profiles/master/Clash/RuleSet/Extra/Game/Steam.yaml
    interval: 86400
  Global:
    type: http
    behavior: classical
    path: "./rule_provider/Global.yaml"
    url: https://ghproxy.com/https://raw.githubusercontent.com/DivineEngine/Profiles/master/Clash/RuleSet/Global.yaml
    interval: 86400
  China:
    type: http
    behavior: classical
    path: "./rule_provider/China.yaml"
    url: https://ghproxy.com/https://raw.githubusercontent.com/DivineEngine/Profiles/master/Clash/RuleSet/China.yaml
    interval: 86400
  ChinaIP:
    type: http
    behavior: ipcidr
    path: "./rule_provider/ChinaIP.yaml"
    url: https://ghproxy.com/https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/cncidr.txt
    interval: 86400
port: 7890
external-ui: "/usr/share/openclash/ui"
experimental:
  sniff-tls-sni: true
profile:
  store-selected: true
authentication:
- Clash:lSGfhQb4

#===================== 自定义覆写设置 =====================#

#!/bin/sh
. /usr/share/openclash/ruby.sh
. /usr/share/openclash/log.sh
. /lib/functions.sh

# This script is called by /etc/init.d/openclash
# Add your custom overwrite scripts here, they will be take effict after the OpenClash own srcipts

LOG_OUT "Tip: Start Running Custom Overwrite Scripts..."
LOGTIME=$(echo $(date "+%Y-%m-%d %H:%M:%S"))
LOG_FILE="/tmp/openclash.log"
CONFIG_FILE="$1" #config path

#Simple Demo:
    #General Demo
    #1--config path
    #2--key name
    #3--value
    #ruby_edit "$CONFIG_FILE" "['redir-port']" "7892"
    #ruby_edit "$CONFIG_FILE" "['secret']" "123456"
    #ruby_edit "$CONFIG_FILE" "['dns']['enable']" "true"

    #Hash Demo
    #1--config path
    #2--key name
    #3--hash type value
    #ruby_edit "$CONFIG_FILE" "['experimental']" "{'sniff-tls-sni'=>true}"
    #ruby_edit "$CONFIG_FILE" "['sniffer']" "{'sniffing'=>['tls','http']}"

    #Array Demo:
    #1--config path
    #2--key name
    #3--position(start from 0, end with -1)
    #4--value
    #ruby_arr_insert "$CONFIG_FILE" "['dns']['nameserver']" "0" "114.114.114.114"

    #Array Add From Yaml File Demo:
    #1--config path
    #2--key name
    #3--position(start from 0, end with -1)
    #4--value file path
    #5--value key name in #4 file
    #ruby_arr_add_file "$CONFIG_FILE" "['dns']['fallback-filter']['ipcidr']" "0" "/etc/openclash/custom/openclash_custom_fallback_filter.yaml" "['fallback-filter']['ipcidr']"

#Ruby Script Demo:
    #ruby -ryaml -rYAML -I "/usr/share/openclash" -E UTF-8 -e "
    #   begin
    #      Value = YAML.load_file('$CONFIG_FILE');
    #   rescue Exception => e
    #      puts '${LOGTIME} Error: Load File Failed,【' + e.message + '】';
    #   end;

        #General
    #   begin
    #   Thread.new{
    #      Value['redir-port']=7892;
    #      Value['tproxy-port']=7895;
    #      Value['port']=7890;
    #      Value['socks-port']=7891;
    #      Value['mixed-port']=7893;
    #   }.join;

    #   rescue Exception => e
    #      puts '${LOGTIME} Error: Set General Failed,【' + e.message + '】';
    #   ensure
    #      File.open('$CONFIG_FILE','w') {|f| YAML.dump(Value, f)};
    #   end" 2>/dev/null >> $LOG_FILE

exit 0
#===================== 自定义防火墙设置 =====================#

#!/bin/sh
. /usr/share/openclash/log.sh
. /lib/functions.sh

# This script is called by /etc/init.d/openclash
# Add your custom firewall rules here, they will be added after the end of the OpenClash iptables rules

LOG_OUT "Tip: Start Add Custom Firewall Rules..."

exit 0
#===================== IPTABLES 防火墙设置 =====================#

#IPv4 NAT chain

# Generated by iptables-save v1.8.7 on Sun Oct  8 10:04:52 2023
*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
COMMIT
# Completed on Sun Oct  8 10:04:52 2023

#IPv4 Mangle chain

# Generated by iptables-save v1.8.7 on Sun Oct  8 10:04:52 2023
*mangle
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
COMMIT
# Completed on Sun Oct  8 10:04:52 2023

#IPv4 Filter chain

# Generated by iptables-save v1.8.7 on Sun Oct  8 10:04:52 2023
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
COMMIT
# Completed on Sun Oct  8 10:04:52 2023

#IPv6 NAT chain

#IPv6 Mangle chain

#IPv6 Filter chain

#===================== NFTABLES 防火墙设置 =====================#

table inet fw4 {
    chain input {
        type filter hook input priority filter; policy accept;
        iifname "eth2" ip6 saddr != @localnetwork6 counter packets 3576 bytes 638206 jump openclash_wan6_input
        udp dport 443 ip6 daddr != @china_ip6_route counter packets 0 bytes 0 reject with icmpv6 port-unreachable comment "OpenClash QUIC REJECT"
        udp dport 443 ip daddr != @china_ip_route counter packets 0 bytes 0 reject with icmp port-unreachable comment "OpenClash QUIC REJECT"
        iifname "eth2" ip saddr != @localnetwork counter packets 672 bytes 122402 jump openclash_wan_input
        iifname "lo" accept comment "!fw4: Accept traffic from loopback"
        ct state established,related accept comment "!fw4: Allow inbound established and related flows"
        tcp flags syn / fin,syn,rst,ack jump syn_flood comment "!fw4: Rate limit TCP syn packets"
        iifname "br-lan" jump input_lan comment "!fw4: Handle lan IPv4/IPv6 input traffic"
        iifname "eth2" jump input_wan comment "!fw4: Handle wan IPv4/IPv6 input traffic"
    }
}
table inet fw4 {
    chain forward {
        type filter hook forward priority filter; policy drop;
        ct state established,related accept comment "!fw4: Allow forwarded established and related flows"
        iifname "br-lan" jump forward_lan comment "!fw4: Handle lan IPv4/IPv6 forward traffic"
        iifname "eth2" jump forward_wan comment "!fw4: Handle wan IPv4/IPv6 forward traffic"
        jump handle_reject
    }
}
table inet fw4 {
    chain dstnat {
        type nat hook prerouting priority dstnat; policy accept;
        ip6 daddr { 2001:4860:4860::8844, 2001:4860:4860::8888 } tcp dport 53 counter packets 0 bytes 0 accept comment "OpenClash Google DNS Hijack"
        ip daddr { 8.8.4.4, 8.8.8.8 } tcp dport 53 counter packets 0 bytes 0 redirect to :7892 comment "OpenClash Google DNS Hijack"
        iifname "br-lan" jump dstnat_lan comment "!fw4: Handle lan IPv4/IPv6 dstnat traffic"
        iifname "eth2" jump dstnat_wan comment "!fw4: Handle wan IPv4/IPv6 dstnat traffic"
        ip protocol tcp counter packets 1 bytes 40 jump openclash
    }
}
table inet fw4 {
    chain srcnat {
        type nat hook postrouting priority srcnat; policy accept;
        oifname "br-lan" jump srcnat_lan comment "!fw4: Handle lan IPv4/IPv6 srcnat traffic"
        oifname "eth2" jump srcnat_wan comment "!fw4: Handle wan IPv4/IPv6 srcnat traffic"
    }
}
table inet fw4 {
    chain nat_output {
        type nat hook output priority filter - 1; policy accept;
        ip protocol tcp counter packets 43 bytes 2580 jump openclash_output
    }
}
table inet fw4 {
    chain mangle_prerouting {
        type filter hook prerouting priority mangle; policy accept;
        ip protocol udp counter packets 1889 bytes 285739 jump openclash_mangle
        meta nfproto ipv6 counter packets 8719 bytes 1112534 jump openclash_mangle_v6
    }
}
table inet fw4 {
    chain mangle_output {
        type route hook output priority mangle; policy accept;
        meta nfproto ipv6 counter packets 14901 bytes 7014152 jump openclash_mangle_output_v6
    }
}
table inet fw4 {
    chain openclash {
        ip daddr @localnetwork counter packets 1 bytes 40 return
        tcp dport != @common_ports counter packets 0 bytes 0 return
        ip daddr @china_ip_route ip daddr != @china_ip_route_pass counter packets 0 bytes 0 return
        ip protocol tcp counter packets 0 bytes 0 redirect to :7892
    }
}
table inet fw4 {
    chain openclash_mangle {
        meta nfproto ipv4 udp sport 500 counter packets 0 bytes 0 return
        meta nfproto ipv4 udp sport 68 counter packets 0 bytes 0 return
        meta l4proto udp iifname "lo" counter packets 268 bytes 25594 return
        ip daddr @localnetwork counter packets 1615 bytes 259689 return
        udp dport 53 counter packets 0 bytes 0 return
        udp dport != @common_ports counter packets 0 bytes 0 return
        ip daddr @china_ip_route ip daddr != @china_ip_route_pass counter packets 6 bytes 456 return
        ip protocol udp counter packets 0 bytes 0 jump openclash_upnp
    }
}
table inet fw4 {
    chain openclash_output {
        ip daddr @localnetwork counter packets 0 bytes 0 return
        tcp dport != @common_ports meta skuid != 65534 counter packets 0 bytes 0 return
        meta skuid != 65534 ip daddr @china_ip_route ip daddr != @china_ip_route_pass counter packets 11 bytes 660 return
        ip protocol tcp meta skuid != 65534 counter packets 4 bytes 240 redirect to :7892
    }
}
table inet fw4 {
    chain openclash_wan_input {
        udp dport { 7874, 7890, 7891, 7892, 7893, 7895, 9090 } counter packets 0 bytes 0 reject
        tcp dport { 7874, 7890, 7891, 7892, 7893, 7895, 9090 } counter packets 0 bytes 0 reject
    }
}
table inet fw4 {
    chain openclash_mangle_v6 {
        meta nfproto ipv6 udp sport 500 counter packets 0 bytes 0 return
        meta nfproto ipv6 udp sport 546 counter packets 30 bytes 3336 return
        ip6 saddr *WAN IP*aab8:e0ff:fe00:8fff udp sport 8006 counter packets 0 bytes 0 return
        ip6 saddr *WAN IP*aab8:e0ff:fe00:8fff tcp sport 8006 counter packets 0 bytes 0 return
        ip6 daddr @localnetwork6 counter packets 8689 bytes 1109198 return
        meta nfproto ipv6 udp dport 53 counter packets 0 bytes 0 return
        meta nfproto ipv6 th dport != @common_ports counter packets 0 bytes 0 return
        ip6 daddr @china_ip6_route ip6 daddr != @china_ip6_route_pass counter packets 0 bytes 0 return
    }
}
table inet fw4 {
    chain openclash_mangle_output_v6 {
        meta nfproto ipv6 udp sport 500 counter packets 0 bytes 0 return
        meta nfproto ipv6 udp sport 546 counter packets 0 bytes 0 return
        ip6 saddr *WAN IP*aab8:e0ff:fe00:8fff udp sport 8006 counter packets 0 bytes 0 return
        ip6 saddr *WAN IP*aab8:e0ff:fe00:8fff tcp sport 8006 counter packets 0 bytes 0 return
        ip6 daddr @localnetwork6 counter packets 11355 bytes 863006 return
        meta nfproto ipv6 th dport != @common_ports meta skuid != 65534 counter packets 3373 bytes 6133507 return
        meta skuid != 65534 ip6 daddr @china_ip6_route ip6 daddr != @china_ip6_route_pass counter packets 82 bytes 9077 return
    }
}
table inet fw4 {
    chain openclash_wan6_input {
        udp dport { 7874, 7890, 7891, 7892, 7893, 7895, 9090 } counter packets 0 bytes 0 reject
        tcp dport { 7874, 7890, 7891, 7892, 7893, 7895, 9090 } counter packets 0 bytes 0 reject
    }
}

#===================== IPSET状态 =====================#

#===================== 路由表状态 =====================#

#IPv4

#route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth2
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth2
192.168.4.0     0.0.0.0         255.255.255.0   U     0      0        0 br-lan

#ip route list
default via 192.168.1.1 dev eth2 proto static src 192.168.1.99 
192.168.1.0/24 dev eth2 proto kernel scope link src 192.168.1.99 
192.168.4.0/24 dev br-lan proto kernel scope link src 192.168.4.1 

#ip rule show
0:  from all lookup local
32765:  from all fwmark 0x162 lookup 354
32766:  from all lookup main
32767:  from all lookup default

#IPv6

#route -A inet6
Kernel IPv6 routing table
Destination                                 Next Hop                                Flags Metric Ref    Use Iface
::/0                                        ::                                      U     1024   1        0 lo      
::/0                                        fe80::1                                 UG    512    2        0 eth2    
::/0                                        fe80::1                                 UG    512    4        0 eth2    
::/0                                        fe80::1                                 UG    512    1        0 eth2    
*WAN IP*:/64                     ::                                      U     256    3        0 eth2    
*WAN IP*:/64                     ::                                      !n    2147483647 2        0 lo      
240e:3ba:30d3:48c1::/64                     ::                                      U     1024   1        0 br-lan  
240e:3ba:30d3:48c1::/64                     ::                                      !n    2147483647 1        0 lo      
fe80::/64                                   ::                                      U     256    3        0 eth2    
fe80::/64                                   ::                                      U     256    2        0 br-lan  
::/0                                        ::                                      !n    -1     2        0 lo      
::1/128                                     ::                                      Un    0      5        0 lo      
*WAN IP*:/128                    ::                                      Un    0      3        0 eth2    
*WAN IP*:1/128                   ::                                      Un    0      7        0 eth2    
*WAN IP*9c8c:39ff:fe16:9353/128  ::                                      Un    0      4        0 eth2    
240e:3ba:30d3:48c1::/128                    ::                                      Un    0      3        0 br-lan  
240e:3ba:30d3:48c1::1/128                   ::                                      Un    0      5        0 br-lan  
fe80::/128                                  ::                                      Un    0      5        0 eth2    
fe80::/128                                  ::                                      Un    0      3        0 br-lan  
fe80::9c8c:39ff:fe16:9353/128               ::                                      Un    0      4        0 eth2    
fe80::b43a:d2ff:feab:d2cd/128               ::                                      Un    0      4        0 br-lan  
ff00::/8                                    ::                                      U     256    3        0 eth2    
ff00::/8                                    ::                                      U     256    3        0 br-lan  
::/0                                        ::                                      !n    -1     2        0 lo      

#ip -6 route list
default from *WAN IP*:1 via fe80::1 dev eth2 proto static metric 512 pref medium
default from *WAN IP*:/64 via fe80::1 dev eth2 proto static metric 512 pref medium
default from 240e:3ba:30d3:48c1::/64 via fe80::1 dev eth2 proto static metric 512 pref medium
*WAN IP*:/64 dev eth2 proto static metric 256 pref medium
unreachable *WAN IP*:/64 dev lo proto static metric 2147483647 pref medium
240e:3ba:30d3:48c1::/64 dev br-lan proto static metric 1024 pref medium
unreachable 240e:3ba:30d3:48c1::/64 dev lo proto static metric 2147483647 pref medium
fe80::/64 dev eth2 proto kernel metric 256 pref medium
fe80::/64 dev br-lan proto kernel metric 256 pref medium

#ip -6 rule show
0:  from all lookup local
32765:  from all fwmark 0x162 lookup 354
32766:  from all lookup main
4200000000: from 240e:3ba:30d3:48c1::1/64 iif br-lan unreachable

#===================== 端口占用状态 =====================#

tcp        0      0 :::7890                 :::*                    LISTEN      11590/clash
tcp        0      0 :::7891                 :::*                    LISTEN      11590/clash
tcp        0      0 :::7892                 :::*                    LISTEN      11590/clash
tcp        0      0 :::7893                 :::*                    LISTEN      11590/clash
tcp        0      0 :::7895                 :::*                    LISTEN      11590/clash
tcp        0      0 :::9090                 :::*                    LISTEN      11590/clash
udp        0      0 :::7874                 :::*                                11590/clash
udp        0      0 :::7891                 :::*                                11590/clash
udp        0      0 :::7892                 :::*                                11590/clash
udp        0      0 :::7893                 :::*                                11590/clash
udp        0      0 :::7895                 :::*                                11590/clash

#===================== 测试本机DNS查询(www.baidu.com) =====================#

Server:     127.0.0.1
Address:    127.0.0.1:53

Non-authoritative answer:
www.baidu.com   canonical name = www.a.shifen.com
Name:   www.a.shifen.com
Address: 14.119.104.189
Name:   www.a.shifen.com
Address: 14.119.104.254

Non-authoritative answer:

#===================== 测试内核DNS查询(www.instagram.com) =====================#

Dnsmasq 当前默认 resolv 文件:/tmp/resolv.conf.d/resolv.conf.auto

#===================== /tmp/resolv.conf.d/resolv.conf.auto =====================#

# Interface LAN
nameserver 127.0.0.1
# Interface WAN
nameserver 192.168.1.1
# Interface WAN6
nameserver fe80::1%eth2

#===================== 测试本机网络连接(www.baidu.com) =====================#

HTTP/1.1 200 OK
Accept-Ranges: bytes
Cache-Control: private, no-cache, no-store, proxy-revalidate, no-transform
Connection: keep-alive
Content-Length: 277
Content-Type: text/html
Date: Sun, 08 Oct 2023 02:04:53 GMT
Etag: "575e1f6d-115"
Last-Modified: Mon, 13 Jun 2016 02:50:21 GMT
Pragma: no-cache
Server: bfe/1.0.8.18

#===================== 测试本机网络下载(raw.githubusercontent.com) =====================#

HTTP/2 404 
content-security-policy: default-src 'none'; style-src 'unsafe-inline'; sandbox
strict-transport-security: max-age=31536000
x-content-type-options: nosniff
x-frame-options: deny
x-xss-protection: 1; mode=block
content-type: text/plain; charset=utf-8
x-github-request-id: C8AC:C4937:1830DE:1F282B:65220E34
accept-ranges: bytes
date: Sun, 08 Oct 2023 02:04:55 GMT
via: 1.1 varnish
x-served-by: cache-syd10174-SYD
x-cache: MISS
x-cache-hits: 0
x-timer: S1696730695.172828,VS0,VE275
vary: Authorization,Accept-Encoding,Origin
access-control-allow-origin: *
cross-origin-resource-policy: cross-origin
x-fastly-request-id: 09c5f021ac4eab609c50590bfa279a0f695b9ed8
expires: Sun, 08 Oct 2023 02:09:55 GMT
source-age: 0
content-length: 14

#===================== 最近运行日志(自动切换为Debug模式) =====================#

01:31:16 INF [Config] initial compatible provider name=🌐 国际网站
01:31:16 INF [Config] initial compatible provider name=🎬 国际流媒体
01:31:16 INF [Config] initial compatible provider name=🎬 大陆流媒体
01:31:16 INF [Config] initial rule provider name=Global
01:31:16 INF [Config] initial rule provider name=China
01:31:16 INF [Config] initial rule provider name=ChinaIP
01:31:16 INF [Config] initial rule provider name=Unbreak
01:31:16 INF [Config] initial rule provider name=Streaming
01:31:16 INF [Config] initial rule provider name=StreamingSE
01:31:16 INF [Config] initial rule provider name=StreamingCN
01:31:16 INF [Config] initial rule provider name=Steam
2023-10-08 09:31:16 configuration file【/etc/openclash/config/东方.yaml】test is successful
2023-10-08 09:31:16 Config File Test Successful, Check If There is Any Update...
2023-10-08 09:31:16 Config File【东方】Are Updates, Start Replacing...
2023-10-08 09:31:16 Config File【东方】Update Successful!
2023-10-08 09:31:16 OpenClash Restart...
2023-10-08 09:31:16 OpenClash Stoping...
2023-10-08 09:31:16 Step 1: Backup The Current Groups State...
2023-10-08 09:31:16 Step 2: Delete OpenClash Firewall Rules...
2023-10-08 09:31:17 Step 3: Close The OpenClash Daemons...
2023-10-08 09:31:17 Step 4: Close The Clash Core Process...
2023-10-08 09:31:17 Step 5: Restart Dnsmasq...
2023-10-08 09:31:17 Step 6: Delete OpenClash Residue File...
2023-10-08 09:31:17 OpenClash Start Running...
2023-10-08 09:31:17 Step 1: Get The Configuration...
2023-10-08 09:31:17 Step 2: Check The Components...
2023-10-08 09:31:17 Tip: Because of the file【 /etc/openclash/config/东方.yaml 】modificated, Pause quick start...
2023-10-08 09:31:17 Step 3: Modify The Config File...
2023-10-08 09:31:17 Tip: You have seted the authentication of SOCKS5/HTTP(S) proxy with【Clash:lSGfhQb4】
2023-10-08 09:31:17 Tip: Start Running Custom Overwrite Scripts...
2023-10-08 09:31:17 Step 4: Start Running The Clash Core...
2023-10-08 09:31:17 Tip: Detected The Exclusive Function of The TUN Core, Use TUN Core to Start...
2023-10-08 09:31:17 Test The Config File First...
01:31:18 INF [Config] initial compatible provider name=🎬 国际流媒体
01:31:18 INF [Config] initial compatible provider name=🎬 大陆流媒体国际版
01:31:18 INF [Config] initial compatible provider name=➡️ 直接连接
01:31:18 INF [Config] initial compatible provider name=🏠 大陆流量
01:31:18 INF [Config] initial compatible provider name=🏠 大陆网站
01:31:18 INF [Config] initial compatible provider name=🚥 其他流量
01:31:18 INF [Config] initial compatible provider name=🌐 国际网站
01:31:18 INF [Config] initial compatible provider name=🎮 Steam
01:31:18 INF [Config] initial compatible provider name=🎬 大陆流媒体
01:31:18 INF [Config] initial compatible provider name=♻️ 故障切换
01:31:18 INF [Config] initial compatible provider name=🌐 国外流量
01:31:18 INF [Config] initial rule provider name=Steam
01:31:18 INF [Config] initial rule provider name=Global
01:31:18 INF [Config] initial rule provider name=China
01:31:18 INF [Config] initial rule provider name=ChinaIP
01:31:18 INF [Config] initial rule provider name=Unbreak
01:31:18 INF [Config] initial rule provider name=Streaming
01:31:18 INF [Config] initial rule provider name=StreamingSE
01:31:18 INF [Config] initial rule provider name=StreamingCN
2023-10-08 09:31:18 configuration file【/etc/openclash/东方.yaml】test is successful
2023-10-08 09:31:19 Step 5: Check The Core Status...
01:31:19 INF [Config] initial compatible provider name=🏠 大陆网站
01:31:19 INF [Config] initial compatible provider name=➡️ 直接连接
01:31:19 INF [Config] initial compatible provider name=🎮 Steam
01:31:19 INF [Config] initial compatible provider name=🎬 国际流媒体
01:31:19 INF [Config] initial compatible provider name=🚥 其他流量
01:31:19 INF [Config] initial compatible provider name=🌐 国际网站
01:31:19 INF [Config] initial compatible provider name=🎬 大陆流媒体国际版
01:31:19 INF [Config] initial compatible provider name=♻️ 故障切换
01:31:19 INF [Config] initial compatible provider name=🌐 国外流量
01:31:19 INF [Config] initial compatible provider name=🏠 大陆流量
01:31:19 INF [Config] initial compatible provider name=🎬 大陆流媒体
01:31:19 INF [Config] initial rule provider name=StreamingSE
01:31:19 INF [Config] initial rule provider name=StreamingCN
01:31:19 INF [Config] initial rule provider name=Steam
01:31:19 INF [Config] initial rule provider name=Global
01:31:19 INF [Config] initial rule provider name=China
01:31:19 INF [Config] initial rule provider name=ChinaIP
01:31:19 INF [Config] initial rule provider name=Unbreak
01:31:19 INF [Config] initial rule provider name=Streaming
01:31:19 INF [Auth] config updated
01:31:19 INF [DNS] server listening addr=[::]:7874
01:31:19 INF inbound create success inbound=http addr=:7890 network=tcp
01:31:19 INF [API] listening addr=[::]:9090
01:31:19 INF inbound create success inbound=socks addr=:7891 network=tcp
01:31:19 INF inbound create success inbound=socks addr=:7891 network=udp
01:31:19 INF inbound create success inbound=redir addr=:7892 network=tcp
01:31:19 INF inbound create success inbound=redir addr=:7892 network=udp
01:31:19 INF inbound create success inbound=tproxy addr=:7895 network=tcp
01:31:19 INF inbound create success inbound=tproxy addr=:7895 network=udp
01:31:19 INF inbound create success inbound=mixed addr=:7893 network=tcp
01:31:19 INF inbound create success inbound=mixed addr=:7893 network=udp
2023-10-08 09:31:22 Step 6: Wait For The File Downloading...
2023-10-08 09:31:22 Step 7: Set Firewall Rules...
2023-10-08 09:31:22 Warning: Dnsmasq not Support nftset, Use ipset...
2023-10-08 09:31:22 Tip: DNS Hijacking is Disabled...
2023-10-08 09:31:22 Tip: IPv6 Proxy Mode is TProxy...
2023-10-08 09:31:22 Tip: Firewall4 was Detected, Use NFTABLE Rules...
2023-10-08 09:31:24 Tip: Start Add Port Bypassing Rules For Firewall Redirect and Firewall Rules...
2023-10-08 09:31:24 Tip: Start Add Custom Firewall Rules...
2023-10-08 09:31:24 Step 8: Restart Dnsmasq...
2023-10-08 09:31:24 Step 9: Add Cron Rules, Start Daemons...
2023-10-08 09:31:24 OpenClash Start Successful!
02:03:19 INF [TCP] connected lAddr=192.168.1.99:35194 rAddr=raw.githubusercontent.com:443 mode=rule rule=DomainSuffix(githubusercontent.com) proxy=🌐 国际网站[🇭🇰 香港 08 移动/深港专线(2倍率)] ruleGroup=Global
02:03:29 INF [TCP] connected lAddr=192.168.1.99:42594 rAddr=api.touhou.center:443 mode=rule rule=Match() proxy=🚥 其他流量[🇭🇰 香港 08 移动/深港专线(2倍率)]
02:03:29 INF [TCP] connected lAddr=192.168.1.99:42610 rAddr=api.touhou.center:443 mode=rule rule=Match() proxy=🚥 其他流量[🇭🇰 香港 08 移动/深港专线(2倍率)]
02:03:40 INF [TCP] connected lAddr=192.168.1.99:45532 rAddr=raw.githubusercontent.com:443 mode=rule rule=DomainSuffix(githubusercontent.com) proxy=🌐 国际网站[🇭🇰 香港 08 移动/深港专线(2倍率)] ruleGroup=Global

#===================== 最近运行日志获取完成(自动切换为silent模式) =====================#

#===================== 活动连接信息 =====================#

OpenClash Config

No response

Expected Behavior

在运行状态面板里可以正常切换运行模式

Screenshots

No response

vernesong commented 1 year ago

切换什么模式,你打开浏览器F12看下连接页面看报错

LovesAsuna commented 1 year ago

这里其实是指会固定启动时的模式,无论切换成什么模式都一样。

  1. 比如现在是rule image
  2. 然后切换direct,发一个请求 image 没有报错
  3. 点确定
  4. 391e27f061dadaabedf0f42ca1257207
  5. 之后再次再次获取到的模式还是rule image
vernesong commented 1 year ago

你的日志显示有两个内核在运行

LovesAsuna commented 1 year ago

这个可能不是导致问题产生的原因,我拿了现在的日志并在上面更新了,上面是只有一个pid的,即使这样问题还是存在

vernesong commented 1 year ago

那就是内核报错了啊,你看switch请求返回的的什么内容

LovesAsuna commented 1 year ago

image 我理解没错误就是正常吧

vernesong commented 1 year ago

原因不明,请求都正常

LovesAsuna commented 1 year ago

我试过重装openwrt再装插件也是这样的情况

LovesAsuna commented 1 year ago

另外内核也是core分支的master里面的每一个内核都是最新

won13 commented 1 year ago

我和楼主也有同样的问题。之前有的版本好像可以直接从运行状态面板里一次性直接设置成功,不然每次都要从插件设置里面设置后重新启动内核才能真正的修改掉代理的状态。这样很不方便。有时候想改成直连就要等一小段时间。不清除有没有懂的大佬可以解答这个问题

github-actions[bot] commented 11 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days

LovesAsuna commented 9 months ago

翻了一下源码大概知道是什么问题了,通过daip方法拿到的ip会是这样的 image ,这就导致了切换模式( image )和获取模式(同上,空结果,所以不报错)都有问题 @vernesong 辛苦看看是不是有更好的办法来获取ip?

vernesong commented 9 months ago

哪个命令

LovesAsuna commented 9 months ago

命令

switch_rule_mode

vernesong commented 9 months ago

你这个ip是哪个命令的结果

LovesAsuna commented 9 months ago

image image

LovesAsuna commented 9 months ago

我研究了一下是这里获取本地lan接口的时候,uci这里的LAN大概是跟着用户走的,如果用户不用小写或者其他名称可能就拿不到了,要写uci -p /tmp/state get network.LAN.ifname image

vernesong commented 8 months ago

没法预测这个改动

garryshield commented 7 months ago

/etc/config/network 中修改为小写 config interface 'lan' service network reload 重启下显示就正常了

LovesAsuna commented 7 months ago

/etc/config/network 中修改为小写 config interface 'lan' service network reload 重启下显示就正常了

话是这样,当我就是刻意用的大写的

vernesong commented 7 months ago

所有有没有办法获取这个名称?