wireduard之前搭建过。在此不做赘述。图简单的话,可以拉docker的wg-easy进行运行。
搭建好之后,服务器给windows生成配置。
[Interface]
PrivateKey = 私钥
Address = 10.8.0.3/24
[Peer]
PublicKey = 公钥
PresharedKey = Xtz5vzzicOncQe3Dt8LMFIbdxa/XUepY9hAllrJ3k30=
AllowedIPs = 10.8.0.0/24
Endpoint = 152.136.153.72:51820然后开始macos的操作,首先,你需要有一个Homebrew来用于安装软件。
macos安装wireguard步骤
1. 安装 WireGuard
使用 Homebrew 安装 WireGuard 工具包:
brew install wireguard-tools3. 配置 WireGuard
使用下面的命令创建配置文件:
sudo vim /opt/homebrew/etc/wireguard/wg0.conf编辑配置文件,添加以下内容:
[Interface]
PrivateKey = 私钥
Address = 10.8.0.7/24
MTU = 1540
[Peer]
PublicKey = 公钥
PresharedKey =
AllowedIPs = 10.8.0.0/24
Endpoint = 152.136.153.72:51820
PersistentKeepalive = 25一切配置好之后,安装图形化界面WireGuardStatusbar
去https://github.com/aequitas/macos-menubar-wireguard这个链接下载文件安装。安装完毕之后,启动wg0这个就可以了。
不想安装的话可以使用这个命令去
开启
sudo wg-quick up wg0关闭
sudo wg-quick down wg0