1. 安装Debian11

2. 配置环境并安装proxmox

(1)配置hosts

假设你的公网IP为1.1.1.1,主机名为hz,则/etc/hosts文件这样配置:

1
2
3
4
5
6
7
127.0.0.1       localhost
1.1.1.1 hz.proxmox.com hz

# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

验证:

1
2
3
hostname --ip-address
#应返回
1.1.1.1

(2)安装prxomox

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
echo "deb [arch=amd64] http://download.proxmox.com/debian/pve bullseye pve-no-subscription" > /etc/apt/sources.list.d/pve-install-repo.list

wget https://enterprise.proxmox.com/debian/proxmox-release-bullseye.gpg \
-O /etc/apt/trusted.gpg.d/proxmox-release-bullseye.gpg

apt update && apt full-upgrade

apt install proxmox-ve postfix open-iscsi

systemctl reboot

apt remove linux-image-amd64 'linux-image-5.10*'

update-grub

apt remove os-prober

完成后浏览器打开 https://your-ip:8006 ,注意是https!天坑,http会连接不上!

3.配置母鸡网络(配置不当会收到network abuse邮件)

(1)配置网卡:(/etc/network/interfaces)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
### Hetzner Online GmbH installimage

source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback
iface lo inet6 loopback

auto enp41s0

#注意更改enp41s0为自己网卡名称
iface enp41s0 inet manual
# post-up /sbin/ethtool -K enp41s0 tx off rx off
iface enp41s0 inet6 manual

auto vmbr0
iface vmbr0 inet static
address 1.2.3.10
#母鸡ipv4
netmask 255.255.255.192

#母鸡ipv4子网掩码
gateway 1.2.3.4

#母鸡ipv4网关
pointopoint 1.2.3.4

#同上ipv4网关
hwaddress ether aa:bb:cc:dd:ee:ff

#网卡mac地址
bridge_ports enp41s0
bridge_stp off
bridge_fd 0
bridge_maxwait 0
# post-up /sbin/ethtool -K vmbr0 tx off rx off

iface vmbr0 inet6 static
address 2a01:abc:abc:abc::2

#母鸡ipv6
netmask 64
gateway fe80::1

#母鸡ipv6网关
bridge_ports enp41s0
bridge_stp off
bridge_fd 0
up ip -6 route del 2a01:abc:abc:abc::/64 dev vmbr0

#上面为母鸡ipv6网段

auto vmbr1
iface vmbr1 inet static
address 192.168.1.1
netmask 255.255.255.0
bridge_ports none
bridge_stp off
bridge_fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '192.168.1.0/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '192.168.1.0/24' -o vmbr0 -j MASQUERADE

iface vmbr1 inet6 static
address 2a01:abc:abc:abc::3/64

#母鸡另一个ipv6地址,作为小鸡ipv6网关
#gateway fe80::1
bridge_ports none
bridge_stp off
bridge_fd 0
up ip -6 route add 2a01:abc:abc:abc::/64 dev vmbr1
post-down ip -6 route del 2a01:abc:abc:abc::/64 dev vmbr1
#上面为母鸡ipv6网段

(2)开启相关转发(/etc/sysctl.conf)

1
2
3
4
5
6
7
8
net.ipv4.ip_forward=1
net.ipv6.conf.all.accept_dad = 1
net.ipv6.conf.all.accept_ra = 0
net.ipv6.conf.all.accept_redirects = 1
net.ipv6.conf.all.accept_source_route = 0
net.ipv6.conf.all.autoconf = 0
net.ipv6.conf.all.disable_ipv6 = 0
net.ipv6.conf.all.forwarding=1

警告!如果配置不对,重启网络大概率导致母鸡失联!只能去后台发工单开机kvm控制台修改文件!

备份!

备份!

备份!

1
2
3
sysctl -p

/etc/init.d/networking restart

如果等一段时间母鸡没有失联,那么恭喜你可以继续了!

验证:

1
ip -6 route

应该长这样:

1
2
3
4
5
6
::1 dev lo proto kernel metric 256 pref medium
2a01:abc:abc:abc::/64 dev vmbr1 proto kernel metric 256 linkdown pref medium
2a01:abc:abc:abc::/64 dev vmbr1 metric 1024 linkdown pref medium
fe80::/64 dev vmbr0 proto kernel metric 256 pref medium
fe80::/64 dev vmbr1 proto kernel metric 256 linkdown pref medium
default via fe80::1 dev vmbr0 metric 1024 onlink pref medium

4.小鸡网卡配置示例

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
auto ens18
# The primary network interface
allow-hotplug ens18
iface ens18 inet static
address 192.168.1.110/24
gateway 192.168.1.1
dns-nameservers 8.8.8.8

iface ens18 inet6 static
address 2a01:abc:abc:abc::102
netmask 64
gateway 2a01:abc:abc:abc::3
autoconf 0
dns-nameservers 2001:4860:4860::8888

5.proxmox镜像

  • KVM:(下载到如下路径即可识别)
1
/var/lib/vz/template/iso/
  • OVZ:
1
2
3
4
pveam update
pveam available
#在刚才出现的系统模板列表里找到你想要的系统替换掉下方命令中镜像文件
pveam download local debian-10.0-standard_10.0-1_amd64.tar.gz