PVE硬件配置

记得分配2个网卡
2024-10-13T17:37:07.png

防火墙

vi /etc/config/firewall 把WAN口相关的选项都改成 'ACCEPT' 打开端口访问,以便web界面配置.

pve虚拟机导入磁盘

使用 qm disk import 导入openwrt.img

echo "先删除磁盘"
mkdir -p /home/aico/lean_op
cd /home/aico/lean_op
rm openwrt-x86-64-generic-squashfs-combined-*
wget http://xxx:35244/d/189-30G/public/openwrt/x86/openwrt-x86-64-generic-squashfs-combined-efi.img.gz
gzip -d openwrt-x86-64-generic-squashfs-combined-efi.img.gz
qm disk import 106 openwrt-x86-64-generic-squashfs-combined-efi.img local-lvm
 
echo "done"
rm openwrt-x86-64-generic-squashfs-combined-*
echo "pve添加磁盘->设置磁盘为启动"
echo "vi /etc/config/firewall wan口accept"

编译openwrt

cat Openwrt_DailyBuider.sh

while true
do
export FORCE_UNSAFE_CONFIGURE=1
echo "begin build the openwrt"
cd /home/lede
> nohup.out
echo "Start to build the openwrt at $(date)"
./scripts/feeds update -a
./scripts/feeds install -a
make defconfig
make -j$(nproc) V=s

cp nohup.out  /home/lede/bin/targets/x86/64/build_info.log

cd /home/lede/bin/targets/x86/64

        for file in *; do
                  if [ -f "$file" ]; then
                        ##upload all files
                        curl -v -T  "$file" http://cmd.xxxx.vip:35244/dav/openwrt/x86/ -u share:share
                  fi
        done

sleep 86400

done