update 5.PVE制作虚拟机模板.md.

This commit is contained in:
秋刀狐狸
2022-08-07 14:03:19 +00:00
committed by Gitee
parent bf06020fea
commit 88aa9499a9
+39 -7
View File
@@ -460,11 +460,11 @@ iface lo inet loopback
# The primary network interface # The primary network interface
allow-hotplug ens18 allow-hotplug ens18
iface ens18 inet static iface ens18 inet static
address 10.0.0.2/24 address 172.16.1.2/24
gateway 10.0.0.1 gateway 172.16.1.1
# dns-* options are implemented by the resolvconf package, if installed # dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 10.0.0.3 dns-nameservers 172.16.1.3
dns-search goldenhome.lab dns-search fox.lab
``` ```
检查系统的 `hosts` ,执行以下命令: 检查系统的 `hosts` ,执行以下命令:
@@ -474,8 +474,9 @@ iface ens18 inet static
cat /etc/hosts cat /etc/hosts
## 示例输出 ## 示例输出
127.0.0.1 localhost 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 # The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback ::1 localhost ip6-localhost ip6-loopback
@@ -487,7 +488,7 @@ Debian 普通镜像需要手动修改系统 DNS 配置,执行以下命令:
```bash ```bash
## Debian 普通镜像修改系统 DNS ## Debian 普通镜像修改系统 DNS
sudo nano /etc/resolv.conf sudo vim /etc/resolv.conf
``` ```
在编辑器对话框中输入以下内容,注意命令中间的空格: 在编辑器对话框中输入以下内容,注意命令中间的空格:
@@ -495,5 +496,36 @@ sudo nano /etc/resolv.conf
```bash ```bash
search fox.lab search fox.lab
nameserver 127.0.0.1 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
``` ```