大网数据广告活动
服务器运维问答

Why "Connection reset by peer" when i'm trying to connect to server in OpenVPN?

· 52CE 我爱测

I've got a computer with OpenVPN server behind the NAT. When I try to connect to it from client side and I got following error: read UDPv4: Connection reset by peer (WSAECONNRESET) (code=10054) I've configured forwarding for 1194…

问题原文

原帖链接 · Dmitrii Mikhailov · CC BY-SA 4.0

I've got a computer with OpenVPN server behind the NAT. When I try to connect to it from client side and I got following error:

read UDPv4: Connection reset by peer (WSAECONNRESET) (code=10054)

I've configured forwarding for 1194 port in my router for both TCP and UDP. Here is config file for server:

port 1194

proto udp

dev tun

ca /etc/openvpn/easy-rsa/keys/ca.crt
cert /etc/openvpn/easy-rsa/keys/server.crt
key /etc/openvpn/easy-rsa/keys/server.key  # This file should be kept secret

dh dh2048.pem

server 10.8.0.0 255.255.255.0

ifconfig-pool-persist ipp.txt

keepalive 10 120

comp-lzo

persist-key
persist-tun

status openvpn-status.log

verb 3

And here are my client's configuration:

client

dev tun

proto udp


remote XXX.XXX.XXX.XXX 1194

resolv-retry infinite

nobind

persist-key
persist-tun

ca ca.crt
cert my-laptop.crt
key my-laptop.key

ns-cert-type server

comp-lzo

verb 3

I've tried to follow this Quick Start tutorial but for some reason it didn't help me to start quickly.

已采纳解答

原帖链接 · blacklight · CC BY-SA 3.0

Check your certificates - (Use OpenSSL to do this). I've seen this error when trying to use a malformed certificate and/or key.

If your certificates are fine - try switching to TCP and see if that helps.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2013-10-07)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0 / CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。