From bf06020feaa3cd5e2aadb9c1fe91b44ecbbe1cc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E5=88=80=E7=8B=90=E7=8B=B8?= Date: Sun, 7 Aug 2022 13:50:58 +0000 Subject: [PATCH] =?UTF-8?q?update=205.PVE=E5=88=B6=E4=BD=9C=E8=99=9A?= =?UTF-8?q?=E6=8B=9F=E6=9C=BA=E6=A8=A1=E6=9D=BF.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 5.PVE制作虚拟机模板.md | 62 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/5.PVE制作虚拟机模板.md b/5.PVE制作虚拟机模板.md index 66acfb4..3ba0b45 100644 --- a/5.PVE制作虚拟机模板.md +++ b/5.PVE制作虚拟机模板.md @@ -436,4 +436,64 @@ history -c 本文中 Debian 云镜像的系统配置方法大多也适用于 Debian 普通镜像。 -但有关 IP 地址、DNS、系统时区等内容的配置方法在 Debian 普通镜像上有区别。 \ No newline at end of file +但有关 IP 地址、DNS、系统时区等内容的配置方法在 Debian 普通镜像上有区别。 + +使用 Debian ISO 镜像安装完操作系统后,修改网卡 IP 地址配置,需要执行以下命令: + +```bash +## Debian 普通镜像调整网卡配置 +sudo vim /etc/network/interfaces +``` + +在网卡的配置文件中需要修改 `address` 、 `dns-nameservers` 等参数,完整配置文件参考如下: + +```bash +# This file describes the network interfaces available on your system +# and how to activate them. For more information, see interfaces(5). + +source /etc/network/interfaces.d/* + +# The loopback network interface +auto lo +iface lo inet loopback + +# The primary network interface +allow-hotplug ens18 +iface ens18 inet static + address 10.0.0.2/24 + gateway 10.0.0.1 + # dns-* options are implemented by the resolvconf package, if installed + dns-nameservers 10.0.0.3 + dns-search goldenhome.lab +``` + +检查系统的 `hosts` ,执行以下命令: + +```bash +## 检查系统 hosts +cat /etc/hosts + +## 示例输出 +127.0.0.1 localhost +10.0.0.2 dns001.fox.lab dns001 + +# The following lines are desirable for IPv6 capable hosts +::1 localhost ip6-localhost ip6-loopback +ff02::1 ip6-allnodes +ff02::2 ip6-allrouters +``` + +Debian 普通镜像需要手动修改系统 DNS 配置,执行以下命令: + +```bash +## Debian 普通镜像修改系统 DNS +sudo nano /etc/resolv.conf +``` + +在编辑器对话框中输入以下内容,注意命令中间的空格: + +```bash +search fox.lab +nameserver 127.0.0.1 +nameserver 10.0.0.3 +``` \ No newline at end of file