1

I have

  1. a wireless router without an integrated modem (linksys WRT1200AC with openwrt installed)
  2. a VDSL fiber modem/router
  3. 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

terr
  • 23
  • 2
  • 1
    Welcome on SuperUser! Did you already tried to do what you planned? Because in situations like yours, the simplest thing to do is to give it a try checking if it works as planned.`:-)` Search for LAN-LAN router connections. (You should connect 2 and 3 via cable to some lan port on 1. Then enter in the setup of 2 and 3, be sure that the secondary routers are working as a "router", asking the DHCP, DNS and the IP to give to the 1st one...). Give it a look [here](https://superuser.com/questions/936062/expanding-wireless-coverage-what-are-the-differences-between-lan-to-lan-and-lan) too. – Hastur Dec 16 '20 at 23:08
  • I tried it and it seems to work. When you wrote "be sure that the secondary routers are working as a "router", asking the DHCP, DNS and the IP to give to the 1st one" you were thinking about the case in which I'd connect some host to one of the two modem/routers right? I just want to use the two modems/routers as if they were just modems. I would only connect other hosts to the main router. – terr Dec 17 '20 at 17:26
  • Ok I understood the opposite! So you have a local rooter that is connected to internet from fiber and/or from mobile 4G network. You want that when you switch the internet provider (fiber or 4G) nothing changes for the devices connected after the rooter. Well this will be possible for a lot of things but not for all, because the router itself will _exit_ on the external world with a fixed (maybe temporary) IP depending from the provider. When you switch it, it changes. I.e. if you have to download an internet page no problems; if you have a secure connection you have to start it again. – Hastur Dec 17 '20 at 18:18
  • Moreover maybe you can overcome the problem asking the router (or the computer) to connect to a VPN. So the _"exit point "_ from the VPN will be the same... – Hastur Dec 17 '20 at 18:19

0 Answers0