以下是在 Debian 12 下的测试:
先是:apt update && apt upgrade -y
root@hqw:~# apt update && apt upgrade -y
Hit:1 http://deb.debian.org/debian bookworm InRelease
Get:2 http://deb.debian.org/debian bookworm-updates InRelease [55.4 kB]
Get:3 http://security.debian.org/debian-security bookworm-security InRelease [48.0 kB]
Get:4 http://security.debian.org/debian-security bookworm-security/main Sources [197 kB]
Get:5 http://security.debian.org/debian-security bookworm-security/main amd64 Packages [291 kB]
Get:6 http://security.debian.org/debian-security bookworm-security/main Translation-en [177 kB]
Fetched 768 kB in 0s (2,120 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
…………
然后是:bash <(curl -Ls https://raw.githubusercontent.com/angristan/wireguard-install/master/wireguard-install.sh)
root@hqw:~# bash <(curl -Ls https://raw.githubusercontent.com/angristan/wireguard-install/master/wireguard-install.sh)
Welcome to the WireGuard installer!
The git repository is available at: https://github.com/angristan/wireguard-install
I need to ask you a few questions before starting the setup.
You can keep the default options and just press enter if you are ok with them.
IPv4 or IPv6 public address: 23.105.x.x
Public interface: eth0
WireGuard interface name: wg0
Server WireGuard IPv4: 10.66.66.1
Server WireGuard IPv6: fd42:42:42::1
Server WireGuard port [1-65535]: 端口号自己输
First DNS resolver to use for the clients: 1.1.1.1
Second DNS resolver to use for the clients (optional): 8.8.8.8
…………
Your client config file is in /root/wg0-client-mooncat.conf
If you want to add more clients, you simply need to run this script another time!
WireGuard is running.
在这期间,脚本会一步步问你:
IPv4 address → 回车(自动识别)
Network interface → 回车
Server port →
建议改成 非默认端口,比如:51888
Client name → 随便(如:myphone)
DNS → 选 1.1.1.1 或 8.8.8.8
安装完成后你会看到: