OPNsense Forum

Archive => 24.1, 24.4 Legacy Series => Topic started by: mkerost on February 24, 2024, 07:20:25 PM

Title: OpenVPN TAP Instance fails if server address not defined
Post by: mkerost on February 24, 2024, 07:20:25 PM
I see that the old client/server OpenVPN configuration is deprecated in 24.1.2_1, so I tested out migrating my existing OpenVPN servers to the new Instance configuration. I run TAP connections between sites.

When converting over my old settings, the server would not start.  It complained: "Options error: Parameter ca_file can only be specified in TLS-mode, i.e. where --tls-server or --tls-client is also specified."

This seems to be due to leaving the "Server (IPv4)" setting blank. When I provide a value (e.g., 10.0.47.0/24) it works.

My understanding is a Server IP is not required for TAP connections (https://openvpn.net/community-resources/ethernet-bridging/). My old configuration did not use a Server IP and worked. Perhaps my understanding is wrong here, and if so, perhaps Server IP should be a require setting so others don't get flummoxed.

On a side note, when I created the new OpenVPN instance, I went into Interface -> Assignments, and attempted to change the old OpenVPN interface to the new one, by changing the device in the drop down and pressing the save button. This gave me the following error: "You cannot set device bridge0 to interface opt5 because it cannot be a member of itself.". Is this related to the fact that in my bridge settings, I have the bridge device as a member of the bridge? Is this not a good thing to do?
Title: Re: OpenVPN TAP Instance fails if server address not defined
Post by: muchacha_grande on March 06, 2024, 03:33:58 PM
Hi mkerost, I'm facing the same problem since yesterday.
I was trying to migrate my legacy openvpn switched vpn to the new instance definition, but it seems that something is missing on the web configuration because, in addition to needing Server (IPv4), it doen't allow you to select the bridge interface nor the DHCP range to assign IP addresses to clients, as you can configure in the legacy page.
If you complete the Server (IPv4) network, it creates a tunnel VPN as if you were using a TUN VPN. I already tested it.
Title: Re: OpenVPN TAP Instance fails if server address not defined
Post by: muchacha_grande on March 06, 2024, 04:52:50 PM
I dig deeper into the issue and compared the configurations generated in both legacy and new definitions and I think there are a couple of miss configurations on the new instance approach. I'll open a ticket on github.

EDIT:
I opened a ticket on github and AdSchellevis is working on the issue.
Title: Re: OpenVPN TAP Instance fails if server address not defined
Post by: mkerost on March 08, 2024, 12:32:51 AM
Thank you so much for posting this on github. You were able to dig much deeper into this than I was. I'll follow the thread there and post any feedback if the updates don't fix things.
Title: Re: OpenVPN TAP Instance fails if server address not defined
Post by: franco on March 08, 2024, 11:42:43 AM
GitHub link for reference: https://github.com/opnsense/core/issues/7302
Title: Re: OpenVPN TAP Instance fails if server address not defined
Post by: muchacha_grande on March 11, 2024, 01:29:02 PM
Hi @mkerost, this issue has been solved. If you would like to test it you may apply the patches "opnsense-patch 3d09a2c 59ce2706 46354f48 ac4bbb" assuming you are on OPNSense 24.1.3_1

I've tested and it worked perfect.

Cheers...
Title: Re: OpenVPN TAP Instance fails if server address not defined
Post by: mkerost on March 11, 2024, 05:34:36 PM
I'll try it out this weekend when our traffic is low. Crossing fingers

Title: Re: OpenVPN TAP Instance fails if server address not defined
Post by: mkerost on March 16, 2024, 06:53:24 PM
Worked perfectly. Thank you!
Title: Re: OpenVPN TAP Instance fails if server address not defined
Post by: muchacha_grande on March 18, 2024, 03:55:15 PM
Great... it's possible that the fix is included in the next update.
Title: Re: OpenVPN TAP Instance fails if server address not defined
Post by: franco on March 18, 2024, 04:06:20 PM
Correct, out later this week. Watch out for 24.1.4.


Cheers,
Franco
Title: Re: OpenVPN TAP Instance fails if server address not defined
Post by: muchacha_grande on March 21, 2024, 09:28:42 PM
Just for the record... With 24.1.4 update I was able to successfully migrate the VPNs (TUN and TAP) of one of my routers.
The resulting configuration was almost identical to the legacy one and worked perfect in term of functionality.
I'm now migrating the other routers.
Title: Re: OpenVPN TAP Instance fails if server address not defined
Post by: franco on March 21, 2024, 09:39:48 PM
yay :)
Title: Re: OpenVPN TAP Instance fails if server address not defined
Post by: djpuzia on February 19, 2025, 03:16:09 PM
Can you put screenshot of OpenVPN TAP (bridge mode) configuration in the new configuration menu "Instance"?
I'm moving from configuration OpenVPN on OpenWRT to OPNsense and I can't understand it on GUI :(

I need to connect 2 site via VPN using "Bridge Mode" and only client certifacation authorization, so that the SiteB had DHCP and Broadcast from SiteA - devices in both sites must see as if in the same network.

Thanks.
Title: Re: OpenVPN TAP Instance fails if server address not defined
Post by: muchacha_grande on May 10, 2025, 04:45:00 PM
Hi djpuzia, here it is my TAP config.
Note that the TLS static key has to be configured beforehand in Static Keys tab and then use it here as the Certificate in the System>Trust>Certificates and the Certificate Revocation List in System>Trust>Revocation.
Two more steps are required:
Bridge the LAN and TAP interfaces creating a bridge type interface in Interfaces>Devices>Bridge
Create the necessary pass rules on the TAP and OpenVPN interfaces at Firewall>Rules>TAP and Firewall>Rules>OpenVPN.