#091

Опубликовано: 13 Июль 2026
на канале: 金途马语
2,194
19

直接镜像下载:
https://mirrors.tuna.tsinghua.edu.cn/...
https://www.debian.org/CD/http-ftp/
cd /var/lib/vz/template/iso
wget https://mirrors.tuna.tsinghua.edu.cn/...
通过终端登陆:
ssh li@ip
su root
更新软件包源
apt update
安装和 linux-image 内核版本相对于的 linux-headers 内核
apt install linux-headers-$(uname -r) -y
Debian9 安装后内核列表
dpkg -l|grep linux-headers
安装WireGuard
添加 unstable 软件包源,以确保安装版本是最新的
echo "deb http://deb.debian.org/debian/ unstable main" /etc/apt/sources.list.d/unstable.list
echo -e 'Package: *\nPin: release a=unstable\nPin-Priority: 150' /etc/apt/preferences.d/limit-unstable

更新一下软件包源
apt update

开始安装 WireGuard ,和辅助库 resolvconf
apt install wireguard resolvconf -y

验证是否安装成功
modprobe wireguard && lsmod | grep wireguard

配置步骤 WireGuard服务端

首先进入配置文件目录
mkdir -p /etc/wireguard
cd /etc/wireguard

nano wg.conf
[Interface]
PrivateKey = cHHr3FdJpfV04bZgyYE5WqdGwW7325YEL9REQi9VrFA=
Address = 10.0.0.218/24
DNS = 8.8.8.8
MTU = 1420
PreUp = start .\route\routes-up.bat
PostDown = start .\route\routes-down.bat
[Peer]
PublicKey = lRtbbz6Vjsfp0M/JT/pevYQFmp6nEWLEcT3ruTurozI=
Endpoint = *.*.*.*:50059
AllowedIPs = 10.0.0.0/8
PersistentKeepalive = 25

配置开机启动
systemctl enable wg-quick@wg