Warm tip: This article is reproduced from serverfault.com, please click

networking-OpenVPN客户端请求255.255.255.252子网,服务器拒绝/ 29以下的任何内容

(OpenVPN client requests 255.255.255.252 subnet, server refuses anything below /29)

发布于 2021-03-19 03:00:41

我已经使用以下网络设置设置了OpenVPN服务器:

topology subnet
server 192.168.123.0 255.255.255.0
push "dhcp-option DNS 192.168.123.1"      # DNS to server VPN IP
push "route 192.168.2.0 255.255.255.0"    # Workstations addresses via VPN
keepalive 10 120

所以:

  • 192.168.2。* =公司局域网
  • 192.168.123。* = VPN局域网

Linux客户端能够连接,但是Windows 7系统失败并显示以下错误:

选择--ifconfig端点[local = 192.168.123.2,remote = 255.255.255.248]时出现问题。本地和远程VPN端点必须存在于相同的255.255.255.252子网内。与TAP-WIN32驱动程序一起使用时,这是--dev tun的限制。尝试'openvpn --show-valid-subnets'....

这是连接初始化后的完整输出:

Thu Jul 01 09:36:55 2010 [server.FOOBAR] Peer Connection Initiated with 84.80.YYY.ZZZ
Thu Jul 01 09:36:56 2010 SENT CONTROL [server.FOOBAR]: 'PUSH_REQUEST' (status=1)
Thu Jul 01 09:36:56 2010 PUSH: Received control message: 'PUSH_REPLY,route 192.168.2.0 255.255.255.252,dhcp-option DNS 192.168.123.1,route-gateway 192.168.123.1,topology subnet,ping 10,ping-restart 120,ifconfig 192.168.123.2 255.255.255.248'
Thu Jul 01 09:36:56 2010 Options error: Unrecognized option or missing parameter(s) in [PUSH-OPTIONS]:4: topology (2.0.9)
Thu Jul 01 09:36:56 2010 OPTIONS IMPORT: timers and/or timeouts modified
Thu Jul 01 09:36:56 2010 OPTIONS IMPORT: --ifconfig/up options modified
Thu Jul 01 09:36:56 2010 OPTIONS IMPORT: route options modified< al>Thu Jul 01 09:36:56 2010 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
Thu Jul 01 09:36:56 2010 WARNING: Since you are using --dev tun, the second argument to --ifconfig must be an IP address.  You are using something (255.255.255.
248) that looks more like a netmask. (silence this warning with --ifconfig-nowarn)
Thu Jul 01 09:36:56 2010 There is a problem in your selection of --ifconfig endpoints [local=192.168.123.2, remote=255.255.255.248].  The local and remote VPN endpoints must exist within the same 255.255.255.252 subnet.  This is a limitation of --dev tun when used with the TAP-WIN32 driver.  Try 'openvpn --show-valid-subnets' ....

任何将服务器设置更改为252范围的尝试都会导致以下错误:

选项错误:--server指令与--dev tun一起使用时,必须定义一个255.255.255.248(/ 29)或更低的子网

我需要设置哪些服务器设置以使该客户端连接?服务器运行OpenVPN 2.1.1,Windows 7客户端运行OpenVPN 2.0.9(来自http://openvpn.se的最新稳定版本


@Evan:这是我的客户端配置,不是很令人兴奋:

client
dev tun

proto tcp
remote 84.80.203.199 1194
resolv-retry 2
nobind

# Server keys
ca SERVER-ca.crt
tls-auth SERVER-ta.key 1

# Client key
cert SOMEONE.crt
key SOMEONE.key

# Server settings to copy
comp-lzo

# Downgrade privileges after initialization (non-Windows only)
user nobody
group guest

# Try to preserve some state across restarts.
persist-key
persist-tun

# Verify server
ns-cert-type server

verb 3

;cipher x
;mute 20
;mute-replay-warnings
Questioner
vdboor
Viewed
221
Christopher Cashell 2010-07-02 03:56:40

首先,将Windows Vista客户端更新为最新的OpenVPN Windows版本,尤其是2.1.x版本在2.0.x和2.1.x之间很多重大更改。我并不是说这绝对是问题,但我不想尝试。特别是当连接的完整输出显示“选项错误”和警告时。

更新Windows客户端后,如果仍不能解决问题,我将尝试使用verb 4verb 6增加日志详细程度来同时运行服务器和客户端这可以帮助你查明问题出在哪里。