Score:0

Best practice for preferring the network interface that actually has internet?

eg flag

I have an embedded device where I have three network connections, eth0, wwan0, and wlan0. wwan0 is a metered connection, so I would generally prefer eth0 or wlan0. The problem is that at any given time any interface can be connected but not actually be able to reach the internet. For various reasons any interface may not be present at all. In this case my routing table does not do what I want. Is there a better way to handle this than a script that constantly checks and modifies the routing table? Part of the problem is that there are too many combinations and permutations of available, not available, no internet, etc.

Score:1
za flag

As you noticed, there are many possibilities. There are murky ones, for example: "has internet, but just the test servers are unavailable", and they can be unavailable because they are all failed or blocked by the government. It is also possible that "half" of the internet is accessible through one ISP and "other half" is inaccessible; but other ISP has the picture "reversed". (Trust me or not, I've seen such a situation once.) Which one you declare as "having internet"?

This is very tough question, that's why there exists a whole business niche for SOHO routers that are, more or less, able to make a decision in various situations, and those are generally not very easy to set up so they could make a good enough decision. This is also why all that BGP business in the telecom world.

So, as you see, no, you can't do much better and more efficient than the script. I don't know why you want that, but for the desktop/end user machine I think it is not worthy automating this at all. For the Linux router I'd make a standard split-access configuration with RPDB and default routes through each link with high metrics, in the order of preference, and then the script will only set or update the default route with low metric based on pings to, say, five geographically distributed test points, carefully selected (the most accessed or important ones).

eg flag
Thankyou. For my purposes ping 8.8.8.8 is adequate.
eg flag
Also there is no end user for the remote machines.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.