I've Configure an OpenVPN (2.0.9) on a CentOS 6.2 (2.6.32-358.2.1.el6.x86_64) to accept OpenVPN client connection. But when I try to connect from Windows 7 by OpenVPN client tool it return me some error:

Server side OpenVPN Config

Client Side OpenVPN Config

Client Side OpenVPN Log

Windows firewall is off
iptables (server) is off

any idea?

  • No logs on the server? You may increase the log file verbosity on the client. – Hauke Laging Apr 15 '13 at 22:25

In your server config, "listen localhost" is wrong. That would listen on (or similar), meaning it would not accept connections from outside the box. Your comment next to it doesn't make sense either; and also, you'd normally listen on a public IP.

Assuming the above is anonimizing (which you forgot to do in the client config):

  • The ; comments are OK (thanks to TNW for pointing this out).
  • Its somewhat weird that your server config does not give the path to the CA, key, and certificate. Possibly its not finding them?
  • you have a host firewall on your server (or somewhere inbetween) that's blocking the packet to UDP/1194.
  • you didn't actually start the server (possibly due to some error in the config—maybe one of the above—preventing it from starting, but you didn't provide a server log).

Further, glancing quickly at the config:

  • you push "dhcp-option DNS " ... You probably shouldn't do that. You'd typically only push a DNS server if you were pushing a private one, to be accessed over the VPN (so clients could use internal hostnames). And if you want a generic public DNS server, Google actually offers a few— isn't offered as such (at least not officially).
  • you ought to heed that warning about MITM attacks in your client log, and read http://openvpn.net/index.php/open-source/documentation/howto.html#mitm like it says. It may not apply since you're probably using a private CA—at least, if you trust everyone the private CA has given a certificate to.
  • thank you for your advice :) I made some changes (comment local directive at all) but when try to connect from client it return me this error : – Sassan torabkheslat Apr 16 '13 at 3:35
  • OpenVPN supports ; comments. That comes with default config files, and it's a good way to distinguish options from their descriptions visually. – TNW Apr 16 '13 at 6:01
  • @Sasantorabkheslat Up your verbose level. And it'd be helpful to get the server log, too. Possibly with a higher verbosity. – derobert Apr 16 '13 at 15:25
  • @TNW Thank you, answer updated w/r/t the ;-style comments – derobert Apr 16 '13 at 15:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.