LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-19-2023, 04:32 PM   #1
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,433

Rep: Reputation: 110Reputation: 110
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?
 
Old 12-19-2023, 08:58 PM   #2
slac-in-the-box
Member
 
Registered: Mar 2010
Location: oregon
Distribution: slackware64-15.0 / slarm64-current
Posts: 780
Blog Entries: 1

Rep: Reputation: 432Reputation: 432Reputation: 432Reputation: 432Reputation: 432
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?
 
Old 12-19-2023, 09:07 PM   #3
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,433

Original Poster
Rep: Reputation: 110Reputation: 110
Accessing the camera remotely could be interesting someday, but I've never needed that. I never travel.

There are two users, but we use the same connection, router etc. Just different computers.
 
Old 12-20-2023, 02:18 AM   #4
slac-in-the-box
Member
 
Registered: Mar 2010
Location: oregon
Distribution: slackware64-15.0 / slarm64-current
Posts: 780
Blog Entries: 1

Rep: Reputation: 432Reputation: 432Reputation: 432Reputation: 432Reputation: 432
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.
 
Old 12-20-2023, 08:30 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,717

Rep: Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899
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.
 
Old 12-20-2023, 09:53 AM   #6
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,433

Original Poster
Rep: Reputation: 110Reputation: 110
Quote:
Originally Posted by slac-in-the-box View Post
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 View Post
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 View Post
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 View Post
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.
 
Old 12-20-2023, 09:55 AM   #7
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,433

Original Poster
Rep: Reputation: 110Reputation: 110
Quote:
Originally Posted by michaelk View Post
I assume your MODEM/router is a gateway device i.e. all in one?
Correct.

Quote:
Originally Posted by michaelk View Post
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 View Post
In addition you might need to reboot the other 2nd router.
That is even worse.
 
Old 12-20-2023, 10:23 AM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,717

Rep: Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899
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.

Last edited by michaelk; 12-20-2023 at 10:24 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
vsftp server handling both active and passive connections johngaz Linux - Networking 6 05-06-2013 08:59 PM
handling mass simultaneously connections dorian33 Linux - Software 2 04-14-2010 10:54 AM
Iptables, two internet connections, VPN + two local networks. dlublink Linux - Networking 1 12-31-2008 12:06 PM
Two networks with two internet connections on same machine. lhrimunda Linux - Networking 4 08-21-2008 08:38 AM
Need some advice on setting up a network with two internet connections e0n Linux - Networking 4 05-16-2003 09:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration