OPNsense Forum

English Forums => Virtual private networks => Topic started by: raffnix on December 26, 2021, 12:59:05 pm

Title: Gateway for OpenVPN Site to Site
Post by: raffnix on December 26, 2021, 12:59:05 pm
Hi!

I have a openvpn site to site connection (both sides opnsense boxes) where on the client side i have 2 wan connections in a failover gateway group (Tier 1 = cable line, Tier 2 = 5G cube).
The VPN connection itself working fine but my problem is that everytime both wan connections are up the openvpn client connects over the 5G connection (but should connect over the cable connection).
If i disable the 5G wan interface the openvpn client connects via the cable connection.
I found no option to set the gateway group as gateway for the vpn client so at the moment the only way to connect the client via the cable connection is to disable theopenvpn client, disable the 5G wan interface, enable the openvpn client (then it connects via the cable wan connection) and then enable the 5G wan interface again.
The vpn connection is then up via the cable wan connection until the connection drops or i reboot the client or server then it will connect over the 5G wan again.
What can i do that the prefered connection for the openvpn client is the main cable connection?

Thanks in advance
Regards
Title: Re: Gateway for OpenVPN Site to Site
Post by: Gauss23 on December 27, 2021, 05:17:41 pm
Both WAN lines have different public IPs I guess? What is written in the ovpn files on the clients? Are there multiple lines similar like this "remote x.x.x.x 1194"?
The client usually tries to connect to the servers in that order. Sounds like the 5G IP/hostname is listed as the first "remote" line. If this is the case just swap both entries.