1

I'm trying to use a .ovpn file on the built-in VPN settings in Ubuntu 23.10

I go to the setting menu --> Network --> '+' button next to VPN

I click "Import from file..." and navigate to my .ovpn file.

It seems to work but never connects. On a Windows VM on the same machine, I use the OpenVPN client and the SAME file and it works just fine, so it's not the file configuration.

Do I need to do anything in the Advanced settings to get it to work? The other ovpn posts on here seem old and don't relate to modern versions of Ubuntu. I have also tried using the CLI command nmcli connection import type openvpn file <.opvn file> which again imports it correctly but doesn't connect (same behaviour as the GUI).

In syslog, I get nm-openvpn[22624]: read UDPv4 [EHOSTUNREACH]: No route to host (fd=5,code=113) but as I said, It works from the same machine on my VM.

UFW is not enabled so the port is open.

Screenshot of Advanced Options

Update:

I switched to port 1193 to try and using nc, I can see that 1193 is listening:

~$ nc -v -u -z -w 3 <myIP> 1193 
Connection to <myIP> 1193 port [udp/*] succeeded! 

Output of journal:

Jan 29 16:46:49 markswift3 nm-openvpn[6429]: NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Jan 29 16:46:49 markswift3 nm-openvpn[6429]: TCP/UDP: Preserving recently used remote address: [AF_INET]<myIP>:1193
Jan 29 16:46:49 markswift3 nm-openvpn[6429]: UDPv4 link local: (not bound)
Jan 29 16:46:49 markswift3 nm-openvpn[6429]: UDPv4 link remote: [AF_INET]<myIP>:1193
Jan 29 16:46:55 markswift3 nm-openvpn[6429]: [server] Peer Connection Initiated with [AF_INET]<myIP>:1193
Jan 29 16:46:56 markswift3 nm-openvpn[6429]: AUTH: Received control message: AUTH_FAILED,Data channel cipher negotiation failed (no shared cipher)
Jan 29 16:46:56 markswift3 nm-openvpn[6429]: SIGUSR1[soft,auth-failure] received, process restarting
Jan 29 16:46:57 markswift3 nm-openvpn[6429]: NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Jan 29 16:46:57 markswift3 nm-openvpn[6429]: TCP/UDP: Preserving recently used remote address: [AF_INET]<myIP>:1193
Jan 29 16:46:57 markswift3 nm-openvpn[6429]: UDPv4 link local: (not bound)
Jan 29 16:46:57 markswift3 nm-openvpn[6429]: UDPv4 link remote: [AF_INET]<myIP>:1193
Jan 29 16:47:08 markswift3 systemd[1]: systemd-hostnamed.service: Deactivated successfully.

My .ovpn file looks like this (with the keys appended):

client
dev tun
proto udp
remote <myIP> 1193
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
auth SHA512
cipher AES-256-CBC
ignore-unknown-option block-outside-dns
verb 3
7
  • Where is the VPN server? On the same network or remote? Is it a third-party VPN service or your own server?
    – codlord
    Commented Jan 27 at 16:17
  • VPN is my own server. My client laptop is on either the same network or remote (I have the same issue with both)
    – Mark Smith
    Commented Jan 28 at 17:35
  • What are the versions of OpenVPN on the server, the windows VM client and the Ubuntu client?
    – codlord
    Commented Jan 30 at 16:10
  • All devices are Ubuntu - Client Laptop s OpenVPN 2.6.5 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] [DCO] library versions: OpenSSL 3.0.10 1 Aug 2023, LZO 2.10 and Server is OpenVPN 2.6.5 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] [DCO] library versions: OpenSSL 3.0.10 1 Aug 2023, LZO 2.10
    – Mark Smith
    Commented Jan 31 at 17:58
  • 1
    Your log gives a no shared cipher error. If you have not already maybe check out this: blog.zs64.net/2021/01/… and this: community.openvpn.net/openvpn/wiki/CipherNegotiation I don't pretend to understand it all but maybe you need to specify data-ciphers and/or data-ciphers-fallback?
    – codlord
    Commented Jan 31 at 18:26

1 Answer 1

1

@codlord solved this for me (see comments on OP).

I had to disable the cipher directive in both the server and client and allow OpenVPN to negotiate the ciphers amongst the allowed cipher list itself. It turns out that Windows and Linux use a different list, which is why my Win 11 VM was working.

To do this, I commented out the line #cipher AES-256-CBC in both the server and client config. In Linux, the server config is at /etc/openvpn/server/server.conf The client config is in the .ovpn file generated when you setup an new client.

Then, because I'm using Ubuntu's control panel (network manager) to manage the VPN, I had to change the screen:

Ubuntu Advanced VPN Security Settings

and change the cipher dropdown from AES-256-CBC to Default.

Restarted both OpenVPN apps and it works!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .