From 88aa9499a9310cb42b88cf60726247eb5beaba67 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 14:03:19 +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 | 46 +++++++++++++++++++++++++++++++++++------- 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/5.PVE制作虚拟机模板.md b/5.PVE制作虚拟机模板.md index 3ba0b45..53093ad 100644 --- a/5.PVE制作虚拟机模板.md +++ b/5.PVE制作虚拟机模板.md @@ -460,11 +460,11 @@ 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 + address 172.16.1.2/24 + gateway 172.16.1.1 # dns-* options are implemented by the resolvconf package, if installed - dns-nameservers 10.0.0.3 - dns-search goldenhome.lab + dns-nameservers 172.16.1.3 + dns-search fox.lab ``` 检查系统的 `hosts` ,执行以下命令: @@ -474,8 +474,9 @@ iface ens18 inet static cat /etc/hosts ## 示例输出 + 127.0.0.1 localhost -10.0.0.2 dns001.fox.lab dns001 +172.16.1.2 dns001.fox.lab dns001 # The following lines are desirable for IPv6 capable hosts ::1 localhost ip6-localhost ip6-loopback @@ -487,7 +488,7 @@ Debian 普通镜像需要手动修改系统 DNS 配置,执行以下命令: ```bash ## Debian 普通镜像修改系统 DNS -sudo nano /etc/resolv.conf +sudo vim /etc/resolv.conf ``` 在编辑器对话框中输入以下内容,注意命令中间的空格: @@ -495,5 +496,36 @@ sudo nano /etc/resolv.conf ```bash search fox.lab nameserver 127.0.0.1 -nameserver 10.0.0.3 +nameserver 172.16.1.3 +``` + +Debian 普通镜像使用 `systemd-timesyncd.service` 来同步系统时间,检查服务状态: + +```bash +## 检查 Debian 普通镜像 NTP 服务器状态 +sudo systemctl status systemd-timesyncd.service +``` + +调整 NTP 服务,逐条执行以下命令: + +```bash +## 创建 NTP 配置文件的文件夹 +sudo mkdir /etc/systemd/timesyncd.conf.d + +## 创建 NTP 配置文件 +sudo nano /etc/systemd/timesyncd.conf.d/server-ntp.conf +``` + +在 nano 编辑器对话框中输入一下内容,并保存: + +```bash +[Time] +NTP=ntp.tencent.com ntp.aliyun.com +``` + +重启 NTP 服务: + +```bash +## 重启 NTP 服务 +sudo systemctl restart systemd-timesyncd.service ``` \ No newline at end of file