Skip to content
/ pve Public

PVE一键换源、去订阅弹窗等;LXC容器OpenWrt自动安装、更新

License

Notifications You must be signed in to change notification settings

zanev24m/pve

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

安装curl、wget、squashfs-tools工具

使用root用户登录,执行以下命令

apt update && apt install -y curl wget squashfs-tools

设置语言包

命令行

dpkg-reconfigure locales → [ * ] en_US.UF8

文件编译

/etc/locale.gen去除en_US.UF8前面#
运行locale-gen

重启PVE即可

PVE一键换源、去订阅等

以下请在PVE命令行中运行!

  • PVE中直接使用pve命令

国内网络

wget https://ghproxy.com/https://raw.githubusercontent.com/roacn/pve/main/pve.sh -O /usr/sbin/pve && chmod +x /usr/sbin/pve

国外网络

wget https://raw.githubusercontent.com/roacn/pve/main/pve.sh -O /usr/sbin/pve && chmod +x /usr/sbin/pve

即可在PVE命令行中使用pve运行脚本

  • 直接运行

国内网络

bash -c  "$(curl -fsSL https://ghproxy.com/https://raw.githubusercontent.com/roacn/pve/main/pve.sh)"

国外网络

bash -c  "$(curl -fsSL https://raw.githubusercontent.com/roacn/pve/main/pve.sh)"

pve.png

Fullconenat安装

以下请在PVE命令行中运行!

为LXC容器的OpenWrt提供FullCone-NAT(全锥形NAT)

  • 软件下载

netfilter-fullconenat-dkms-git

  • 软件安装

ssh至PVE,运行以下命令

apt update
apt install pve-headers-`uname -r` -y
apt install dkms -y
  • 解压netfilter-fullconenat-dkms-git.tar.gz
tar -xvf netfilter-fullconenat-dkms-git.tar.gz -C /usr/src
  • 安装netfilter-fullconenat-dkms-git.tar.gz
dkms install -m netfilter-fullconenat-dkms -v git
  • 检查是否安装成功

运行dkms status

root@pve:~# dkms status
netfilter-fullconenat-dkms, git, 5.13.19-3-pve, x86_64: installed

运行modinfo xt_FULLCONENAT

root@pve:~# modinfo xt_FULLCONENAT
filename:       /lib/modules/5.13.19-3-pve/updates/dkms/xt_FULLCONENAT.ko
alias:          ipt_FULLCONENAT
author:         Chion Tang <tech@chionlab.moe>
description:    Xtables: implementation of RFC3489 full cone NAT
license:        GPL
srcversion:     CE0EBE32D25F6F43D755D2E
depends:        x_tables,nf_nat,nf_conntrack
retpoline:      Y
name:           xt_FULLCONENAT
vermagic:       5.13.19-3-pve SMP mod_unload modversions 

出现如上信息,说明fullconenat已经安装成功,OpenWrt在防火墙内开启fullconenat,重启PVE生效。

  • 旧版内核卸载

检查已经安装的netfilter-fullconenat-dkms

root@pve:~# dkms status
netfilter-fullconenat-dkms, git, 5.10.0-11-amd64, x86_64: installed
netfilter-fullconenat-dkms, git, 5.10.0-12-amd64, x86_64: installed

卸载旧版内核netfilter-fullconenat-dkms

dkms remove netfilter-fullconenat-dkms -v <Version> -k <Kernel>
root@pve:~# dkms remove netfilter-fullconenat-dkms -v git -k 5.10.0-12-amd64

-------- Uninstall Beginning --------
Module:  netfilter-fullconenat-dkms
Version: git

Kernel:  5.10.0-12-amd64 (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

xt_FULLCONENAT.ko:

 - Uninstallation
   - Deleting from: /lib/modules/5.10.0-12-amd64/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

depmod...

DKMS: uninstall completed.

------------------------------

Deleting module version: git

completely from the DKMS tree.
------------------------------

Done.

通过以上操作/var/lib/dkms/netfilter-fullconenat-dkms/目录下的旧版netfilter-fullconenat-dkms即可卸载删除。

LXC容器OpenWrt安装、更新

以下请在PVE命令行中运行!

如果PVE网络下载固件比较慢,经常更新可把PVE的网关、DNS指向OpenWrt,懂的都懂!

  • PVE中直接使用openwrt命令运行自动安装更新脚本

国内网络

wget https://ghproxy.com/https://raw.githubusercontent.com/roacn/pve/main/openwrt.lxc.sh -O /usr/sbin/openwrt && chmod +x /usr/sbin/openwrt

国外网络

wget https://raw.githubusercontent.com/roacn/pve/main/openwrt.lxc.sh -O /usr/sbin/openwrt && chmod +x /usr/sbin/openwrt

即可在PVE命令行中使用openwrt运行脚本

  • 直接运行

国内网络

bash -c  "$(curl -fsSL https://ghproxy.com/https://raw.githubusercontent.com/roacn/pve/main/openwrt.lxc.sh)"

国外网络

bash -c  "$(curl -fsSL https://raw.githubusercontent.com/roacn/pve/main/openwrt.lxc.sh)"

openwrt11.png

openwrt12.png

openwrt13.png

openwrt2.png

openwrt31.png

openwrt32.png

openwrt4.png

openwrt5.png

About

PVE一键换源、去订阅弹窗等;LXC容器OpenWrt自动安装、更新

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages