Wanted to make failback of Raspberry PI

Dear all, Recently my fiber cuts frequently thus I have another network with 4G broadband in my home. Raspberry pi running on eth0, but i wanted to make a failover & failbak on wlan0. Pi will run on eth0 all time, if eth0 network goes down, link will be shift to wlan0. And when eth0 link comes back, the pi will run on again eth0.

Fiber broadband(eth0) have DHCP ip as [192.168.22.1/24]
4G Modem(wlan0) have DHCP ip as [192.168.25.1/24]

RPI OS ver is 9.13 and Piaware version is 9.01

How can i do it. I can assign static IP also on RPI. How Can i do this in easy way. Please help. Thanks in advance.

Thank you
Zahidul Hasan.

check put this post:
https://forums.raspberrypi.com/viewtopic.php?t=230490
it handles 2 simultaneous connections to 2 networks, in the post it is about 2 Wi-Fi networks but this can be applied to a LAN and Wi-Fi as well.

Should be possible with a script that checks if there is a “connected” signal on ethernet. If not, it switches to WiFi

Maybe that helps:

Thank you so much for helping. My Eth0 will be physically connected while eth0 internet remains disconnected. I need the solution wlan0 will use while eth0 unable to go internet.

Thank & Regards,
Zahidul Hasan.

Thank you. I would like to go with some easy configuration. KInd of this

lets see if its work.

Thanks,
Zahidul Hasan.

Far too complicated.
You setup both network interfaces so they work and then set (in the Pi) the priority (metric) of one to be higher than the other.

If you want to set it up for the whole network rather than each device, there are plenty of modem/routers that have multiple network connections (WAN + 4G) that can fail-over from one to a second.

I’ve been using a dlink DWR-921 (now thankfully discontinued) for quite some years. All the big names have a similar offering.

Checking a simple “connected” string is too complicated?
He simply wants to bring an interface up once another is going down

Dear Sir, Thank you. I think this type SIM vs WAN failover router will be better for me. But this model not available in my country & TP-Link & Cudy available but these may have not same failover feature as D-link. Yet i may find such router asap.

Thank you.

Indeedy.

From what I’ve read its like non linux, where Presumes a dual eth/wifi network connected device behind x number of lan cables is always live if eth is up. And use it.
Unable to tell the difference of wan down eth up without some reconfiguration.

Priority only sends down favoured paths until one doesn’t exist physically?

A fail over router can sometimes do basic wan/endpoint line monitoring and take care of the routing/paths.

Which is where something monitoring it’s external connectivity, not local comes in.

Seeing solutions like pfsense that can take care of it using pings.

But short of physically removing a plug, doesn’t seem to do out of box smarts.

Worth mention: many of the ASUS brand consumer routers support dual-wan, either in fail over or load balancing mode.
Could use LTE usb stick as secondary source, or set configuration to use one of the lan ports as a second wan port to connect to alterate isp.

1 Like

No, it won’t be. The DWR921 has passed its ‘end of life’. I mention it only because that was what I was using and despite it’s limitations as a router, the fail-over worked well.

TPlink have several models with the same functions and would be my current choice.

The TP-Link Archer BE19000 has dual 10 GB WAN ports with the capability to “fail over”.
It supports Wi-Fi 7. List price is $600 but can be found for slightly less.