Skip to content

OpenWrt

官网: https://openwrt.org/

https://openclash.org/#google_vignette

选择最新的下载: https://downloads.openwrt.org/releases/24.10.4/targets/x86/64/openwrt-24.10.4-x86-64-generic-ext4-combined-efi.img.gz

创建虚拟机,选择不使用任何介质,需要移除磁盘,创建好之后不要重启

终端窗口
# 102 为vm-id
qm disk import 102 /var/lib/vz/template/iso/openwrt-24.10.4-x86-64-generic-ext4-combined-efi.img local-lvm --format raw

将硬盘给虚拟机并修改引导顺序,让硬盘优先

https://pkgs.org/download/luci-i18n-base-zh-cn

https://github.com/jerrykuku/luci-theme-argon/blob/master/README_ZH.md

https://openclash.org https://github.com/vernesong/OpenClash

终端窗口
# 更新
opkg update
# 安装依赖
opkg install bash iptables dnsmasq-full curl ca-bundle ipset ip-full iptables-mod-tproxy iptables-mod-extra ruby ruby-yaml kmod-tun kmod-inet-diag unzip luci-compat luci luci-base
opkg install /tmp/openclash.ipk

如果有以下报错:

终端窗口
Installing luci-app-openclash (0.47.028) to root...
Installing dnsmasq-full (2.90-r4) to root...
Downloading https://downloads.openwrt.org/releases/24.10.4/packages/x86_64/base/dnsmasq-full_2.90-r4_x86_64.ipk
Collected errors:
* check_data_file_clashes: Package dnsmasq-full wants to install file /etc/hotplug.d/ntp/25-dnsmasqsec
But that file is already provided by package * dnsmasq
* check_data_file_clashes: Package dnsmasq-full wants to install file /etc/init.d/dnsmasq
But that file is already provided by package * dnsmasq
* check_data_file_clashes: Package dnsmasq-full wants to install file /usr/lib/dnsmasq/dhcp-script.sh
But that file is already provided by package * dnsmasq
* check_data_file_clashes: Package dnsmasq-full wants to install file /usr/sbin/dnsmasq
But that file is already provided by package * dnsmasq
* check_data_file_clashes: Package dnsmasq-full wants to install file /usr/share/acl.d/dnsmasq_acl.json
But that file is already provided by package * dnsmasq
* check_data_file_clashes: Package dnsmasq-full wants to install file /usr/share/dnsmasq/dhcpbogushostname.conf
But that file is already provided by package * dnsmasq
* check_data_file_clashes: Package dnsmasq-full wants to install file /usr/share/dnsmasq/rfc6761.conf
But that file is already provided by package * dnsmasq
* opkg_install_cmd: Cannot install package luci-app-openclash.

解决方法:

终端窗口
# 先移除 dnsmasq,立即安装 dnsmasq-full(推荐)
opkg remove dnsmasq && opkg install dnsmasq-full
# 安装完之后,再执行
opkg install /tmp/openclash.ipk
  • 可以在openwrt内核中使用可视化界面安装(推荐,失败了多试几次)
  • 也可以上传https://github.com/MetaCubeX/mihomo/releases clash内核。如果不使用命令行上传,可以借用openwrt上传pkg的按钮来,上传后使用shell将内核copy到clash目录即可,并修改一个名字即可。