无法从 Windows 客户端连接到 OpenVPN 服务器

无法从 Windows 客户端连接到 OpenVPN 服务器

我设置了一个 openVPN 服务器,它可以在 Android 设备和 Linux 桌面上运行。但是,我有一个客户端可以使用my.ovpn我提供的 Android 设备进行连接,但当他尝试使用mywindows.ovpnWindows10 系统时,他收到以下错误。

Options error: --up script fails with
'/etc/openvpn/update-resolv-conf': No such process (errno=3)
Options error: Please correct this error.
Use --help for more information

my.ovpn文件和文件之间的唯一区别mywindows.ovpn是行

user nobody
group nogroup

被取消注释,my.ovpn而它们被注释,如下mywindows.ovpn所示:

#user nobody
#group nogroup

我是否忘记在文件中实现其他更改,*.ovpn或者是否必须在服务器端设置额外的配置。

更新

以下是 mywindows.ovpn 内容的副本

client

;dev tap
dev tun

;dev-node MyTap

;proto tcp
proto udp

remote myserver.com 1194
;remote my-server-2 1194

;remote-random

resolv-retry infinite

nobind

#user nobody
#group nogroup

persist-key
persist-tun

;http-proxy-retry # retry on connection failures
;http-proxy [proxy server] [proxy port #]

;mute-replay-warnings

#ca ca.crt
#cert client.crt
#key client.key

remote-cert-tls server

;tls-auth ta.key 1

cipher AES-128-CBC
auth SHA256

key-direction 1

comp-lzo

verb 3

;mute 20

# script-security 2
# up /etc/openvpn/update-resolv-conf
# down /etc/openvpn/update-resolv-conf

<ca>
-----BEGIN CERTIFICATE-----
xxxxxxxxxxxxxxxxxxxxxxxxxxx
-----END CERTIFICATE-----
</ca>
<cert>
...
-----BEGIN CERTIFICATE-----
xxxxxxxxxxxxxxxxxxxxxxxxx
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN PRIVATE KEY-----
xxxxxxxxxxxxxxxxxxxxxxxxx
-----END PRIVATE KEY-----
</key>
<tls-auth>
#
# 2048 bit OpenVPN static key
#
-----BEGIN OpenVPN Static key V1-----
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-----END OpenVPN Static key V1-----
</tls-auth>

答案1

尝试这个:

client
dev tun
proto udp

remote myserver.com 1194
;remote my-server-2 1194

resolv-retry infinite
nobind

persist-key
persist-tun

ca [inline]
cert [inline]
key [inline]
tls-auth [inline] 1
remote-cert-tls server
cipher AES-128-CBC
auth SHA256
comp-lzo

verb 3

<ca>
-----BEGIN CERTIFICATE-----
xxxxxxxxxxxxxxxxxxxxxxxxxxx
-----END CERTIFICATE-----
</ca>
<cert>
-----BEGIN CERTIFICATE-----
...
xxxxxxxxxxxxxxxxxxxxxxxxx
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN PRIVATE KEY-----
xxxxxxxxxxxxxxxxxxxxxxxxx
-----END PRIVATE KEY-----
</key>
<tls-auth>
#
# 2048 bit OpenVPN static key
#
-----BEGIN OpenVPN Static key V1-----
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-----END OpenVPN Static key V1-----
</tls-auth>

主要是清除了多余的设置并明确声明证书是内联的。另外,请确保您的用户没有尝试将 Android 配置与 Windows 客户端一起使用(如果位于同一文件夹中,请将其移动,以确保安全)。

相关内容