WireGuard
搭建 WireGuard VPN 服务器的步骤包括在服务器上安装 WireGuard、配置 WireGuard、生成密钥、以及在客户端配置连接。下面是一个基本的搭建过程:
1. 安装 WireGuard
分别在云服务器和内网服务器上安装 WireGuard:
sudo apt update
sudo apt install wireguard
云服务器充当服务器,内网服务器充当客户端。
2. 生成密钥对
WireGuard 使用公钥和私钥进行加密通信。分别在云服务器和内网服务器上执行以下命令:
wg genkey | tee privatekey | wg pubkey > publickey
两台服务器都生成了秘钥文件:
privatekey
publickey