将OpenVPN服务器的tun0地址从xxx.xxx.xxx.1更改为xxx.xxx.xxx.11

openvpn服务器的configuration文件中,我有行server 192.168.20.0 255.255.255.0

这将导致tun0被创build为inet addr:192.168.20.**1** PtP:192.168.20.**2** Mask:255.255.255.255

我需要做些什么来改变成inet addr:192.168.20.**11** PtP:192.168.20.**12** Mask:255.255.255.255

我尝试添加ifconfig 192.168.20.11 192.168.20.12到configuration文件,但这是行不通的。

遵循Zoredache的build议(RTFM'man openvpn')

而不是使用server 192.168.20.0 255.255.255.0我现在正在使用

 mode server tls-server ifconfig 192.168.20.11 192.168.20.12 ifconfig-pool 192.168.20.4 192.168.20.8 route 192.168.20.0 255.255.255.0 push "route 192.168.20.0 255.255.255.0" 

并在客户端的ccd文件中

 ifconfig-push 192.168.20.1 192.168.20.2 

这工作。

如果你参考OpenVPN的手册页,你会看到--server是一个别名/macros指令,执行一堆configuration选项。 你不必使用--server你可以应用单独的configuration指令。

所以,如果你删除了你的服务器行,我相信你的configuration可能是这样的。

 mode server tls-server topology subnet # ip of server ifconfig 192.168.20.11 255.255.255.0 # range offered to clients. ifconfig-pool 192.168.20.1 192.168.20.10 255.255.255.0 

男人openvpn

 --server A helper directive designed to simplify the configuration of OpenVPN's server mode. This directive will set up an OpenVPN server which will allocate addresses to clients out of the given network/netmask. The server itself will take the ".1" address of the given network for use as the server-side endpoint of the local TUN/TAP interface. For example, --server 10.8.0.0 255.255.255.0 expands as follows: mode server tls-server push "topology [topology]" if dev tun AND (topology == net30 OR topology == p2p): ifconfig 10.8.0.1 10.8.0.2 if !nopool: ifconfig-pool 10.8.0.4 10.8.0.251 route 10.8.0.0 255.255.255.0 if client-to-client: push "route 10.8.0.0 255.255.255.0" else if topology == net30: push "route 10.8.0.1" if dev tap OR (dev tun AND topology == subnet): ifconfig 10.8.0.1 255.255.255.0 if !nopool: ifconfig-pool 10.8.0.2 10.8.0.254 255.255.255.0 push "route-gateway 10.8.0.1" Don't use --server if you are ethernet bridging. Use --server-bridge instead. 

我不认为这是可能的。 我假设你在192.168.20.1 – 10上有你想要在同一个子网上的东西。 根据您的情况,您可能可以使用不同的子网OpenVPN,并通过在192.168.20子网上添加一条静态路由,并使用OpenVPN的pushroute指令添加路由到192.168.20子网VPN客户端。