Prioritizing one connection over another while communicating through a single ip address

I am not an IT specialist and have a very limitted understanding how ip addresses work but the problem I am trying to solve is as follows:

I have a remote computer that I want to connect and ping its ip address. This connection is possible both using a 5G network and a Lifi one both of which are available through two separate ethernet cables (eth 1 and 2) as described with an image in this link:

When both networks are available, the connection should work using Lifi and when Lifi goes down it should automatically be available through the 5G connection (ping continues working when I turn off Lifi because the connection continues through 5G).

With what I have searched so far, this could be possible using a router and I have for example some Teltonika routers. But I may be wrong and since I am actually a software developer I don’t know how networks or routing works in general but I feel there should be an easy solution for this.

Do you have some hints for possible solutions and devices for testing/debuggin it?
In addition my Teltonika model is RUTX50.

Seems like you just need to setup failover, it can ping specific IP address and switch to another WAN in case it fails, more information can be found here: RUTX50 Failover - Teltonika Networks Wiki

Hello,

Our devices come equipped with a failover function designed to serve as a backup for your primary WAN connection in the event of a failure. Through the WebUI, you have the flexibility to configure failover settings according to your preferences. This includes setting priorities, enabling or disabling interfaces, and specifying the conditions under which the failover should occur.

When failover is enabled, our devices continually check the internet connection by pinging a specified server (default is 8.8.8.8 and 1.1.1.1). If the primary interface (WiFi WAN) experiences a failure (no response from the server while pinging), the secondary interface (Mobile) is automatically activated. Once the primary interface recovers (starts receiving pings again), the system reverts to using it as the main connection.

As pwsh mentioned, more information about failover can be found on our wiki page: RUTX50 Failover - Teltonika Networks Wiki

Best Regards,