0

So I have a server set up on my digitalOcean account and after going through the process of setting up a client, i try to connect running

openvpn --config client.ovpn

but it shows this

Tue May 16 14:09:21 2017 OpenVPN 2.4.1 i686-redhat-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Mar 28 2017 Tue May 16 14:09:21 2017 library versions: OpenSSL 1.0.2k-fips 26 Jan 2017, LZO 2.08 Tue May 16 14:09:21 2017 WARNING: --ns-cert-type is DEPRECATED. Use --remote-cert-tls instead. Tue May 16 14:09:21 2017 TCP/UDP: Preserving recently used remote address: [AF_INET]:1194 Tue May 16 14:09:21 2017 Socket Buffers: R=[87380->87380] S=[16384->16384] Tue May 16 14:09:21 2017 Attempting to establish TCP connection with [AF_INET]:1194 [nonblock] Tue May 16 14:09:23 2017 TCP: connect to [AF_INET]:1194 failed: Connection refused Tue May 16 14:09:23 2017 NOTE: UID/GID downgrade will be delayed because of --client, --pull, or --up-delay Tue May 16 14:09:23 2017 SIGUSR1[connection failed(soft),init_instance] received, process restarting

My server config is:

  • port 1194
  • proto tcp
  • dev tun
  • ca ca.crt
  • cert server.crt
  • key server.key
  • dh dh2048.pem
  • server 10.8.0.0 255.255.255.0
  • ifconfig-pool-persist ipp.txt
  • push "redirect-gateway def1 bypass-dhcp"
  • push "dhcp-option DNS 208.67.222.222"
  • push "dhcp-option DNS 208.67.220.220"
  • keepalive 10 120
  • cipher BF-CBC # Blowfish (default)
  • comp-lzo
  • user nobody
  • group nobody
  • persist-key
  • persist-tun
  • status openvpn-status.log
  • verb 3

With everything else commented out.

My client.ovpn is:

  • dev tun
  • proto tcp
  • remote 1194
  • resolv-retry infinite
  • nobind
  • user nobody
  • group nobody
  • persist-key
  • persist-tun
  • ca ca.crt
  • cert client1.crt
  • key client1.key
  • ns-cert-type server
  • cipher BF-CBC
  • comp-lzo
  • verb 3

with everything else commented out. I think it may have something to do with my iptable rules, but i'm not sure if I should paste below because of how long it is. If you think you would need to see to solve the problem just let me know and I'd be happy to paste it. I rather new to openvpn and just trying to learn how it works so any help would be much appreciated.

  • First look on server that is vpn in running state and in listen state. For first is command systemctl status openvpn and for listening state netstat -atnp. If you see something like 0.0.0.0 tcp 1194 listening then try from pc this command nc -v <ip_address_of_server 1194. If you got connection, problem is setup of openvpn if you can not establish connection, problem is iptables. – 2707974 May 16 '17 at 19:07
  • So when i ran 'systemctl status openvpn' it showed it was active (with green font) so I assume that means its in running state. When I used the command 'netstat -atnp' it gave me a rather lengthy list but nothing with 0.0.0.0 tcp 1194 and nothing with the port 1194 mentioned anywhere on it. Should I still run the 'nc -v' command? – RandomUser May 16 '17 at 19:16
  • Run command. With that command you will try to connect make tcp connection to vpn on port 1194. If you do not have connection, edit your question and put output from iptables and command netstat -atnp – 2707974 May 16 '17 at 19:32
  • when i run the 'nc -v ' command it says inverse host lookup failed: Unknown host (UNKNOWN) [<server ip>] 1194 (openvpn) : Connection refused I run this command on the vpn server correct? – RandomUser May 16 '17 at 19:36
  • To clarify, if you server is on ip 123.456.789.123, command will be nc -v 123.456.789.123 1194 – 2707974 May 16 '17 at 19:54

Your Answer

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

Browse other questions tagged or ask your own question.