UNRAID LXC 安装Clash.Meta

图片[1]-UNRAID LXC 安装Clash.Meta-RSG-人生观警告⚠️⚠️⚠️

请正确使用工具,网络不是法外之地,请文明正确使用工具。

教程:

UNRAID安装lxc的方法,本站很早以前就有了,这里不做过多赘述,自行跳转去安装吧。

[ri-post id=”55793″ thumb=”left”]

这里使用debian的基础镜像,来搭建clash.meta,其实也没别的选择,UNRAID目前的LXC只有debian是可以直接使用的,其他系统都是无网络的状态。

图片[2]-UNRAID LXC 安装Clash.Meta-RSG-人生观

图片[3]-UNRAID LXC 安装Clash.Meta-RSG-人生观

下面进行命令配置部分:

更新并安装必要的组件:

apt-get update -y && apt-get install curl wget -y

获取Clash.Meta

访问:Release v1.13.2 · MetaCubeX/Clash.Meta · GitHub获取最新版本的Clash.Meta

图片[4]-UNRAID LXC 安装Clash.Meta-RSG-人生观

lxc配置这里选择linux-amd64的包,光标在需要的版本上,右键选择复制链接,获取到下载文件的URL

cd /root ###进入路径
wget https://github.com/MetaCubeX/Clash.Meta/releases/download/v1.13.2/Clash.Meta-linux-amd64-v1.13.2.gz

解压缩

gzip -d ./Clash.Meta-linux-amd64-v1.13.2.gz

重命名

mv ./Clash.Meta-linux-amd64-v1.13.2 ./clash

配置可执行权限

chmod +x ./clash

移动到指定目录

mv ./clash /usr/bin

创建配置文件路径

mkdir -p /etc/clash

进入配置文件路径

cd /etc/clash

获取运行配置文件

wget https://file.lxg2016.com/assets/lxc/clash.meta/clash.meta.tar

解压配置

tar -xvf ./clash.meta.tar

修改config.yaml,的307行还有最后一行,将305行的订阅地址改成订阅地址的URL。

图片[5]-UNRAID LXC 安装Clash.Meta-RSG-人生观

最后一行

图片[6]-UNRAID LXC 安装Clash.Meta-RSG-人生观

复制systemctl启动配置文件

mv ./clash.service /etc/systemd/system

测试启动

systemctl start clash

使用lxc 容器ip:9090/ui 启动,查看是否可以访问到控制面板

图片[7]-UNRAID LXC 安装Clash.Meta-RSG-人生观

图片[8]-UNRAID LXC 安装Clash.Meta-RSG-人生观

进入后,查看配置信息是否正常。

图片[9]-UNRAID LXC 安装Clash.Meta-RSG-人生观

到此clash.meta就配置完成了

开机自动启动clash.meta

systemctl enable clash

配置防火墙iptables

apt-get install iptables -y

配置iptables

bash ./iptablesConfig

因为iptables重启后规则会丢失,所以需要开机重新导入规则。

apt install iptables-persistent -y

图片[10]-UNRAID LXC 安装Clash.Meta-RSG-人生观

图片[11]-UNRAID LXC 安装Clash.Meta-RSG-人生观这里第一个提示的是IPV4的iptables配置的保存,第二个是V6的,看情况进行选择,因此教程只做v4 所以V6 就选NO 不保存。

检测是否完整保存配置。

cat /etc/iptables/rules.v4

图片[12]-UNRAID LXC 安装Clash.Meta-RSG-人生观

到此,clash.meta全部配置内容就结束了,控制面板访问方式http://lxc 容器ip:9090/ui

结尾

此教程,可以搭配我之前的ROS加速教程配合使用,替换掉OP部分配置即可。如果无需特殊需求可以直接用clash.meta内置的Dns,如果需要特殊功能,比如优先V4解析等,可以考虑使用mosdns,本站也有对应的教程。

[ri-post id=”56029″ thumb=”left”][ri-post id=”54842″ thumb=”left”]

 

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 共11条

请登录后发表评论

    请登录后查看评论内容