diskutil list
卸载所有分区
diskutil unmountDisk /dev/diskX
删除 U 盘中的所有分区
sudo diskutil eraseDisk free SPACE /dev/diskX
删除U盘分区,dd写入proxmox到U盘
sudo dd if=./proxmox-ve_7.4.1.iso of=/dev/disk3 bs=1M
- 主机开机按F11 选择U盘启动,正常输入ip,netmask, gateway,dns
- 去掉登陆弹窗及优化更新源
sed -Ezi.bak "s/(Ext.Msg.show\(\{\s+title: gettext\('No valid sub)/orig_cmd\(\); void\(\{ \/\/\1/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
systemctl restart pveproxy.service
mv /etc/apt/sources.list.d/pve-enterprise.list{,-back0} -v
sed -i 's|^deb http://ftp.debian.org|deb https://mirrors.ustc.edu.cn|g' /etc/apt/sources.list
sed -i 's|^deb http://security.debian.org|deb https://mirrors.ustc.edu.cn/debian-security|g' /etc/apt/sources.list
sed -i 's|contrib$|contrib non-free|g' /etc/apt/sources.list
source /etc/os-release
echo "deb https://mirrors.ustc.edu.cn/proxmox/debian/pve $VERSION_CODENAME pve-no-subscription" > /etc/apt/sources.list.d/pve-no-subscription.list
apt update
- 配置私有dhcp池和网桥,通过nat通信
apt install net-tools vim isc-dhcp-server
cd /etc/network/
cp interfaces interfaces-back0
添加vmbr1
root@pve:~# cat /etc/network/interfaces
auto lo
iface lo inet loopback
iface enp0s31f6 inet manual
auto vmbr0
iface vmbr0 inet static
address 192.168.9.231/24
gateway 192.168.9.1
bridge-ports enp0s31f6
bridge-stp off
bridge-fd 0
auto vmbr1
iface vmbr1 inet static
address 192.168.122.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 echo 1 > /proc/sys/net/ipv4/conf/vmbr1/proxy_arp
post-up iptables -t nat -A POSTROUTING -s '192.168.122.0/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '192.168.122.0/24' -o vmbr0 -j MASQUERADE
- 配置dhcp
cp /etc/dhcp/dhcpd.conf{,-back0}
cp /etc/default/isc-dhcp-server{,-back0}
root@pve:~# cat /etc/dhcp/dhcpd.conf |egrep -v "^#|^$"
option domain-name "dh-net.in";
option domain-name-servers 119.29.29.29, 8.8.8.8;
default-lease-time 600;
max-lease-time 7200;
ddns-update-style none;
authoritative;
log-facility local7;
subnet 192.168.122.0 netmask 255.255.255.0 {
range 192.168.122.200 192.168.122.240;
option domain-name-servers 119.29.29.29, 8.8.8.8, 8.8.4.4;
option routers 192.168.122.1;
option domain-name "dh-net.in";
option broadcast-address 192.168.122.255;
option netbios-node-type 8;
get-lease-hostnames true;
use-host-decl-names true;
default-lease-time 600;
max-lease-time 7200;
interface vmbr1;
}
root@pve:~# cat /etc/default/isc-dhcp-server|egrep -v "^#|^$"
INTERFACESv4="vmbr1"
INTERFACESv6=""
- 启动服务,如果有异常自信看日志处理
systemctl restart isc-dhcp-server.service
systemctl status isc-dhcp-server.service
登陆UI ,确认生效