一劳永逸,利用openwrt自动优选IP并同步到CF,每天用的都是最优IP

 

openwrt自动优选IP并同步到cloudflare

 1.代码包下载

https://github.com/frankiejun/cvwt/releases/download/V1.0.2/openwrt.tar.gz

(目前版本是v1.0.2,看到有新的下载最新即可)


2.把压缩包传到openwrt并解压

tar -zcf openwrt.tar.gz

unzip openwrt.zip

zip使用 unzip 


3.执行预安装

sh cf_RE.sh


4.配置config.yaml

注意hostname(域名)和CCODE(国家代码)的位置要对应好。

检查yaml格式是否正确

https://www.yamllint.com/

 如果缺yq则进入  https://github.com/mikefarah/yq/releases/

手动下载yq_linux_arm64


然后拷贝到/usr/bin/ 目录下 

chmod +x /usr/bin/yq


然后执行yq,看显示什么

5.执行优选IP


chmod +x start.sh

chmod +x CloudflareST

./start.sh config.yaml


https://github.com/XIU2/CloudflareSpeedTest

CloudflareST 到这里下载最新 

LinuxARM v864 位cfst_linux_arm64.tar.gz



6.配置定时执行

crontab -e

按i开始编辑,按ESC键 准备输入命令  保存:wq  丢弃修改:q!   退出:q

注意黄色部分替换你脚本所在目录的全路径

0 3 * * * cd /git/cvwt/script/openwrt  && ./start.sh ./config.yaml > a.log 2>&1 &

如果不需要日志:

0 3 * * * cd /git/cvwt/script/openwrt  && ./start.sh ./config.yaml 



cd /updateip/openwrt/  && ./start.sh ./config.yaml 

cd /openwrt/  && ./start.sh ./config.yaml


cd /openwrt/openwrt/ && ./start.sh ./config.yaml

cd /opencfwrt/openwrt/  && ./start.sh ./config.yaml

0 3 * * * cd /openwrt/openwrt/  && ./start.sh ./config.yaml 

相关视频:





https://github.com/frankiejun/cvwt/releases
https://frankiejun.blogspot.com/2024/04/openwrtipcloudflare.html

查看openwrt的架构

opkg print-architecture


或者

很多朋友在安装插件时不知道怎样选择CPU架构,这里教大家一个简单方法

首先,你需要具备SSH登录路由器的基本知识,不知道的自行百度
登录路由器后,执行下面的命令
cat /etc/os-release |grep ARCH

命令返回格式如下,红框标示的内容即为CPU架构


openwrt软件包命名一般是包名+版本号+CPU架构,例如


大家选择插件安装时,通过包名即可判断是否适合自己的机器



Comments