在这篇文章中,我将记录我在网络配置上遇到的问题以及填坑方案。如果这里面也有你遇到的问题,你可以按需阅读。
更改默认绑定网卡
我在安装 PVE 之后,将该硬盘移到其他机器上,由于硬件设施的变动,导致我们无法连接进入服务器。我们需要修改/etc/network/interfaces
文件。
在 PVE 中,默认安装的文件编辑器是nano
,我们使用nano
编辑/etc/network/interfaces
文件。
nano /etc/network/interfaces
我先讲一讲我的案例,这是我的配置文件,对于刚安装的设备,配置文件基本都差不多,只是网卡和 IP 地址不一样。
我的配置文件如下:
# network interface settings; autogenerated
# Please do NOT modify this file directly, unless you know what
# you're doing.
#
# If you want to manage parts of the network configuration manually,
# please utilize the 'source' or 'source-directory' directives to do
# so.
# PVE will preserve these directives, but will NOT read its network
# configuration from sourced files, so do not attempt to move any of
# the PVE managed interfaces into external files!
auto lo
iface lo inet loopback
iface enp2s0 inet manual
auto vmbr0
iface vmbr0 inet static
address 192.168.3.100/24
gateway 192.168.3.1
bridge-ports enp2s0
bridge-