在 Proxmox 主机上运行 Wireguard 客户端

在 Proxmox 主机上运行 Wireguard 客户端

我正在尝试将 Proxmox 安装设置为现有 Wireguard 服务器的客户端,以便从我的家庭网络外部进行连接。

我遵循了本指南 https://www.server-world.info/en/note?os=Debian_11&p=wireguard&f=2

然后运行

systemctl enable [email protected]
systemctl start [email protected]

但状态为活动:活动(已退出)并且我从未在服务器端看到任何连接。

这是我安装和配置后得到的:

    root@algo:~# systemctl status [email protected][email protected] - WireGuard via wg-quick(8) for wg0
     Loaded: loaded (/lib/systemd/system/[email protected]; enabled; preset: enabled)
     Active: active (exited) since Wed 2023-10-25 12:58:25 CEST; 5min ago
       Docs: man:wg-quick(8)
             man:wg(8)
             https://www.wireguard.com/
             https://www.wireguard.com/quickstart/
             https://git.zx2c4.com/wireguard-tools/about/src/man/wg-quick.8
             https://git.zx2c4.com/wireguard-tools/about/src/man/wg.8
    Process: 777 ExecStart=/usr/bin/wg-quick up wg0 (code=exited, status=0/SUCCESS)
   Main PID: 777 (code=exited, status=0/SUCCESS)
        CPU: 25ms

Oct 25 12:58:25 algo systemd[1]: Starting [email protected] - WireGuard via wg-quick(8) for wg0...
Oct 25 12:58:25 algo wg-quick[777]: [#] ip link add wg0 type wireguard
Oct 25 12:58:25 algo wg-quick[777]: [#] wg setconf wg0 /dev/fd/63
Oct 25 12:58:25 algo wg-quick[777]: [#] ip -4 address add 12.187.257.16 dev wg0
Oct 25 12:58:25 algo wg-quick[777]: [#] ip link set mtu 1420 up dev wg0
Oct 25 12:58:25 algo wg-quick[777]: [#] ip -6 route add ::/1 dev wg0
Oct 25 12:58:25 algo wg-quick[777]: [#] ip -6 route add 8000::/1 dev wg0
Oct 25 12:58:25 algo wg-quick[777]: [#] ip -4 route add 128.0.0.0/1 dev wg0
Oct 25 12:58:25 algo wg-quick[777]: [#] ip -4 route add 0.0.0.0/1 dev wg0
Oct 25 12:58:25 algo systemd[1]: Finished [email protected] - WireGuard via wg-quick(8) for wg0.
root@algo:~#

使用 wg 我得到了这个:

interface: wg0
public key: tgiehhoZKLHNCjebdsf64uyIgTUQNVJiXahPEYVBcH0k=
private key: (hidden) listening port: 58649
peer: 8bfBMSRm2emrzchft6356dgm2UggkPbeStfwE7UdLi4=
endpoint: 12.187.257.16:1194
allowed ips: 0.0.0.0/1, 128.0.0.0/1, ::/1, 8000::/1
transfer: 0 B received, 1.59 KiB sent
root@algo:~#

这是 wg0.conf

[Interface]
# specify private key for client generated on WireGuard server
PrivateKey = XXXXXXXXXXXXX
# IP address for VPN interface
Address = 10.198.273.61

[Peer]
# specify public key for server generated on WireGuard server
PublicKey = XXXXXXXXXXXXX
# IP addresses you allow to connect
# on the example below, set WireGuard server's VPN IP address and real local network
AllowedIPs = 0.0.0.0/1, 128.0.0.0/1, ::/1, 8000::/1
# specify server's global IP address:port
# (acutually, example of IP below is for private range, replace to your own global IP)
EndPoint = 103.16.54.18:1194

我没有收到任何错误,但我没有看到服务器上的连接

您知道可能存在什么问题吗?

在 Windows 11 上使用 Wireguard 时,相同的客户端配置可以正常工作。

谢谢!

相关内容