Configuration for 2 lte devices


here is what I would like to achieve:

My router has internet access either usb-tethered to my phone (usb0) or via an usb-stick (eth2).

As background: On my phone I have unlimited lte-volume, on the stick only 500MB/month.
The purpose of the stick is so that scripts on my router can send me notifications and that I can log in when I am away via zerotier.

I now want that when a device is available it should be used for internet-access but in the case that both devices are available only the phone should be used.
And I want only zerotier and a small list of other scripts all running on the router itself to be able to use the stick at all - I need to prevent some random internet access to eat up all the available lte-volume.

Is that possible with configuration alone or would you need to do some scripting?

Many thanks.

It is possible to a certain extent for IPv4 just by setting a higher metric for the backup WAN interface, assuming that disabling tethering or unplugging the USB cable makes the main WAN device to disappear.

Anything more complicated requires active connectivity check, PBR and IPv6 NAT/NPT: