我打开一个openvpn服务器,将支持多个客户端到一个私人子网。 因此,在私有子网上,连接的客户端将获得IP地址,例如10.8.0.10,10.8.0.11等
我需要的一个设施是客户能够find对方。 是否有任何简单和普遍接受的方式让客户端看到分配给所有客户端的IP地址列表?
我不需要DNS名称或类似的东西。
在OpenVPN服务器configuration文件中,先决条件是以下指令:
# Uncomment this directive to allow different # clients to be able to "see" each other. # By default, clients will only see the server. # To force clients to only see the server, you # will also need to appropriately firewall the # server's TUN/TAP interface. client-to-client
为了方便客户轻松找对方,我build议dynamicDNS作为(一般)企业解决scheme。 要列出活动客户列表,您可以:
这里是支持OpenVPN 2.x客户端到客户端function的原始链接:
https://openvpn.net/index.php/open-source/documentation/howto.html#scope
取消该指令的注释以允许不同的客户端能够“看到”彼此。 默认情况下,客户端只能看到服务器。 要强制客户端只能看到服务器,您还需要适当地防火墙服务器的TUN / TAP接口。
;client-to-client
如果希望连接客户端以便能够通过VPN到达对方,请取消注释掉上述客户端到客户端的指令。 默认情况下,客户端将只能访问服务器。
接下来,问问自己是否要允许客户端2的子网(192.168.4.0/24)和OpenVPN服务器的其他客户端之间的networking通信。 如果是这样,请将以下内容添加到服务器configuration文件中。
client-to-client push "route 192.168.4.0 255.255.255.0"
这将导致OpenVPN服务器向其他连接客户端通告客户端2的子网。