我有openvpn安装在我的VPS
现在我试图做的是让客户有自己的IP
到目前为止,当一个客户端连接到我的VPN(2.2.2.2示例IP) – 他们会得到相同的IP作为我的服务器(2.2.2.2)。
我现在想要的是让他们有:2.2.2.3或2.2.2.4等等。
为服务器和客户端configuration:(只要find客户端和服务器configuration) http://freenuts.com/how-to-set-up-openvpn-in-a-vps/
我不确定你对示例服务器configuration做了什么,这会导致客户端获得与服务器相同的IP,但这当然是错误的。
以下是来自示例configuration的相关块:
# Configure server mode and supply a VPN subnet # for OpenVPN to draw client addresses from. # The server will take 10.8.0.1 for itself, # the rest will be made available to clients. # Each client will be able to reach the server # on 10.8.0.1. Comment this line out if you are # ethernet bridging. See the man page for more info. server 10.8.0.0 255.255.255.0
你有没有在server行255.255.255.255或类似的东西做networking掩码?
如果要为客户指定特定IP,则可以设置CCD文件,其中每个文件的名称是为客户端生成的证书上的CommonName。
在服务器configuration中,添加:
client-config-dir /etc/openvpn/ccd
如果您的客户的证书名为Client1,那么您将拥有一个文件/etc/openvpn/ccd/Client ,该文件具有:
ifconfig-push 10.8.0.101 10.8.0.102
这将导致Client1获得VPN IP 10.8.0.101。