OPNsense Forum

English Forums => Virtual private networks => Topic started by: anomaly0617 on August 27, 2023, 06:58:09 PM

Title: OpenVPN Site to Site breaks in v23.x
Post by: anomaly0617 on August 27, 2023, 06:58:09 PM
Hi there,

We're seeing a problem across all of our OpnSense v23.x installations where OpenVPN Site-to-Site tunnels are in use.

The symptom:

When one side (site) of the tunnel drops due to either an internet connection going down or a scheduled task like a weekly reboot, and the tunnel is re-established, traffic no longer routes across the tunnel.

The workaround (fix):

The tunnel should now re-establish, and new routes will be created.

In the future when one of these tunnels drop, you can use the ovpn number you documented in the label of the tunnel to more quickly find and delete the routes that are stale and left over from the previous tunnel connection.

We started noticing this at multiple sites after upgrading to v23.x, but it's possible it existed before then and we didn't catch what update caused it. But it seems to be universal, affecting multiple sites that have no connection to one another.

Could someone on the Dev team look into this, if no one has already?

I'm sure someone could write some script wizardry to do this. I haven't had time to put my programming hat on and do it as of yet.

Thanks, all!
Title: Re: OpenVPN Site to Site breaks in v23.x
Post by: newsense on August 27, 2023, 07:42:09 PM
It's likely you'll need the two patches created by AdSchellevis -- if my interpretation is correct and this is the same underlying issue affecting the CSOs

https://forum.opnsense.org/index.php?topic=35447.0 (https://forum.opnsense.org/index.php?topic=35447.0)
Title: Re: OpenVPN Site to Site breaks in v23.x
Post by: anomaly0617 on August 29, 2023, 05:52:01 PM
I've applied these patches to a few firewalls, but looking at them, they seem to only affect the UI, not the underlying code that may create or destroy routes when they are initiated or dropped. Am I being dense, or is this the case?

The issue I'm seeing is that nothing seems to be consistently destroying/deleting the routes when a tunnel drops, and then because there's already "a route" when the tunnel re-establishes, the route command can't do it's job. But the old routes are also stale/dead and don't work.