人嘛 总有些奇奇怪怪的需求

准备工作

先确认主地址并设置 host

假设ip为 192.168.2.1
主机名为 pve

host 内容大概为

1
2
3
4
5
127.0.0.1       localhost.localdomain localhost
192.168.2.1 pve
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

可输入 hostname --ip-address 验证

更新软件源

trixie

清空 /etc/apt/sources.list 文件

新建以下源

/etc/apt/sources.list.d/debian.sources

1
2
3
4
5
6
7
8
9
10
11
Types: deb
URIs: http://deb.debian.org/debian/
Suites: trixie trixie-updates
Components: main contrib non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

Types: deb
URIs: http://security.debian.org/debian-security/
Suites: trixie-security
Components: main contrib non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

/etc/apt/sources.list.d/proxmox.sources

1
2
3
4
5
Types: deb
URIs: http://download.proxmox.com/debian/pve
Suites: trixie
Components: pve-no-subscription
Signed-By: /usr/share/keyrings/proxmox-release-trixie.gpg

下载pve的仓库密钥

1
wget https://enterprise.proxmox.com/debian/proxmox-release-trixie.gpg -O /usr/share/keyrings/proxmox-release-trixie.gpg

开始转换

1
2
apt update && apt full-upgrade
apt install proxmox-default-kernel

重启

1
apt install proxmox-ve postfix open-iscsi chrony

再移除 旧内核

1
apt purge linux-image-amd64 'linux-image-6.1*'

后续配置

ipv4 网络启用 nat 模式

重要的在于 iptables

/etc/network/interfaces

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
auto lo
iface lo inet loopback

auto enp1s0f0
iface enp1s0f0 inet static
address 192.168.1.2/32
gateway 192.168.1.1
dns-nameservers 1.1.1.1
dns-nameservers 8.8.8.8

iface enp1s0f1 inet manual

auto nat
iface nat inet static
address 192.168.2.1/24
bridge-ports none
bridge-stp off
bridge-fd 0
post-up iptables -t nat -A POSTROUTING -s '192.168.2.1/24' -o enp1s0f0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '192.168.2.1/24' -o enp1s0f0 -j MASQUERADE

ipv6 启用 dhcp 模式

其他

如果开始的 host 设置失败 将会导致 pveweb 无法访问

1
2
systemctl restart pve-cluster
pvecm updatecerts --force

备份与迁移

在页面上备份后 直接将 /var/lib/vz/dump/ 目录打包带走就行

参考地址