New OpenVPN Setup Issues

Started by Kitdrewne, November 17, 2026, 11:56:15 PM

Previous topic - Next topic
I just installed a new firewall running OPNsense and have everything working well across the network. I went through and configured an OpenVPN server on it, but whenever I try connecting the client just hangs and never connects. Checking the logs, I'm getting these three lines each time I try connecting:
Code (openvpn.log) Select
2026-11-17T14:15:32-07:00 Error openvpn /usr/local/opnsense/scripts/openvpn/ovpn_service_control.php: The command </usr/local/sbin/openvpn --config '/var/etc/openvpn/instance-3e920d50-f798-456e-ac8a-27687fb8f96c.conf'> returned exit code 1 and the output was "2026-11-17 14:15:32 DEPRECATED OPTION: --persist-key option ignored. Keys are now always persisted across restarts."
2026-11-17T14:15:32-07:00 Warning openvpn_server1 Use --help for more information.
2026-11-17T14:15:32-07:00 Error openvpn_server1 Options error: --local addresses must be distinct from --ifconfig addresses

On the client side, I tried removing the --persist-key option from the config, but it's still not connecting. I tried that while I was off-site though, so I'm not yet able to confirm how/if the error changed. Here are my configurations below:

Firewall (relevant entries)
RuleOriginVersionProtocolSourcePortDestinationPortGateway
OpenVPN (Group)*IPv4******
WAN*IPv4UDP**WAN AddressOpenVPN (Group) network*

Code (OpenVPN Instance) Select
Role: Server
Protocol: UDP
Port Number: 1194
Bind Address: 10.18.32.1
Type: TUN
Server (IPv4): 10.18.32.0/24
Topology: Subnet

TLS static key: [Set]

Authentication: Local Database
Strict User/CN Matching: Yes

Local Network: 192.168.2.0/24, 192.168.1.0/24, 192.168.20.0/24, 192.168.30.0/24, 192.168.40.0/24
Remote Network:

I'm using the single file option when exporting from OPNsense and have tried connecting both with KDE Network Manager under CachyOS and Viscosity on macOS with the same results. It's been a little while since I set one of these up, so I was referencing the documentation as well as another OPNsense instance I had configured previously elsewhere while setting this up initially.


Any advice would be much appreciated!

Thanks for the details, they make it easy to see. The error says the OpenVPN process can't start at all, which is why the client just hangs: nothing is listening.

My guess: in your instance, Bind Address is 10.18.32.1, which is also the server's own address inside the tunnel (your Server (IPv4) is 10.18.32.0/24, so the server takes .1). OpenVPN refuses to use the same address as both the listening address and the tunnel address, hence "--local addresses must be distinct from --ifconfig addresses".

Try this, one change only:

VPN > OpenVPN > Instances > edit your server and clear the Bind Address field (leave it empty so it listens on all interfaces). Save and apply.
Check VPN > OpenVPN > Log File: you should see "Initialization Sequence Completed" and no errors.
Test from outside your network (e.g. phone on mobile data), not from inside the LAN.

Your firewall rules look reasonable (UDP to the WAN address on 1194, plus an allow rule on the OpenVPN group). If it still hangs after step 1, please post the full first log line (the "The command ... returned exit code" one is cut off), and the part of the log after the restart.

Please also keep a copy of config.xml before changing things (System > Configuration > Backups).

Sergio
BoNet Tech — reti, sicurezza e QoS, spiegati bene.
Sito e servizi: bonet.tech