【问题标题】:Wireguard server connecting to clientWireguard 服务器连接到客户端
【发布时间】:2022-01-17 18:00:06
【问题描述】:

我有两个 Wireguard 对等体,都在同一个网络上。有一段时间,我一直将服务器端点放在“客户端”上并连接到服务器。现在,我想将客户端端点放在服务器上并从服务器连接。但是,它不起作用。

服务器配置:

[Interface]
Address = 10.200.200.1/32
ListenPort = 2000
PrivateKey = *************
MTU=1420

# substitute eth0 in the following lines to match the Internet-facing interface
# if the server is behind a router and receives traffic via NAT, these iptables rules are not needed
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o enp0s2 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o enp0s2 -j MASQUERADE


[Peer]
# Macbook
PublicKey = *************************
#PresharedKey = PRE-SHARED_KEY
Endpoint = 192.168.1.212:2000
AllowedIPs = 10.200.200.3/32

#PersistentKeepalive = 25

客户端配置:

[Interface]
Address = 10.200.200.3/32
DNS = 10.200.200.1
MTU = 1420
ListenPort = 2000
PrivateKey = *********************
[Peer]
# Computer
AllowedIPs = 0.0.0.0/0, ::0
PublicKey = *********************

【问题讨论】:

    标签: wireguard


    【解决方案1】:

    好吧,显然,如果你放置一个客户端端点,服务器必须首先接触到客户端(例如sshping)。这是因为 Wireguard 仅在必须连接时才连接。

    【讨论】:

      猜你喜欢
      • 2021-07-01
      • 2020-11-26
      • 1970-01-01
      • 2013-12-26
      • 2023-04-09
      • 1970-01-01
      • 2016-07-06
      • 1970-01-01
      相关资源
      最近更新 更多