diff --git a/PVE初始化配置.md b/PVE初始化配置.md index c36156d..5e8df8e 100644 --- a/PVE初始化配置.md +++ b/PVE初始化配置.md @@ -75,7 +75,7 @@ deb https://mirrors.ustc.edu.cn/debian-security/ bullseye-security main contrib 可以看到,PVE 的系统源和 Debian 完整源的差异在于 “non-free” 和 “bullseye-backports”。 -如果小伙伴在一些软件或者驱动(比如闭源 GPU 驱动)上遇到问题,可以尝试将PVE的系统源替换成Debian的完整源来尝试解决问题。 +如果小伙伴在一些软件或者驱动(比如闭源 GPU 驱动)上遇到问题,可以尝试将 PVE 的系统源替换成 Debian 的完整源来尝试解决问题。 ### 1.2.PVE 订阅源替换 @@ -93,7 +93,9 @@ cd /etc/apt/sources.list.d rm -rvf *.list ``` -创建PVE免费源: +创建PVE免费源: + + **注意:该命令为两行,在输入时请逐行输入并回车执行** ```bash ## 创建PVE免费源 @@ -122,4 +124,70 @@ deb https://mirrors.ustc.edu.cn/proxmox/debian/pve bullseye pve-no-subscription 如果需要使用 Proxmox 网页端下载 CT Templates,可以替换 CT Templates 的源。 -该功能我未使用,因此只做记录: \ No newline at end of file +该功能我未使用,因此只做记录: + +```bash +## 替换 CT Templates 源 + +cp /usr/share/perl5/PVE/APLInfo.pm /usr/share/perl5/PVE/APLInfo.pm.bak + +sed -i 's|http://download.proxmox.com|https://mirrors.ustc.edu.cn/proxmox|g' /usr/share/perl5/PVE/APLInfo.pm + +``` + +### 1.4.替换后操作 + +更换完成系统源之后,需要更新系统源的同步: + +```bash +## 清理 +apt clean && apt autoclean + +## 同步 +apt update +``` + +考虑到“离线”安装时无法同步系统源,因此该步骤可以等到 PVE 中安装好了 RouterOS 软路由或其他路由系统并正确连接 Internet 后再执行。 + +或者家庭网络环境中还有一个 172.16.1.0/24 网段的,已经连接 Internet 的路由器 A。将路由器 A 的LAN 口与 PVE 的管理网口连接,此时 PVE 可访问外网。 + + +## 2.安装必要软件 + +安装软件前,同样要让 PVE 能够访问外网。 + +```bash +## 同步镜像仓库 +apt update + +## 安装系统软件 +apt install htop lm-sensors neofetch fail2ban vim tmux unattended-upgrades powermgmt-base + +## 安装网络工具 +apt install iperf iperf3 iftop net-tools ethtool + +## 安装CPU调度调整工具 +apt install cpufrequtils +``` + +其中 “fail2ban” 和 “unattended-upgrades” 为两个服务,后续会对其进行配置。 + +“cpufrequtils” 为 CPU 调度器的配置工具,后续会对 CPU 调度算法进行调整。 + + +## 3.配置PVE网桥和管理网口 + +设置电脑的 IP 地址为静态 IP ,IP 地址段与 PVE 的 IP 地址段保持一致。 + +用网线将电脑的网口与 PVE 的管理网口,此时应该为编号最小的第一个网口,相连接。 + +访问 PVE 的 WEB 管理界面,对 PVE 的网络进行一些调整。 + +![PVE网络规划](img/pve_net_schematization.png) + +在设置 PVE 的网络之前,需要对网络内部结构做一个规划。 + +在前篇的网络地址段规划时,我们有如下规划内容: +- PVE IP:172.16.1.250/24 +- PVE 网关:172.16.1.1 +- PVE DNS:172.16.1.1 \ No newline at end of file diff --git a/img/pve_net_schematization.png b/img/pve_net_schematization.png new file mode 100644 index 0000000..e2f6cef Binary files /dev/null and b/img/pve_net_schematization.png differ