I'm using Raspberry Pi 3B. I've ethernet eth0 and a 4G module ppp0 connected. Priority connection is eth0. I can detect whether ethernet cable is connected to the raspberry pi or not using commands. But Can I check whether the internet is there or not without ping command?
I want such thing which can monitor all of my interfaces at the same time. If internet is available on eth0, the main interface will be eth0. When the internet is down on eth0, the connection should switch ppp0. As soon as the internet is available again on eth0, it should switch back to eth0.
How can I achieve this? I don't want to check this thing using ping command again and again after a fixed interval. Plz help.