Compare commits

..
43 Commits
Author SHA1 Message Date
CallMeR 1336af517e 更新 DNS 服务器流控算法 2024-07-22 17:12:01 +08:00
CallMeR b0beb5177f 更新 DNS 服务器流控算法 2024-07-19 12:37:05 +08:00
CallMeR 921bd8bb31 更新 TS 服务器流控算法 2024-07-19 12:35:08 +08:00
CallMeR ff1a1a43a7 更新截图 2024-07-02 15:23:20 +08:00
CallMeR 9a9173df92 更新系统更新命令 2024-07-02 11:01:58 +08:00
CallMeR e9ca2b5cda 更新备注信息 2024-06-28 15:33:05 +08:00
CallMeR 0695f8b6b9 Revert 替换广告屏蔽列表 2024-06-28 12:31:22 +08:00
CallMeR 1657411b7e 更新备注信息 2024-06-28 00:14:16 +08:00
CallMeR 14007e78b8 替换广告屏蔽列表 2024-06-27 16:56:10 +08:00
CallMeR 7318726847 修复段落标题 2024-06-26 15:05:08 +08:00
CallMeR 374c55cbb3 修复目录路径 2024-06-26 15:03:00 +08:00
CallMeR 7df6ea76b7 更新文案描述 2024-06-26 14:55:57 +08:00
CallMeR 5e0a8aac54 更新文案描述 2024-06-26 14:53:35 +08:00
CallMeR 8dd1f08f27 更新终端工具 2024-06-26 14:43:59 +08:00
CallMeR 9873dd74d1 更新 SmartDNS 版本 2024-06-13 11:29:38 +08:00
CallMeR ffaa26a050 更新配置文件备注 2024-05-23 02:12:07 +08:00
CallMeR b17ef026ad 更新文案描述 2024-05-21 12:50:30 +08:00
CallMeR 808094ae3c 更新脚本文件命名 2024-05-20 22:17:58 +08:00
CallMeR 609fcf579b 更新配置文件命名 2024-05-20 21:32:38 +08:00
CallMeR 022da7d3f9 更新配置文件命名 2024-05-20 16:18:29 +08:00
CallMeR afb2678f68 使用 btop 代替 htop 2024-05-16 13:21:15 +08:00
CallMeR 4ed96a4d38 更新文案说明 2024-04-28 12:09:53 +08:00
CallMeR f7ff85a805 更新 PVE 版本号 2024-04-26 13:50:02 +08:00
CallMeR 101fc96feb 更新自动备份截图 2024-04-26 13:48:52 +08:00
CallMeR 01f39562ff 新增 sshguard 工具 2024-04-26 12:36:28 +08:00
CallMeR 933bdca053 更新部分截图 2024-04-26 11:56:14 +08:00
CallMeR 748faac28b 更换 SmartDNS 广告列表 2024-04-23 13:28:57 +08:00
CallMeR fe8fbff04c 更新 Dnsmasq 缓存设置 2024-04-23 10:39:00 +08:00
CallMeR 50f49ed956 更新 SmartDNS 缓存设置 2024-04-23 10:36:39 +08:00
CallMeR b809ecd035 更新 PVE 软件源替换命令 2024-04-21 21:12:55 +08:00
CallMeR eda1d36130 更新 Dnsmasq 配置 2024-03-21 10:52:33 +08:00
CallMeR c9bf9ae2fd 更新 Dnsmasq 配置 2024-03-20 22:41:13 +08:00
CallMeR 38ac1f9702 更新 Dnsmasq 配置 2024-03-19 18:36:36 +08:00
CallMeR f493c774ab 更新 SmartDNS 配置 2024-03-19 12:06:18 +08:00
CallMeR 09a35e9c31 关闭 Dnsmasq 缓存 2024-03-19 10:13:17 +08:00
CallMeR a1e992c956 更新 SmartDNS 配置 2024-03-19 10:04:27 +08:00
CallMeR 360542f9d4 更新 Dnsmasq 参数 2024-03-18 21:45:12 +08:00
CallMeR e5a8d8b491 更新截图 2024-03-18 14:14:47 +08:00
CallMeR 3ce5fdba6a 更新截图 2024-03-18 14:09:10 +08:00
CallMeR 5ec78ce639 更新 Debian 云镜像 2024-03-18 13:50:30 +08:00
CallMeR b597af908d 更新 SmartDNS 缓存参数 2024-03-16 13:34:26 +08:00
CallMeR 6f085030b3 更新 Dnsmasq 缓存参数 2024-03-16 13:25:07 +08:00
CallMeR 82497488ed 更新 TS 自动更新 2024-03-01 20:26:31 +08:00
38 changed files with 149 additions and 134 deletions
+15 -9
View File
@@ -6,7 +6,7 @@ PVE 系统正式安装之前,需要准备 PVE 的安装镜像和一些必要
PVE 下载地址:[Proxmox Virtual Environment](https://www.proxmox.com/en/downloads/proxmox-virtual-environment/iso)
页面中有多个 PVE 相关文件,本文以目前最新的 `Proxmox VE 8.1-1 ISO Installer` 作为演示。
页面中有多个 PVE 相关文件,本文以目前最新的 `Proxmox VE 8.2-1 ISO Installer` 作为演示。
点击 `Proxmox VE 8.x ISO Installer` 链接,进入 PVE 下载页面。
@@ -50,25 +50,31 @@ PVE 下载地址:[Proxmox Virtual Environment](https://www.proxmox.com/en/down
![Rufus写盘工具](img/p01/pve_rufus.jpeg)
### 0.3. SSH 工具
### 0.3.终端工具
考虑到配置 PVE 服务器、路由器、DNS 服务器时,需要在 CLI 中输入命令,因此这里推荐几个常用的 SSH 工具。
考虑到配置 PVE 服务器、路由器、DNS 服务器时,需要在 CLI 中输入命令,因此这里推荐几个常用的终端工具。
#### Tabby
#### Windows Terminal
官方网站地址:https://tabby.sh
官方网站地址:https://aka.ms/terminal
基于 Electron 开发的开源跨平台终端工具,内部集成了 SFTP ,可以在 Github 平台上进行下载。
Microsoft 官方终端工具,可以在 Github 平台或 Microsoft 应用商店中进行下载。
支持 Windows 、macOS 、Linux 。
![Windows Terminal](img/p01/pve_win_terminal.png)
![Tabby SSH工具](img/p01/pve_tabby.png)
#### Termius
官方地址:https://termius.com/
企业级终端工具,支持 Windows、macOS、Linux 系统以及移动端系统。
![Termius](img/p01/pve_termius.jpeg)
#### MobaXterm
官方地址:https://mobaxterm.mobatek.net
功能强大的 SSH 工具,仅支持 Windows 。
功能强大的终端工具,仅支持 Windows 系统
![MobaXterm](img/p01/pve_mobaxterm.png)
+35 -25
View File
@@ -12,7 +12,7 @@
### 1.1.系统软件源
使用 SSH 工具登录到 PVE 服务器,首先对现有的软件源配置进行备份。
使用终端工具登录到 PVE 服务器,首先对现有的软件源配置进行备份。
```bash
## 进入系统软件源配置文件目录
@@ -64,27 +64,37 @@ deb https://mirrors.ustc.edu.cn/debian-security/ bookworm-security main contrib
默认情况下,PVE 额外启用了 2 个官方源,且为订阅收费制,因此需要替换为免费源。
删除 PVE 官方付费软件源,执行以下命令。
首先创建 PVE 费软件源,执行以下命令。
```bash
## 创建 PVE 免费软件源
$ source /etc/os-release
$ echo "deb https://mirrors.ustc.edu.cn/proxmox/debian/pve $VERSION_CODENAME pve-no-subscription" > /etc/apt/sources.list.d/pve-no-subscription.list
```
对于 Proxmox Backup Server 和 Proxmox Mail Gateway,请将以上命令中的 `pve` 分别替换为 `pbs``pmg`
进一步创建 PVE Ceph 免费软件源,Ceph 软件源为 PVE 8 之后默认安装,执行以下命令。
```bash
## 创建 PVE Ceph 免费软件源脚本
if [ -f /etc/apt/sources.list.d/ceph.list ]; then
CEPH_CODENAME=`ceph -v | grep ceph | awk '{print $(NF-1)}'`
source /etc/os-release
echo "deb https://mirrors.ustc.edu.cn/proxmox/debian/ceph-$CEPH_CODENAME $VERSION_CODENAME no-subscription" > /etc/apt/sources.list.d/ceph-no-subscription.list
fi
```
最后,删除 PVE 官方付费软件源,执行以下命令。
**注意:rm 为高风险命令,请正确使用,请勿手抖,请勿手抖。**
```bash
## 删除付费软件源
$ rm -rvf /etc/apt/sources.list.d/*.list
```
创建 PVE 免费软件源。
**注意:该命令为三行,在输入时请逐行输入并回车执行。**
```bash
## 创建 PVE 免费源
$ source /etc/os-release
$ echo "deb https://mirrors.ustc.edu.cn/proxmox/debian/ceph-quincy $VERSION_CODENAME no-subscription" > /etc/apt/sources.list.d/ceph-no-subscription.list
$ echo "deb https://mirrors.ustc.edu.cn/proxmox/debian/pve $VERSION_CODENAME pve-no-subscription" > /etc/apt/sources.list.d/pve-no-subscription.list
$ rm -rvf /etc/apt/sources.list.d/pve-enterprise.list /etc/apt/sources.list.d/ceph.list
```
创建完成后对其进行检查。
@@ -92,9 +102,9 @@ $ echo "deb https://mirrors.ustc.edu.cn/proxmox/debian/pve $VERSION_CODENAME pve
```bash
## 检查 PVE 免费源
$ cat /etc/apt/sources.list.d/ceph-no-subscription.list
$ cat /etc/apt/sources.list.d/pve-no-subscription.list
$ cat /etc/apt/sources.list.d/ceph-no-subscription.list
```
如果输出结果中有 USTC 的镜像地址,则表示命令已经正确执行。
@@ -102,11 +112,11 @@ $ cat /etc/apt/sources.list.d/pve-no-subscription.list
```bash
#### PVE 免费软件源示例输出
#### Ceph
deb https://mirrors.ustc.edu.cn/proxmox/debian/ceph-quincy bookworm no-subscription
#### PVE
deb https://mirrors.ustc.edu.cn/proxmox/debian/pve bookworm pve-no-subscription
#### Ceph
deb https://mirrors.ustc.edu.cn/proxmox/debian/ceph-quincy bookworm no-subscription
```
### 1.3. PVE CT 源
@@ -143,7 +153,7 @@ $ apt clean && apt autoclean && apt autoremove --purge
$ apt update
## 更新系统
$ apt dist-upgrade
$ apt full-upgrade
```
## 2.安装必要软件
@@ -161,10 +171,10 @@ $ apt dist-upgrade
$ apt update
## 安装系统软件
$ apt install htop lm-sensors unzip neovim tmux unattended-upgrades powermgmt-base
$ apt install btop lm-sensors unzip neovim tmux unattended-upgrades powermgmt-base
## 安装网络工具
$ apt install iperf iperf3 iftop openvswitch-switch
$ apt install iperf iperf3 iftop sshguard openvswitch-switch
## 安装 CPU 调度调整工具
$ apt install linux-cpupower
+4 -4
View File
@@ -9,10 +9,10 @@
$ apt update
## 安装系统软件
$ apt install htop lm-sensors unzip neovim tmux unattended-upgrades powermgmt-base
$ apt install btop lm-sensors unzip neovim tmux unattended-upgrades powermgmt-base
## 安装网络工具
$ apt install iperf iperf3 iftop openvswitch-switch
$ apt install iperf iperf3 iftop sshguard openvswitch-switch
## 安装 CPU 调度调整工具
$ apt install linux-cpupower
@@ -432,7 +432,7 @@ Aug 01 13:37:41 node01 systemd[1]: Started apt-daily-upgrade.timer - Daily apt u
参考官方文档 [qm_pci_passthrough](https://pve.proxmox.com/pve-docs/pve-admin-guide.html#qm_pci_passthrough) 和 [Pci passthrough](https://pve.proxmox.com/wiki/Pci_passthrough) 开启 PVE 硬件直通功能。
使用 SSH 工具登录到 PVE 服务器,编辑系统 `Grub` 的配置文件 `/etc/default/grub`
使用终端工具登录到 PVE 服务器,编辑系统 `Grub` 的配置文件 `/etc/default/grub`
```bash
## 编辑 Grub 配置文件
@@ -493,7 +493,7 @@ $ update-initramfs -u -k all
### 5.3.检查硬件直通
PVE 服务器重启完成后,再次使用 SSH 工具登录,并执行以下命令检查硬件直通状态。
PVE 服务器重启完成后,再次使用终端工具登录,并执行以下命令检查硬件直通状态。
主要查看 `IOMMU``Directed I/O``Interrupt Remapping` 的启用状态。
+6 -6
View File
@@ -4,11 +4,11 @@
该虚拟机模板主要用作内网 DNS 服务器,由 `Adguard Home``SmartDNS` 提供 DNS 解析服务。
本文将使用 Debian 的云镜像 `debian-12-genericcloud-amd64.qcow2` 作为模板虚拟机的镜像。
本文将使用 Debian 的云镜像 `debian-12-generic-amd64.qcow2` 作为模板虚拟机的镜像。
访问 [Debian Official Cloud Images](https://cloud.debian.org/images/cloud/) 官方网站,下载最新版 `Bookworm` 云镜像以及对应的校验文件。
![下载镜像](img/p04/download_genericcloud_image_qcow2.jpeg)
![下载镜像](img/p04/download_generic_image_qcow2.jpg)
## 1.创建虚拟机
@@ -90,7 +90,7 @@ CPU `类别` 选择 `host` `插槽` 与 `核心` 数根据物理 CPU 核心
### 2.2.导入镜像文件
使用 SSH 工具登录 PVE 服务器,并进入 `tmp` 目录,执行以下命令创建一个目录。
使用终端工具登录 PVE 服务器,并进入 `/tmp` 目录,执行以下命令创建一个目录。
```bash
## 创建存放 Debian 云镜像的临时目录
@@ -107,7 +107,7 @@ $ cd /tmp/Debian
$ wget https://cloud.debian.org/images/cloud/bookworm/latest/SHA512SUMS
## 下载云镜像
$ wget https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-genericcloud-amd64.qcow2
$ wget https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-amd64.qcow2
## 检查文件是否存在
$ ls -lah
@@ -116,14 +116,14 @@ $ ls -lah
$ cat SHA512SUMS
## 计算文件 hash
$ sha512sum debian-12-genericcloud-amd64.qcow2
$ sha512sum debian-12-generic-amd64.qcow2
```
确认无误后,将镜像文件导入刚才创建的虚拟机,命令中的 `VM ID` 需要根据实际情况替换,演示为 `1001`
```bash
## 将 qcow2 镜像导入虚拟机中
$ qm importdisk 1001 debian-12-genericcloud-amd64.qcow2 local-lvm
$ qm importdisk 1001 debian-12-generic-amd64.qcow2 local-lvm
#### 镜像导入示例输出
Successfully imported disk as 'unused0:local-lvm:vm-1001-disk-0'
+12 -12
View File
@@ -21,8 +21,8 @@
- 保存文件,按下键盘 `Esc` 键,退出编辑模式,再输入组合键 `:wq` 即可保存。
```bash
## 编辑 ssh 配置文件
$ sudo vim /etc/ssh/sshd_config.d/server_sshd.conf
## 编辑 SSH 配置文件
$ sudo vim /etc/ssh/sshd_config.d/10-server-sshd.conf
```
在配置文件中添加以下配置项,并保存。
@@ -39,17 +39,17 @@ UseDNS no
修改完成后,需要重启 SSH 服务。
```bash
## 重启 sshd
## 重启 ssh.service
$ sudo systemctl restart ssh.service
```
### 1.2.配置软件源
使用 SSH 工具登录模板虚拟机,常用 SSH 工具请参阅 [01.PVE系统安装](./01.PVE系统安装.md) 。
使用终端工具登录模板虚拟机,常用终端工具请参阅 [01.PVE系统安装](./01.PVE系统安装.md) 。
首先需要对 Debian 系统软件源进行修改,这里使用 [USTC](http://mirrors.ustc.edu.cn/help/debian.html) 镜像站作为演示。
首先需要对 Debian 系统软件源进行修改,这里使用 [USTC](https://mirrors.ustc.edu.cn) 镜像站作为演示。
当系统版本发生变化时,请参考使用 snullp 大叔开发的 [配置生成器](https://mirrors.ustc.edu.cn/repogen/) 。
当系统版本发生变化时,请参考 USTC 镜像站的官方说明 [USTC Mirror Help - Debian](https://mirrors.ustc.edu.cn/help/debian.html) 。
Debian12 云镜像的软件源配置采用了 `DEB822` 格式,新版 `sources.list` 配置文件内容如下。
@@ -89,7 +89,6 @@ $ cat /etc/apt/mirrors/debian-security.list
#### 关联配置文件示例输出 (关联部分 2 )
https://deb.debian.org/debian-security
```
因此,修改 Debian12 软件源的方式也有两种,本文将尝试使用第 `2` 种修改方案。
@@ -149,14 +148,14 @@ $ sudo apt clean && sudo apt autoclean && sudo apt autoremove --purge
$ sudo apt update
## 更新系统
$ sudo apt dist-upgrade
$ sudo apt full-upgrade
```
接下来安装系统必要软件,安装 `iperf3` 后,系统将询问是否将其作为系统服务开机自启,选择 `no` 即可。
```bash
## 安装系统软件
$ sudo apt install qemu-guest-agent zsh git htop tmux cron nftables sshguard neovim
$ sudo apt install qemu-guest-agent zsh git btop tmux cron nftables sshguard neovim
## 安装系统自动更新工具
$ sudo apt install unattended-upgrades powermgmt-base python3-gi
@@ -188,7 +187,7 @@ $ sudo nvim /etc/sysctl.d/99-sysctl.conf
kernel.panic = 20
kernel.panic_on_oops = 1
net.core.default_qdisc = fq
net.core.default_qdisc = fq_codel
net.ipv4.tcp_congestion_control = bbr
# Other adjustable system parameters
@@ -241,13 +240,14 @@ Debian 云镜像默认使用 `systemd-timesyncd.service` 同步时间,且需
$ sudo mkdir -p /etc/systemd/timesyncd.conf.d
## 创建 NTP 配置文件
$ sudo nvim /etc/systemd/timesyncd.conf.d/server_ntp.conf
$ sudo nvim /etc/systemd/timesyncd.conf.d/10-server-ntp.conf
```
在配置文件中添加以下配置项,并保存。
```bash
## NTP 配置项
# This configuration file is customized by fox,
# Optimize system NTP server.
[Time]
NTP=ntp.tencent.com ntp.aliyun.com
+21 -28
View File
@@ -71,7 +71,7 @@
## 4.调整系统端口
设置完成后,将该虚拟机开机,使用 SSH 工具登录,并执行以下命令检查端口占用。
设置完成后,将该虚拟机开机,使用终端工具登录,并执行以下命令检查端口占用。
```bash
## 检查 53 端口占用
@@ -94,13 +94,14 @@ systemd-r 1797 systemd-resolve 21u IPv4 23027 0t0 TCP 127.0.0.54:domai
$ sudo mkdir -p /etc/systemd/resolved.conf.d
## 创建 systemd-resolved 配置文件
$ sudo nvim /etc/systemd/resolved.conf.d/server_dns.conf
$ sudo nvim /etc/systemd/resolved.conf.d/10-server-dns.conf
```
在配置文件中添加以下配置项,并保存。
```bash
## systemd-resolved 配置项
# This configuration file is customized by fox,
# Optimize system resolve parameters for local DNS server.
[Resolve]
DNS=127.0.0.1
@@ -215,10 +216,10 @@ $ mkdir -p /tmp/SmartDNS
$ cd /tmp/SmartDNS
## 下载 SmartDNS 安装包
$ curl -LR -O https://github.com/pymumu/smartdns/releases/download/Release45/smartdns.1.2024.02.08-0828.x86_64-linux-all.tar.gz
$ curl -LR -O https://github.com/pymumu/smartdns/releases/download/Release46/smartdns.1.2024.06.12-2222.x86_64-linux-all.tar.gz
## 解压缩 SmartDNS 安装包
$ tar zxf smartdns.1.2024.02.08-0828.x86_64-linux-all.tar.gz
$ tar zxf smartdns.1.2024.06.12-2222.x86_64-linux-all.tar.gz
## 进入安装包目录
$ cd smartdns
@@ -251,7 +252,7 @@ $ sudo systemctl enable smartdns.service
$ sudo mkdir -p /etc/smartdns.d
## 下载广告规则配置文件
$ sudo curl -LR -o /etc/smartdns.d/adrules.smartdns.conf https://adrules.top/smart-dns.conf
$ sudo curl -LR -o /etc/smartdns.d/anti-ad.smartdns.conf https://anti-ad.net/anti-ad-for-smartdns.conf
```
`SmartDNS` 的加速规则通过 `bash` 脚本安装,脚本生成的配置文件位于 `/etc/smartdns.d` 目录。
@@ -260,16 +261,16 @@ $ sudo curl -LR -o /etc/smartdns.d/adrules.smartdns.conf https://adrules.top/sma
```bash
## 下载加速规则安装脚本
$ sudo curl -LR -o /opt/smartdns_plugin.sh https://gitee.com/callmer/smartdns_china_list_installer/raw/main/smartdns_plugin.sh
$ sudo curl -LR -o /opt/smartdns-plugin.sh https://gitee.com/callmer/smartdns_china_list_installer/raw/main/smartdns_plugin.sh
## 设置脚本可执行权限
$ sudo chmod +x /opt/smartdns_plugin.sh
$ sudo chmod +x /opt/smartdns-plugin.sh
## 设置脚本文件防篡改
$ sudo chattr +i /opt/smartdns_plugin.sh
$ sudo chattr +i /opt/smartdns-plugin.sh
## 执行脚本
$ sudo bash /opt/smartdns_plugin.sh
$ sudo bash /opt/smartdns-plugin.sh
```
### 6.2. SmartDNS 主配置
@@ -330,13 +331,7 @@ $ sudo nvim /etc/smartdns/smartdns.conf
# server 2402:4e00::
# server 2400:3200::1
conf-file /etc/smartdns.d/adrules.smartdns.conf
conf-file /etc/smartdns.d/dns-group.china.smartdns.conf
conf-file /etc/smartdns.d/apple.china.smartdns.conf
conf-file /etc/smartdns.d/google.china.smartdns.conf
conf-file /etc/smartdns.d/accelerated-domains.china.smartdns.conf
conf-file /etc/smartdns.d/bogus-nxdomain.china.smartdns.conf
conf-file /etc/smartdns.d/*.conf
cache-file /tmp/smartdns.cache
@@ -346,8 +341,8 @@ bind [::]:6053@lo
bind-tcp [::]:6053@lo
serve-expired yes
serve-expired-ttl 64800
serve-expired-reply-ttl 3
serve-expired-ttl 129600
serve-expired-reply-ttl 30
prefetch-domain yes
serve-expired-prefetch-time 21600
@@ -390,7 +385,7 @@ $ sudo crontab -e
```bash
## 定时任务配置项
20 9 * * * /usr/bin/curl --retry-connrefused --retry 5 --retry-delay 5 --retry-max-time 60 -fsSLR -o /etc/smartdns.d/adrules.smartdns.conf https://adrules.top/smart-dns.conf
20 9 * * * /usr/bin/curl --retry-connrefused --retry 5 --retry-delay 5 --retry-max-time 60 -fsSLR -o /etc/smartdns.d/anti-ad.smartdns.conf https://anti-ad.net/anti-ad-for-smartdns.conf
30 9 * * * /usr/bin/systemctl restart smartdns.service
@@ -401,9 +396,9 @@ $ sudo crontab -e
```bash
## 定时任务配置项
20 9 * * * /usr/bin/curl --retry-connrefused --retry 5 --retry-delay 5 --retry-max-time 60 -fsSLR -o /etc/smartdns.d/adrules.smartdns.conf https://adrules.top/smart-dns.conf
20 9 * * * /usr/bin/curl --retry-connrefused --retry 5 --retry-delay 5 --retry-max-time 60 -fsSLR -o /etc/smartdns.d/anti-ad.smartdns.conf https://anti-ad.net/anti-ad-for-smartdns.conf
30 9 * * * /usr/bin/bash /opt/smartdns_plugin.sh
30 9 * * * /usr/bin/bash /opt/smartdns-plugin.sh
```
### 6.4.配置 Dnsmasq
@@ -444,18 +439,17 @@ conf-file=/etc/dnsmasq.conf
log-facility=/var/log/dnsmasq.log
log-async=20
cache-size=1024
max-cache-ttl=7200
cache-size=2048
max-cache-ttl=10800
fast-dns-retry=1800
edns-packet-max=1232
rebind-domain-ok=/fox.home.arpa/
bind-dynamic
bogus-priv
domain-needed
localise-queries
local-service
no-hosts
no-negcache
no-resolv
no-round-robin
rebind-localhost-ok
@@ -465,11 +459,10 @@ stop-dns-rebind
server=/alt/
server=/home.arpa/
server=/ipv4only.arpa/
server=/resolver.arpa/
server=/example/
server=/bind/
server=/invalid/
server=/lan/
server=/local/
server=/localhost/
server=/onion/
+30 -20
View File
@@ -28,8 +28,8 @@
在虚拟机的命令行界面,使用 `vim` 编辑器编辑 `sshd` 服务的配置文件,执行以下命令。
```bash
## 编辑 ssh 配置文件
$ sudo vim /etc/ssh/sshd_config.d/server_sshd.conf
## 编辑 SSH 配置文件
$ sudo vim /etc/ssh/sshd_config.d/10-server-sshd.conf
```
在配置文件中添加以下配置项,并保存。
@@ -46,17 +46,17 @@ UseDNS no
修改完成后,需要重启 SSH 服务。
```bash
## 重启 sshd
## 重启 ssh.service
$ sudo systemctl restart ssh.service
```
### 1.2.配置软件源
使用 SSH 工具登录 TS 服务器,常用 SSH 工具请参阅 [01.PVE系统安装](./01.PVE系统安装.md) 。
使用终端工具登录 TS 服务器,常用终端工具请参阅 [01.PVE系统安装](./01.PVE系统安装.md) 。
首先需要对 Debian 系统软件源进行修改,这里使用 [USTC](http://mirrors.ustc.edu.cn/help/debian.html) 镜像站作为演示。
首先需要对 Debian 系统软件源进行修改,这里使用 [USTC](https://mirrors.ustc.edu.cn) 镜像站作为演示。
当系统版本发生变化时,请参考使用 snullp 大叔开发的 [配置生成器](https://mirrors.ustc.edu.cn/repogen/) 。
当系统版本发生变化时,请参考 USTC 镜像站的官方说明 [USTC Mirror Help - Debian](https://mirrors.ustc.edu.cn/help/debian.html) 。
使用 `vim` 编辑器编辑 `debian.sources` 配置文件,执行以下命令。
@@ -119,14 +119,14 @@ $ sudo apt clean && sudo apt autoclean && sudo apt autoremove --purge
$ sudo apt update
## 更新系统
$ sudo apt dist-upgrade
$ sudo apt full-upgrade
```
接下来安装系统必要软件,安装 `iperf3` 后,系统将询问是否将其作为系统服务开机自启,选择 `no` 即可。
```bash
## 安装系统软件
$ sudo apt install qemu-guest-agent zsh git htop tmux cron nftables sshguard neovim
$ sudo apt install qemu-guest-agent zsh git btop tmux cron nftables sshguard neovim
## 安装系统自动更新工具
$ sudo apt install unattended-upgrades powermgmt-base python3-gi
@@ -147,7 +147,7 @@ $ sudo sync
```bash
## 创建 内核模块 配置文件
$ sudo nvim /etc/modules-load.d/server_modules.conf
$ sudo nvim /etc/modules-load.d/10-server-modules.conf
```
在配置文件中添加以下配置项,并保存。
@@ -178,7 +178,7 @@ $ sudo nvim /etc/sysctl.d/99-sysctl.conf
kernel.panic = 20
kernel.panic_on_oops = 1
net.core.default_qdisc = fq_codel
net.core.default_qdisc = cake
net.ipv4.tcp_congestion_control = bbr
net.ipv4.ip_forward = 1
@@ -266,13 +266,14 @@ Debian 云镜像默认使用 `systemd-timesyncd.service` 同步时间,且需
$ sudo mkdir -p /etc/systemd/timesyncd.conf.d
## 创建 NTP 配置文件
$ sudo nvim /etc/systemd/timesyncd.conf.d/server_ntp.conf
$ sudo nvim /etc/systemd/timesyncd.conf.d/10-server-ntp.conf
```
在配置文件中添加以下配置项,并保存。
```bash
## NTP 配置项
# This configuration file is customized by fox,
# Optimize system NTP server.
[Time]
NTP=ntp.tencent.com ntp.aliyun.com
@@ -431,13 +432,14 @@ $ sudo systemctl restart nftables.service
$ sudo mkdir -p /etc/systemd/resolved.conf.d
## 创建 systemd-resolved 配置文件
$ sudo nvim /etc/systemd/resolved.conf.d/server_dns.conf
$ sudo nvim /etc/systemd/resolved.conf.d/10-server-dns.conf
```
在配置文件中添加以下配置项,并保存。
```bash
## systemd-resolved 配置项
# This configuration file is customized by fox,
# Optimize system resolve parameters for local TS server.
[Resolve]
DNS=127.0.0.1
@@ -511,18 +513,17 @@ conf-file=/etc/dnsmasq.conf
log-facility=/var/log/dnsmasq.log
log-async=20
cache-size=1024
max-cache-ttl=7200
cache-size=2048
max-cache-ttl=10800
fast-dns-retry=1800
edns-packet-max=1232
rebind-domain-ok=/fox.home.arpa/
bind-dynamic
bogus-priv
domain-needed
localise-queries
local-service
no-hosts
no-negcache
no-round-robin
rebind-localhost-ok
stop-dns-rebind
@@ -531,11 +532,10 @@ stop-dns-rebind
server=/alt/
server=/home.arpa/
server=/ipv4only.arpa/
server=/resolver.arpa/
server=/example/
server=/bind/
server=/invalid/
server=/lan/
server=/local/
server=/localhost/
server=/onion/
@@ -613,5 +613,15 @@ $ sudo tailscale up --advertise-exit-node --accept-routes --advertise-routes=172
执行命令后,TS 将自动显示登录链接,只需根据链接进行登录操作即可。
目前 TS 将跟随系统自动更新,若需额外开启 TS 的自动更新功能,执行以下命令。
```bash
## TS 开启自动更新
$ sudo tailscale set --auto-update
## TS 关闭自动更新
$ sudo tailscale set --auto-update=false
```
至此,TS 服务器已配置完成。
+9 -3
View File
@@ -18,13 +18,13 @@
|存储|`local`|选择存放备份文件的路径|
|计划|`*-01,16 03:30`|`备份作业` 执行的时间计划|
|选择模式|`包括选中的VMs`|执行备份的虚拟机对象|
|通知模式|`默认(自动)`|执行备份时的通知模式,保持默认即可|
|发送邮箱至|`your_email@domain.com`|`备份作业` 邮件的收件人邮箱|
|电子邮件|`始终通知`|何时发送 `备份作业` 邮件提醒|
|发送邮件|`总是`|发送 `备份作业` 邮件提醒的条件|
|压缩|`ZSTD`|选择备份文件的压缩算法|
|模式|`停止`|选择备份虚拟机的方式,推荐使用 `停止` |
|启用|**勾选**|表示该 `备份作业` 为启用状态|
|作业评论|`Backup Your Server :)`|`备份作业` 的备注信息,使用英文输入|
|重复错过|**勾选**|表示当意外错过备份执行时间后,将重试备份|
**额外说明:**
@@ -44,7 +44,7 @@
![备份作业保留选项](img/p08/vm_job_keep.jpeg)
### 1.3.日志模板
### 1.3.备注模板
该选项将按照设置的内容,自动重命名备份文件。
@@ -54,6 +54,12 @@
![备份作业备注选项](img/p08/vm_job_notes.jpeg)
### 1.4.高级选项
该选项提供 `备份作业` 进行时的高级可调参数,仅需勾选 `重复错过` 选项即可。
![备份作业高级选项](img/p08/vm_job_advanced.jpeg)
## 2.调度模拟器
在创建完成 `备份作业` 后,可以使用 `调度模拟器` 来模拟 `备份作业` 的执行时间。
+1 -1
View File
@@ -3,7 +3,7 @@
## 介绍
PVE 虚拟化平台的安装以及折腾手记。
- PVE ISO 版本:8.1-1 (更新时间: 2023-11-23)
- PVE ISO 版本:8.2-1 (更新时间: 2024-04-24)
- 演示机:
- CPU:英特尔奔腾 Silver N6005 处理器
Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 KiB

After

Width:  |  Height:  |  Size: 209 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 109 KiB

After

Width:  |  Height:  |  Size: 280 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 115 KiB

After

Width:  |  Height:  |  Size: 300 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 292 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 265 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

After

Width:  |  Height:  |  Size: 294 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 156 KiB

After

Width:  |  Height:  |  Size: 217 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 271 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 599 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 579 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 322 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 187 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 KiB

After

Width:  |  Height:  |  Size: 300 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 220 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 201 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 171 KiB

+1 -1
View File
@@ -4,7 +4,7 @@
kernel.panic = 20
kernel.panic_on_oops = 1
net.core.default_qdisc = fq
net.core.default_qdisc = fq_codel
net.ipv4.tcp_congestion_control = bbr
# Other adjustable system parameters
+4 -6
View File
@@ -9,18 +9,17 @@ conf-file=/etc/dnsmasq.conf
log-facility=/var/log/dnsmasq.log
log-async=20
cache-size=1024
max-cache-ttl=7200
cache-size=2048
max-cache-ttl=10800
fast-dns-retry=1800
edns-packet-max=1232
rebind-domain-ok=/fox.home.arpa/
bind-dynamic
bogus-priv
domain-needed
localise-queries
local-service
no-hosts
no-negcache
no-resolv
no-round-robin
rebind-localhost-ok
@@ -30,11 +29,10 @@ stop-dns-rebind
server=/alt/
server=/home.arpa/
server=/ipv4only.arpa/
server=/resolver.arpa/
server=/example/
server=/bind/
server=/invalid/
server=/lan/
server=/local/
server=/localhost/
server=/onion/
+3 -9
View File
@@ -12,13 +12,7 @@
# server 2402:4e00::
# server 2400:3200::1
conf-file /etc/smartdns.d/adrules.smartdns.conf
conf-file /etc/smartdns.d/dns-group.china.smartdns.conf
conf-file /etc/smartdns.d/apple.china.smartdns.conf
conf-file /etc/smartdns.d/google.china.smartdns.conf
conf-file /etc/smartdns.d/accelerated-domains.china.smartdns.conf
conf-file /etc/smartdns.d/bogus-nxdomain.china.smartdns.conf
conf-file /etc/smartdns.d/*.conf
cache-file /tmp/smartdns.cache
@@ -28,8 +22,8 @@ bind [::]:6053@lo
bind-tcp [::]:6053@lo
serve-expired yes
serve-expired-ttl 64800
serve-expired-reply-ttl 3
serve-expired-ttl 129600
serve-expired-reply-ttl 30
prefetch-domain yes
serve-expired-prefetch-time 21600
+3 -3
View File
@@ -1,14 +1,14 @@
# This configuration file is customized by fox,
# Optimize SmartDNS crontab for local DNS server.
20 9 * * * /usr/bin/curl --retry-connrefused --retry 5 --retry-delay 5 --retry-max-time 60 -fsSLR -o /etc/smartdns.d/adrules.smartdns.conf https://adrules.top/smart-dns.conf
20 9 * * * /usr/bin/curl --retry-connrefused --retry 5 --retry-delay 5 --retry-max-time 60 -fsSLR -o /etc/smartdns.d/anti-ad.smartdns.conf https://anti-ad.net/anti-ad-for-smartdns.conf
30 9 * * * /usr/bin/systemctl restart smartdns.service
## Or when the smartdns plugin is installed
20 9 * * * /usr/bin/curl --retry-connrefused --retry 5 --retry-delay 5 --retry-max-time 60 -fsSLR -o /etc/smartdns.d/adrules.smartdns.conf https://adrules.top/smart-dns.conf
20 9 * * * /usr/bin/curl --retry-connrefused --retry 5 --retry-delay 5 --retry-max-time 60 -fsSLR -o /etc/smartdns.d/anti-ad.smartdns.conf https://anti-ad.net/anti-ad-for-smartdns.conf
30 9 * * * /usr/bin/bash /opt/smartdns_plugin.sh
30 9 * * * /usr/bin/bash /opt/smartdns-plugin.sh
+1 -1
View File
@@ -4,7 +4,7 @@
kernel.panic = 20
kernel.panic_on_oops = 1
net.core.default_qdisc = fq_codel
net.core.default_qdisc = cake
net.ipv4.tcp_congestion_control = bbr
net.ipv4.ip_forward = 1
+4 -6
View File
@@ -9,18 +9,17 @@ conf-file=/etc/dnsmasq.conf
log-facility=/var/log/dnsmasq.log
log-async=20
cache-size=1024
max-cache-ttl=7200
cache-size=2048
max-cache-ttl=10800
fast-dns-retry=1800
edns-packet-max=1232
rebind-domain-ok=/fox.home.arpa/
bind-dynamic
bogus-priv
domain-needed
localise-queries
local-service
no-hosts
no-negcache
no-round-robin
rebind-localhost-ok
stop-dns-rebind
@@ -29,11 +28,10 @@ stop-dns-rebind
server=/alt/
server=/home.arpa/
server=/ipv4only.arpa/
server=/resolver.arpa/
server=/example/
server=/bind/
server=/invalid/
server=/lan/
server=/local/
server=/localhost/
server=/onion/