PVE安装使用以及安装OpenWrt旁路网关
本文最后更新于 2026-04-09,文章内容可能已经过时。
本文的PVE主要用于http/socks代理以及旁路网关
1.设备信息
我的用于安装PVE的设备为e5平台。
主板为寨版x99(有毛病断了一根针脚导致内存只有两条能用)
cpu为E5-2630 v3
内存单条8G
没有显卡
硬盘为二手杂牌sata240G固态硬盘
2.PVE安装
我安装使用了Ventoy2Disk,因为不知道系统不兼容还是Ventoy的问题导致PVE安装不了8和9,只能安装7.4,但是所幸可以通过命令行升级为8.4。
安装一路默认即可没什么问题,唯一需要注意的就是ipv6没法dhcp可能没法使用。
升级时需要注释掉企业源
nano /etc/apt/sources.list
# 注释掉企业源
# deb https://enterprise.proxmox.com/debian/pve然后 apt update && apt full-upgrade 更新系统
修改 /etc/apt/sources.list 中的所有 bullseye 为 bookworm
在 /etc/apt/sources.list.d/pve-no-subscription.list 中添加 deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription
最后执行 apt update && apt full-upgrade 即可完成升级
3.PVE配置
apt和PVE的源虽然国内也可以访问,但是部分地区速度可能一言难尽。
先使用 sudo apt install apt-transport-https ca-certificates 更新证书避免出现https连接问题
使用 curl -fsSL https://mirrors.ustc.edu.cn/repogen/conf/debian-https-4-bookworm -o /etc/apt/sources.list 一键替换apt源
在 nano /etc/apt/sources.list.d/pve-enterprise.list 中添加 deb https://mirrors.ustc.edu.cn/proxmox/debian bookworm pve-no-subscription 来修改PVE源
使用 wget https://mirrors.ustc.edu.cn/proxmox/debian/proxmox-release-bookworm.gpg -O /etc/apt/trusted.gpg.d/proxmox-release-bookworm.gpg 安装PVE软件源的密钥
在 nano /etc/apt/sources.list.d/ceph.list 中添加 deb https://mirrors.ustc.edu.cn/proxmox/debian/ceph-quincy bookworm no-subscription 来替换ceph源
最后 apt update 更新即可
使用 sed -i 's|http://download.proxmox.com|https://mirrors.ustc.edu.cn/proxmox|g' /usr/share/perl5/PVE/APLInfo.pm 一键修改CT源,修改后需使用 systemctl restart pvedaemon.service 重启PVE
如果需要显示功耗占用等传感器信息可以使用 (curl -Lf -o /tmp/temp.sh https://raw.githubusercontent.com/a904055262/PVE-manager-status/main/showtempcpufreq.sh || curl -Lf -o /tmp/temp.sh https://ghproxy.com/https://raw.githubusercontent.com/a904055262/PVE-manager-status/main/showtempcpufreq.sh) && chmod +x /tmp/temp.sh && /tmp/temp.sh remod
4.安装OpenWrt
我使用的镜像为 immortalwrt 中发布的镜像,选择最新版即可如:https://downloads.immortalwrt.org/releases/24.10.5/targets/x86/64/immortalwrt-24.10.5-x86-64-generic-squashfs-combined.img.gz
下载后上传到PVE中即可。
需要注意的是安装虚拟机过程中先不要选择安装介质和硬盘,如果加了硬盘在硬件中删除即可,CD/DVD也要删除。
然后通过命令qm importdisk 虚拟机ID /var/lib/vz/template/iso/镜像名称 local-lvm 给OpenWrt装上硬盘,在硬件界面选择新增的硬盘改为sata即可,在选项中将引导顺序保留仅sata。
之后直接启动即可。
vi /etc/config/network # 修改ip为你想要的
# 记得添加网关和dns如:
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.0.11'
option gateway '192.168.0.1'
option netmask '255.255.255.0'
option ip6assign '60'
option dns '114.114.114.114'
service network restart # 重启网络由于我只是用来作为代理所以不加别的网卡。
1.安装openclash
在https://github.com/vernesong/OpenClash/releases下载最新的ipk后缀,在系统-软件包导入openclash。
如果导入成功没有显示服务的话清除cookie和缓存刷新网页即可。
不知道是不是我的问题,导入订阅难用的一批有时候可以有时候不行。
使用web ui需要去网络-防火墙-通信规则中打开9090和7893端口。

只要你前面没问题,那么这时只需要将其他设备的网关修改为OpenWrt的ip即可全部走openclash。
- 感谢你赐予我前进的力量


