PVE 迁移新网络网段配置

玩机教程 > Proxmox VE/PVE (878) 2025-02-06 16:49:30

举例

 

当前网络环境

ip address : 192.168.31.119/24

gateway: 192.168.31.1

dns:192.168.31.1

 

目标网络环境

ip address : 192.168.1.119/24

gateway: 192.168.1.1

dns: 192.168.1.1

 

修改 IP 地址

编辑 /etc/network/interfaces

auto lo
iface lo inet loopback
iface enp1s0 inet manual
auto vmbr0
iface vmbr0 inet static
    address 192.168.31.119/24
    gateway 192.168.31.1
    bridge-ports enp1s0
    bridge-stp off
    bridge-fd 0
iface enp2s0 inet manual
iface wlo1 inet manual

修改后

auto lo
iface lo inet loopback
iface enp1s0 inet manual
auto vmbr0
iface vmbr0 inet static
    address 192.168.1.119/24
    gateway 192.168.1.1
    bridge-ports enp1s0
    bridge-stp off
    bridge-fd 0
iface enp2s0 inet manual
iface wlo1 inet manual

这里有一点需要注意,如果是更换主板或者添加新网卡,可能导致配置文件里面的网卡名不一样,注意修改成一致的。

使用命令 ip addr 查看网卡名

2: enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master vmbr0 state UP group default qlen 1000
   link/ether 6c:4b:90:42:7e:57 brd ff:ff:ff:ff:ff:ff

再编辑interfaces里面网卡名部分修改对应的

vi /etc/network/interfaces

auto lo
iface lo inet loopback
auto enp0s31f6
iface enp0s31f6 inet manual
auto vmbr0
iface vmbr0 inet static
       address 172.16.1.119/24
       gateway 172.16.1.1
       bridge-ports enp0s31f6
       bridge-stp off
       bridge-fd 0
iface wlo1 inet manual

source /etc/network/interfaces.d/*

这里网卡名为enp0s31f6

修改 hosts

编辑 /etc/hosts

127.0.0.1 localhost.localdomain localhost
192.168.31.119 pve.lan pve
# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

主要修改的就是映射地址 192.168.31.119→pve.lan pve

修改后:

127.0.0.1 localhost.localdomain localhost
192.168.1.119 pve.lan pve
# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

 

修改 DNS (必要时修改)

编辑 /etc/resolv.conf

search lan
nameserver 192.168.31.1

修改后:

search lan
nameserver 192.168.1.1

 

修改终端提示的 URL(可改可不该,只是提示,自己记住就行)

编辑 /etc/issue

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

Welcome to the Proxmox Virtual Environment. Please use your web browser to 
configure this server - connect to:

  https://192.168.31.119:8006/

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

修改后:

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

Welcome to the Proxmox Virtual Environment. Please use your web browser to 
configure this server - connect to:

  https://192.168.1.119:8006/

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

 

所有修改玩成后关机,然后新网络环境连接网线并开机。

 


评论
User Image
提示:请评论与当前内容相关的回复,广告、推广或无关内容将被删除。

相关文章
proxmox VE(PVE) 虚拟机CPU睿频问题最近搭建了一颗I7 8700T ES@1.6GHz(睿频3.6GHz) CPU的PVE平台。在pve上安装了window 10 (CPU是以H...
LVM的基本概念PD:物理磁盘(PhysicalDisk),如硬盘,或RAID硬盘。PP:物理分区(PhysicalPartition),如硬盘的分区,或RAID硬盘的分区。
概述pve 在Windows环境下使用VMware练手教程 VMware虚拟机创建 创建虚拟机一路到最后即可,系统选择Linux,虚拟机配置参考然后就是有个cp
举例 当前网络环境ip address : 192.168.31.119/24gateway: 192.168.31.1dns:192.168.31.1 目标网络环境ip address : 1...
PVE备份操作选择虚拟机-&gtl;备份-&gtl;模式选择停止-&gtl;备份模式说明:停止:完整备份(速度慢,完整备份,类似Windows的克隆,虚拟机删除后可恢复,也可用作基础系统模板)快照:
PVE 安装黑群晖6.x一 PVE安装黑群晖准备Proxmox VE虚拟环境(以下简称PVE)黑群晖引导(这里用的DSM 6.17版本)群晖系统官方文件DS3617_6.17-15284.pat...
更新命令:apt update apt dist-upgrade遇到提问选y正常情况就升级完毕了。
pve fail2ban 软件安装apt update -yapt install fail2ban -y 安装SSHD 日志模块apt-get install
PVE 7.x更换国内源备份之前的cp /etc/apt/sources.list.d/pve-install-repo.list /root删除企业源rm /etc/apt/sources.l...
PVE软件源更换禁用pve企业源mv/etc/apt/sources.list.d/pve-enterprise.list/etc/apt/sources.list.d/pve-enterpri...
导致原因暂时不知解决办法PVE的web界面概要监控图不显示,只有时间显示 1970-01-01 解决方法rm /var/lib/rrdcached/db/* -
PVE 添加新硬盘-PVE将新硬盘添加为存储首先登录pve控制台,选中pve设备下面的磁盘磁盘查看磁盘点击后可以在右侧看到目前链接刀pve的硬盘数量。
PVE 7显示CPU温度工具准备xshell 或者其他ssh工具xftp 或者其他ftp工具notepad++或者其他文本编辑工具 需要修改以下两个文件/usr/share/pve-manage...
效果图参考服务配置编辑文件 /usr/share/perl5/PVE/API2/Nodes.pm 跳转到 my $dinfo =位置,编辑成如下所示
概述模拟pve系统盘挂了,恢复数据盘环境说明pve 版本8.4.1测试环境为VMware虚拟机内部虚拟机配置:CPU 4核内存 8GB硬盘1:100G (系统盘