You are not logged in.

#1 2018-11-04 00:44:42

kmsgli
Member
Registered: 2015-08-15
Posts: 28

Second ethernet port setup

I posted this on the github page for motioneye also as security cameras are the drive behind setting up a second Ethernet port but I suspect this is the correct place to ask my question.

I have some IP cameras running on my Arch desktop but I loose connection more frequently then I would like due to poor internet service.

Can i install a second PCI Ethernet port and run the POE switch signal from the cameras back to my Arch computer directly and not require actual internet to get reliable video recording.

If so, How would I go about setting this up as far as I can find on the internet I need to setup a second LAN and dole out IP addresses to the cameras but admittedly networking is not my strong point.

thanks in advanced.

Offline

#2 2018-11-04 12:43:25

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 1,985
Website

Re: Second ethernet port setup

You may want to familiarize yourself with DHCP, especially the server side. You should find plenty documentation in the wiki.


macro_rules! yolo { { $($tokens:tt)* } => { unsafe { $($tokens)* } }; }

Offline

#3 2018-11-04 15:32:06

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,789

Re: Second ethernet port setup

That i a complex question.  The answer is, it depends upon the cameras.

Yes, you can set up a separate network.  You will want to set it up on a different subnet than that which you use on your existing NIC with which you connect to the Internet.
For example, if your home network currently uses 192.168.1.x/24; you will want to ensure you do not use that same subnet for your new network.  Pick something else, say 192.168.100.x/24

You used the word cameras (plural), so I assume this new network has at least three nodes - at least two cameras and your new NIC.  This means you will need a network switch (don't waste your time with a hub).  They make switches with POE injectors -- that is the route I would take.Also, you will need to manage network addresses. You could use static addresses, but as schard points out, running a DHCP server will make your life happier.  You could get a router or a switch with this capability, but add in the POE and it starts to get a little sporty as to cost.  You would be better off getting a POE injecting switch and running the DHCP server on the Arch box so that it can assign addresses.  There are good articles in the wiki on how to do this.

Now you have a separate network consisting of cameras, a POE injecting switch and an Arch box with a separate NIC.   Do the cameras need to phone home? Is there any reason they need to have access to the Internet?  My inclination is to say no; but; the recording features of some cameras *cough*Nest*cough* demand it.  Certainly if you want to use any of the Vendor apps for iThings or Android, the cameras will need access to the network.  Otherwise you are done.  Your DHCP logs will tell you which cameras have which addresses. 

If the cameras do need access to the Internet, you will need to set up NAT forwarding.  There are good articles in the Wiki for that as well.  NAT forwarding uses your computer as a router and will forward packets from your camera network out the other NIC accross your network and out your router to the Internet.  Returning packets arrive at your computer and will forward them to the camera net.  Works well.  Don't set it up unless the camera's need it.  If the cameras spew a lot of Internet  bound traffic, your system will get busy.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#4 2018-11-04 16:20:14

kmsgli
Member
Registered: 2015-08-15
Posts: 28

Re: Second ethernet port setup

So ewaller what you have described is how my system is already setup up.

I have my router going to a POE switch then my two exterior cameras feeding into my POE switch.  The arch box itself is also going to the same router.  Some other sources on the internet are telling me that if I run the arch box to the POE switch instead of my router I will not need to set up a separate Ethernet port and that should be enough to allow my cameras to keep functioning when the internet cuts in and out?  That does not seem correct to me but again networking is not my strong subject?

If that is the case then easiest thing is for me to run another Ethernet line up to my switch.  However if that's not the case the cameras I purchased are ONVIF cameras as they just stream to a rtsp which is why i purchased them, I don't want cameras phoning home to some system I have no control over.  This is why I am using motioneye software as it is is open source and very useful for viewing/recording as it just serves up a python website for the back end motion with some nice options and ability to add network cameras to it.

Will I be able to use motioneye as it will in theory be serving the webpage from the Ethernet port that is actually connected to my real router?

thanks for the help guys.

Offline

#5 2018-11-04 16:32:19

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,789

Re: Second ethernet port setup

If you run the Arch Box to the switch, your Arch box will be one hop further from the router.  Not ideal, but it does prevent all of the camera traffic from having to go through the router.  That might be an improvement in and of itself. 

But, I do agree that getting a second NIC and running it to the router would be a great choice with the original network being routed to the POE switch.  BUT, be sure the POE switch does not connect to the router.  That would form a loop.  This also means the router cannot provide addresses to the cameras.  So, we are back to running a DHCP server on the Arch box.  If you run the web server on your Arch box, it can get the camera data via the switch on the dedicated network, and can stream it to the router side.  The router just needs to forward HTTP(S) traffic to the Arch Box.  No NAT required.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#6 2018-11-04 18:35:55

kmsgli
Member
Registered: 2015-08-15
Posts: 28

Re: Second ethernet port setup

So when I pull power from my cable modem I am still able to use the arch box to ping the cameras successfully which to me means the cameras should theoretically need no internet to transmit video to the arch box and record.  This makes me wonder if maybe its an issue with Motioneye not the network, however when the modem is down the motioneye server is not being displayed there for not recording.

So I believe there are a few answers to my problem but the only one that pertains to Arch is this.

Setting up a second NIC and serving motioneye as well as the cameras on that NIC and having it basically CCTV system and never having recording issues but also not being able to view the cameras from outside the arch box with the NIC attached.

I assume this is where I would get the information to make that work;
https://wiki.archlinux.org/index.php/dhcpd

If that is correct I will change this thread to solved and start to experiment with different options.

Offline

Board footer

Powered by FluxBB