Dear ladies and gentlemen! I know that there is a lot of questions typical to mine in the Internet, but I could not find the solution anywhere. Maybe someone here can help me?
I have a VPS with Ubuntu 20.04, and there I have installed an OpenVPN server; it worked for several months until today all the clients unexpectedly became unable to connect. I deleted and reinstalled/reconfigured VPN, but it does not work though. It should establish TCP connection through the port 1194 (first it was 993, but now I had tried 1194, and both are not working). Moreover, openvpn even does not listen to any of my ports, while it is active.
netstat -tulpn | grep LISTEN
tcp 0 0 0.0.0.0:19597 0.0.0.0:* LISTEN 988/xe_d000_XE
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 193/systemd-resolve
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 326/sshd: /usr/sbin
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 12098/cupsd
tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 453/postgres
tcp6 0 0 :::80 :::* LISTEN 356/apache2
tcp6 0 0 :::1521 :::* LISTEN 794/tnslsnr
tcp6 0 0 :::22 :::* LISTEN 326/sshd: /usr/sbin
tcp6 0 0 :::5432 :::* LISTEN 453/postgres
sudo systemctl status openvpn
● openvpn.service - OpenVPN service
Loaded: loaded (/lib/systemd/system/openvpn.service; enabled; vendor prese>
Active: active (exited) since Mon 2024-02-12 21:23:41 EET; 3h 18min ago
Process: 306 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 306 (code=exited, status=0/SUCCESS)
Feb 12 21:23:41 vm-6959-vm454191 systemd[1]: Starting OpenVPN service...
Feb 12 21:23:41 vm-6959-vm454191 systemd[1]: Finished OpenVPN service.
Here is my server.conf file:
key server.key
dh dh.pem
auth SHA512
tls-crypt tc.key
topology subnet
server 10.8.0.0 255.255.255.0
server-ipv6 fddd:1194:1194:1194::/64
push "redirect-gateway def1 ipv6 bypass-dhcp"
ifconfig-pool-persist ipp.txt
push "dhcp-option DNS 1.1.1.1"
push "dhcp-option DNS 1.0.0.1"
push "block-outside-dns"
keepalive 10 120
user nobody
group nogroup
persist-key
persist-tun
"server.conf" 25L, 467C local ##MY IP
port 1194
proto tcp
dev tun
ca ca.crt
cert server.crt
Can someone graciously help me to understand how to fix the issue, please?
UPDATE:
I have reinstalled openvpn, but it does not listen to any port though. There is the following information in the logs (this message appears every 5 seconds):
Feb 13 20:12:20 vm-6959-vm454191 systemd[1]: [email protected]: Scheduled restart job, restart counter is at 315.
Feb 13 20:12:20 vm-6959-vm454191 systemd[1]: Stopped OpenVPN service for server.
Feb 13 20:12:20 vm-6959-vm454191 systemd[1]: Starting OpenVPN service for server...
Feb 13 20:12:20 vm-6959-vm454191 openvpn[5963]: OpenVPN 2.4.12 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Aug 21 2023
Feb 13 20:12:20 vm-6959-vm454191 openvpn[5963]: library versions: OpenSSL 1.1.1f 31 Mar 2020, LZO 2.10
Feb 13 20:12:20 vm-6959-vm454191 systemd[1]: Started OpenVPN service for server.
Feb 13 20:12:20 vm-6959-vm454191 openvpn[5963]: Diffie-Hellman initialized with 2048 bit key
Feb 13 20:12:20 vm-6959-vm454191 openvpn[5963]: CRL: loaded 1 CRLs from file crl.pem
Feb 13 20:12:20 vm-6959-vm454191 openvpn[5963]: Outgoing Control Channel Encryption: Cipher 'AES-256-CTR' initialized with 256 bit key
Feb 13 20:12:20 vm-6959-vm454191 openvpn[5963]: Outgoing Control Channel Encryption: Using 256 bit message hash 'SHA256' for HMAC authentication
Feb 13 20:12:20 vm-6959-vm454191 openvpn[5963]: Incoming Control Channel Encryption: Cipher 'AES-256-CTR' initialized with 256 bit key
Feb 13 20:12:20 vm-6959-vm454191 openvpn[5963]: Incoming Control Channel Encryption: Using 256 bit message hash 'SHA256' for HMAC authentication
Feb 13 20:12:20 vm-6959-vm454191 openvpn[5963]: TUN/TAP device tun0 opened
Feb 13 20:12:20 vm-6959-vm454191 openvpn[5963]: Note: Cannot set tx queue length on tun0: Operation not permitted (errno=1)
Feb 13 20:12:20 vm-6959-vm454191 openvpn[5963]: /sbin/ip link set dev tun0 up mtu 1500
Feb 13 20:12:21 vm-6959-vm454191 openvpn[5963]: /sbin/ip addr add dev tun0 10.8.0.1/24 broadcast 10.8.0.255
Feb 13 20:12:21 vm-6959-vm454191 openvpn[5963]: /sbin/ip -6 addr add fddd:1194:1194:1194::1/64 dev tun0
Feb 13 20:12:21 vm-6959-vm454191 openvpn[5968]: RTNETLINK answers: Permission denied
Feb 13 20:12:21 vm-6959-vm454191 openvpn[5963]: Linux ip -6 addr add failed: external program exited with error status: 2
Feb 13 20:12:21 vm-6959-vm454191 openvpn[5963]: Exiting due to fatal error
Feb 13 20:12:21 vm-6959-vm454191 systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
Feb 13 20:12:21 vm-6959-vm454191 systemd[1]: [email protected]: Failed with result 'exit-code'.
ExecStart=/bin/true
looks like you or something intentionally disabled the serviceExecStart=/bin/true
literally runs/bin/true
, which always exit immediately and with an exit code of success. WithType=oneshot
, that is interpreted as if the service has started successfully