0

I'm setting up an OpenVPN access server and I continuously get the error "connection refused" on my client(s). So i decided to start debugging from the beginning (the server) and tried telnet 127.0.0.1 2194. The result:

openvpn_as_test_1:~$ telnet 127.0.0.1 2194
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused

So this means the issue is on the server so I checked if the port is open in ufw with sudo ufw status and noticed the port was not allowed by the firewall. After adding the port with ufw allow 2194/udp (and ufw allow 2194/tcp even when this is needed). After checking ufw status again, this was the result:

Status: active

To                         Action      From
--                         ------      ----
2194/udp                   ALLOW       Anywhere
2194/tcp                   ALLOW       Anywhere
22                         ALLOW       Anywhere
2194/udp (v6)              ALLOW       Anywhere (v6)
2194/tcp (v6)              ALLOW       Anywhere (v6)
22 (v6)                    ALLOW       Anywhere (v6)

The port is allowed by the internal firewall so i tried telnet 127.0.0.1 2194 again and guess what, still connection refused:

openvpn_as_test_1:~$ telnet 127.0.0.1 2194
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused

Ok, what else could be te problem? maybe telnet does not work properly so i tried telnet 127.0.0.1 22:

openvpn_as_test_1:~$ telnet 127.0.0.1 22
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.3

Great, telnet is working fine so.. lets check netstat to see if we listen to port 2194:

openvpn_as_test_1:~$ netstat -al | grep "LISTEN"
tcp        0      0 0.0.0.0:943             0.0.0.0:*               LISTEN
tcp        0      0 localhost:domain        0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:ssh             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:https           0.0.0.0:*               LISTEN
tcp        0      0 localhost:904           0.0.0.0:*               LISTEN
tcp        0      0 localhost:905           0.0.0.0:*               LISTEN
tcp        0      0 localhost:906           0.0.0.0:*               LISTEN
tcp        0      0 localhost:907           0.0.0.0:*               LISTEN
tcp        0      0 localhost:908           0.0.0.0:*               LISTEN
tcp        0      0 localhost:909           0.0.0.0:*               LISTEN
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN
unix  2      [ ACC ]     SEQPACKET  LISTENING     13660    /run/udev/control
unix  2      [ ACC ]     STREAM     LISTENING     22260    /run/user/1000/systemd/private
unix  2      [ ACC ]     STREAM     LISTENING     22264    /run/user/1000/gnupg/S.gpg-agent.ssh
unix  2      [ ACC ]     STREAM     LISTENING     22265    /run/user/1000/snapd-session-agent.socket
unix  2      [ ACC ]     STREAM     LISTENING     22266    /run/user/1000/gnupg/S.dirmngr
unix  2      [ ACC ]     STREAM     LISTENING     22267    /run/user/1000/gnupg/S.gpg-agent.extra
unix  2      [ ACC ]     STREAM     LISTENING     22268    /run/user/1000/gnupg/S.gpg-agent.browser
unix  2      [ ACC ]     STREAM     LISTENING     22269    /run/user/1000/gnupg/S.gpg-agent
unix  2      [ ACC ]     STREAM     LISTENING     13568    /run/systemd/private
unix  2      [ ACC ]     STREAM     LISTENING     13578    /run/systemd/journal/stdout
unix  2      [ ACC ]     STREAM     LISTENING     16810    /run/uuidd/request
unix  2      [ ACC ]     STREAM     LISTENING     16816    /var/run/dbus/system_bus_socket
unix  2      [ ACC ]     STREAM     LISTENING     16828    /run/acpid.socket
unix  2      [ ACC ]     STREAM     LISTENING     16830    /run/snapd.socket
unix  2      [ ACC ]     STREAM     LISTENING     16832    /run/snapd-snap.socket
unix  2      [ ACC ]     STREAM     LISTENING     13662    /run/lvm/lvmpolld.socket
unix  2      [ ACC ]     STREAM     LISTENING     13839    /run/lvm/lvmetad.socket
unix  2      [ ACC ]     STREAM     LISTENING     16861    /var/lib/lxd/unix.socket
unix  2      [ ACC ]     STREAM     LISTENING     20300    /usr/local/openvpn_as/etc/sock/sagent
unix  2      [ ACC ]     STREAM     LISTENING     20303    /usr/local/openvpn_as/etc/sock/sagent.localroot
unix  2      [ ACC ]     STREAM     LISTENING     20304    /usr/local/openvpn_as/etc/sock/sagent.api
unix  2      [ ACC ]     STREAM     LISTENING     16865    @ISCSIADM_ABSTRACT_NAMESPACE

Port 2194 is not listed here. Ok, now I have no idea how to continue. Where is my issue?

  • 3
    Is the daemon that is providing your service on port 2194 actually running? Is it a TCP service or an UDP service? – Kusalananda May 7 at 14:17
  • I'm new to OpenVPN Access Server and i cannot find anything how i can check if the server is running on that port. I assume it does as i configured this port in the admin interface. It should be an UDP service. --- Tomorrow i will continue testing and try to figure out if there is a way to test if the service really uses 2194 as my assumption may be tricky – CodeNinja May 7 at 14:32
  • 2
    Connection refused means either your firewall refused it or there is no listener. According to the output of netstat, there is no listener. So, the service is either not running or you confuse it with another port number that is actually listed. – rexkogitans May 7 at 19:23
  • For some reason telnet 127.0.0.1 2194 says that the connection is refused but i got OpenVPN AS working now via that port. So problem is solved (added a missing route in firewall) but does still not explain why telnet on localhost does refuse connection but doesn't matter anymore now. – CodeNinja May 11 at 10:29
1

I think you have allowed the wrong port on ufw: you're trying to use port 2194 for telnet and you've allowed port 1194 according to the output of ufw show status you posted.

| improve this answer | |
  • OMG, how stupid! I added the correct port but this still results in the same issue. I updated my question as well. – CodeNinja May 7 at 14:28

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.