I have
- a wireless router without an integrated modem (linksys WRT1200AC with openwrt installed)
- a VDSL fiber modem/router
- a 4G modem/router
I want to use 1 as the main (and probably only) router for the LAN (the one with the DHCP server) and I want to connect 2 and 3 to 1 so that any computer in the LAN is able to switch seamlessly between internet connection through fiber (2) and 4G (3). By "seamlessly" I mean that I do not want to change the settings of the ethernet (or the wifi) active interface on one host except for the gateway. So, being a total newbie as far as networking is concerned, the best solution I could come up is the following:
a) I'll disable the DHCP server on 2 and 3 (obviously)
b) I'll set the IPs of 2 and 3 to, say, 192.168.1.2 and 192.168.1.3 (the router has 192.168.1.1)
c) I'll attach 2 and 3 to two "normal" eth ports (I wrote "normal" because 1 has a separate WAN RJ45 port)
d) On any host connected to 1 through an interface X, whenever I want to switch gateway I'll do something like
ip route add default via Y dev X
where Y is either 192.168.1.2 for fiber or 192.168.1.3 for 4G.
As I wrote I'm a total neophyte when it comes to networking so I don't know if this would work and, in case it would work, if it's a good solution
And obviously more sophisticated, flexible etc solutions are more than welcome. Thanks