Advice needed on handling two Internet connections
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Advice needed on handling two Internet connections
This is the situation: I have a modem/router connected to the ISP. And I have a security camera that connects to the modem/router and feeds it the outside view. My machine is connected to the modem/router over Ethernet and I can access the camera feed on a certain IP address.
It works well except that sometimes that connection goes down and I have to use my phone's access point mode to access the Internet on the computer over Wifi. In which case I am no longer connected to that modem/router so I can't view the camera feed.
My available resources:
1. The camera. I can have it operate like an access point that feeds the images to anyone who connects to it. I really dislike that option because there are no configuration options besides the access password so I have no idea how secure it is so I'm afraid it could be hacked. I'm not using that. Or I can have it connect to my router, which is the way I'm using it.
2. The router. Besides the modem/router, I also have two old Wifi routers, one running standard firmware and the other running OpenWRT. They're not being used now, but I can use them. Both can get Internet over Wifi and serve via Ethernet or the other way around, never both.
3. Two wifi cards on the computer plus the Ethernet port.
4. A very basic and dumb Ethernet switch with 5 ports.
5. Only two Ethernet cables.
Now, the possible route:
The modem/router connects to the ISP. Router 1 receives Internet from the modem/router over Wifi or Ethernet. I always prefer Ethernet.
Router 2 receives Internet from my phone over Wifi. That Internet feed will be available sporadically.
The camera connects to Router 2, I guess.
My computer connects to Router 2, which has the camera feed and hopefully has Internet served by the phone or the modem/router. Hopefully.
Now, when my computer connects to Router 2, which Internet is it going to use? There must be Internet on Router 2 (though not always) and somehow Internet on Router 1 (usually). But will Router 2 know how to handle both Internet feeds?
Sounds like a Rube Goldberg machine to me and I'm not even sure it is going to work. I remember that configuring OpenWRT was no walk in the park either.
I'm out of ideas. Do you have any you can share with me?
Do you want to connect to the camera remotely, when you are travelling; or do you only view it from this location? Do you have other users who also need to view this camera, or just you?
Well, it sounds like everything works, except when your modem/router's connection goes down and you have to use the phone.
Your switch could come in handy. You can connect your 5-port ethernet switch to your modem router, so that multiple ethernet devices can connect to internet through the modem/router, as well as to camera.
Sounds like your camera is configured to work on the subnet your modem router uses (i.e, private subnets where ip addresses start with 10.#.#.#, 192.#.#.#, or 172.#.#.#), so as long as you know the ip address of that camera, other device on same subnet can connect by browsing that ip address.
Your phone can create a wireless AP that you use when your modem/router's connection goes down. If you have control over this access point in your phone's settings, you can change the subnet to match your modem/router's subnet, and then hopefully your camera could use your phone's wifi network as well. There are also usbc-to ethernet adapters, and your phone's internet might be able to be shared with that ethernet switch.
So when your modem/router goes down, your phone becomes the modem/router. Just a matter of getting the subnet to match, so the camera works.
I assume your MODEM/router is a gateway device i.e. all in one?
If so as suggested the simplest would be to connect router with the original firmware in series with the ISP router and have the camera and desktop connect to it. The second router running OpenWRT hopefully can be configured as a wifi extender and have it configured to connect to your phone. When your internet goes down you would need to manually swap between your ISP MODEM/router and the OpenWRT router on the second router. In addition you might need to reboot the other 2nd router.
If your ISP MODEM/router are separate devices then try manually swapping the MODEM with the OpenWRT router (configured as a wifi extender). You still might need to reboot the router.
Either way basically your LAN is unchanged so the camera still connects to the same wifi configuration. In the first option your connecting as a double NAT so make sure the LAN addresses are different.
Your switch could come in handy. You can connect your 5-port ethernet switch to your modem router, so that multiple ethernet devices can connect to internet through the modem/router, as well as to camera.
No, the camera is Wifi.
Quote:
Originally Posted by slac-in-the-box
Your phone can create a wireless AP that you use when your modem/router's connection goes down. If you have control over this access point in your phone's settings, you can change the subnet to match your modem/router's subnet,
Sadly, no. That option is not there.
Quote:
Originally Posted by slac-in-the-box
and then hopefully your camera could use your phone's wifi network as well.
It already does. But it connects to my modem/router. It could connect to one of the other routers. I just want to avoid using the camera in access point mode.
Quote:
Originally Posted by slac-in-the-box
So when your modem/router goes down, your phone becomes the modem/router. Just a matter of getting the subnet to match, so the camera works.
I believe the camera will work as long as it is connected to any one of the routers. The problem is switching internet connections on the fly.
I assume your MODEM/router is a gateway device i.e. all in one?
Correct.
Quote:
Originally Posted by michaelk
If so as suggested the simplest would be to connect router with the original firmware in series with the ISP router and have the camera and desktop connect to it. The second router running OpenWRT hopefully can be configured as a wifi extender and have it configured to connect to your phone. When your internet goes down you would need to manually swap between
Ah, "manually swap." That is the part I don't like.
Quote:
Originally Posted by michaelk
In addition you might need to reboot the other 2nd router.
It may work if you connect the ISP router with OpenWRT router to a switch and leave the OpenWRT router off until needed. You would also need to switch the ISP router off. The reason you might need to reboot the 2nd router is because your switching networks i.e. from assuming a public IP address to a private LAN IP address from your phone and it may not be automatic.
That basically leaves your LAN intact and you should be able to access the camera regardless of the internet source.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.