红米AX6000安装ShellClash
编辑概述
常规的路由爬墙分为软路由和硬路由两种,软路由即通过软件分流的方式,硬路由即通过路由器本身分流。还有一种旁路由,用的人比较少,原理是以已接入外网的设备作为网关。我采用的是硬路由的方式,路由器是经典的红米 AX6000
安装 ShellClash
的方式。
由于我的操作已经是 2022 年的事了,本文仅以回忆的方式介绍过程,也许会有部分错误。
固件等级设置
- 登陆小米路由器的后台。依次点击常用设置-系统状态,检查路由器的系统版本是否为1.0.67版。
- 若路由器当前版本低于1.0.67版,请将 1.0.67 版固件上传至设备,进行手动升级。
- 若路由器当前版本高于1.0.67版,系统将提示无法降级,你可以使用官方的小米路由器修复工具完成降级。
固化telnet
-
登陆路由器后台,输入密码后将 url 中的 token 部分复制粘贴出来,作为备用。
作为范例:http://192.168.31.1/cgi-bin/luci/;stok=9e97ee2a38b1d1ef8af213367a1667b6/web/home#router
stok
后面的一串字符串9e97ee2a38b1d1ef8af213367a1667b6
即token
值。 -
开启设备 telnet
http://192.168.31.1/cgi-bin/luci/;stok={token}/api/misystem/set_sys_time?timezone=%20%27%20%3B%20zz%3D%24%28dd%20if%3D%2Fdev%2Fzero%20bs%3D1%20count%3D2%202%3E%2Fdev%2Fnull%29%20%3B%20printf%20%27%A5%5A%25c%25c%27%20%24zz%20%24zz%20%7C%20mtd%20write%20-%20crash%20%3B%20
将上述链接中的
{token}
替换为步骤 1 的token
值,即9e97ee2a38b1d1ef8af213367a1667b6
。然后将该链接复制进浏览器并访问。预期结果:
{"message": "connect success!", "code": "0"}
-
通过浏览器请求重启路由器
http://192.168.31.1/cgi-bin/luci/;stok={token}/api/misystem/set_sys_time?timezone=%20%27%20%3b%20reboot%20%3b%20
依然是将
token
替换成步骤 1 的token
值,然后复制该链接进浏览器并访问。此时路由器将重启,等待数分钟至路由器重启完成。 -
设置telnet永久开启
重新登陆后台,并按照步骤 1 的方式重新获取新的
token
。http://192.168.31.1/cgi-bin/luci/;stok={token}/api/misystem/set_sys_time?timezone=%20%27%20%3B%20bdata%20set%20telnet_en%3D1%20%3B%20bdata%20set%20ssh_en%3D1%20%3B%20bdata%20set%20uart_en%3D1%20%3B%20bdata%20commit%20%3B%20
将获取的
token
值替换进链接对应字段,复制该链接并在浏览器中请求。同样的,预期结果为{"code": "0"}
。 -
重启路由器
以步骤 3 相同的方式请求重启路由器。
开启及固化SSH
下载软件 Termius
,以支持后续的 telnet
及 SSH
连接。
-
通过 telnet 连接路由器。打开 Termius,点击
New Host
,Address 填写:192.168.31.1,SSH:取消勾选,Telnet:勾选,无需填写账号密码。点击向右箭头登陆。 -
在命令行中粘贴以下命令用以打开
SSH
功能。echo -e 'admin\nadmin' | passwd root nvram set ssh_en=1 nvram set telnet_en=1 nvram set uart_en=1 nvram set boot_wait=on nvram commit sed -i 's/channel=.*/channel="debug"/g' /etc/init.d/dropbear /etc/init.d/dropbear restart mkdir /data/auto_ssh cd /data/auto_ssh curl -O https://fastly.jsdelivr.net/gh/lemoeo/AX6S@main/auto_ssh.sh chmod +x auto_ssh.sh uci set firewall.auto_ssh=include uci set firewall.auto_ssh.type='script' uci set firewall.auto_ssh.path='/data/auto_ssh/auto_ssh.sh' uci set firewall.auto_ssh.enabled='1' uci commit firewall uci set system.@system[0].timezone='CST-8' uci set system.@system[0].webtimezone='CST-8' uci set system.@system[0].timezoneindex='2.84' uci commit mtd erase crash reboot
这将会把设备的 SSH 密码设置为admin,用户名设置为root,并永久开启 SSH 端口。同时,还会将您的设备从开发模式切换成常规模式。待设备重启完成,就可以使用该用户名密码连接设备的 SSH 了。
安装ShellClash
-
在
Termius
中重新选择New Host
,Address 填写:192.168.31.1,选择 SSH 连接,用户名填写:root,Password 填写:admin,点击连接。 -
使用以下指令安装 ShellClash。
sh -c "$(curl -kfsSl https://cdn.jsdelivr.net/gh/juewuy/ShellClash@master/install.sh)" && source /etc/profile &> /dev/nul
若无法连接,可替换成以下备用源:
// fastgit.org export url='https://raw.fastgit.org/juewuy/ShellClash/master' && sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null // jsDelivrCDN export url='https://fastly.jsdelivr.net/gh/juewuy/ShellClash@master' && sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null // GitHub export url='https://raw.githubusercontent.com/juewuy/ShellClash/master' && sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null // 作者私人源 export url='https://shellclash.ga' && sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null
根据列出的选项自行选择安装版本及地址等。
-
安装成功后通过
clash
命令启动程序面板。
一些建议
- 运行模式选择
TProxy
模式,建议只代理常用端口。 - 导入配置文件最好自定义,适配自己的规则。
- 提高安全性可学习配置 DNS分流。
- 在更新/卸载板块可以下载
yacd
面板,更加方便节点和规则管理。
- 0
- 0
-
分享