针对嵌入式等无图形化界面的设备使用clash科学上网的方法
系统更新
首先更新系统软件包列表:
下载和安装 Clash
1. 创建工作目录
2. 下载 Clash
⚠️ 注意:请根据您的系统架构选择合适的版本。可以通过 uname -a
命令查看系统信息。
1
| wget https://github.com/doreamon-design/clash/releases/download/v2.0.24/clash_2.0.24_linux_amd64.tar.gz
|
3. 解压文件
1 2
| tar -zxvf clash_2.0.24_linux_amd64.tar.gz
|
4. 重命名并设置权限
1 2 3 4 5
| mv clash-linux-amd64 clash
chmod +x clash
|
配置文件设置
1. 获取配置文件
1 2
| curl -f "订阅链接" >> config.yaml
|
成功后会在当前目录生成一个 config.yaml
文件。
2. 启动 Clash
代理设置
1. 设置命令行代理
1
| export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890
|
2. 测试连接
3. 取消命令行代理
1 2
| unset http_proxy unset https_proxy
|
常见问题
- 权限问题:确保 Clash 文件具有执行权限 (
chmod +x clash
)
- 配置文件错误:检查
config.yaml
是否正确下载且格式无误
- 端口冲突:确认 7890 端口未被其他程序占用