Make camera's accessible behind PoE Dahua NVR

Jeroen1000

Young grasshopper
Joined
Sep 26, 2016
Messages
42
Reaction score
13
Hi guys and girls

/mnt/mtd/Config holds, amongst other stuff, the network config files. It's as far as I can tell the only partition that is writable. In there you can find the IP information (xxx characters have been added be me):

This is the LAN-side of the NVR going to my home network:

BONDED = 0
BRIDGEEDED = 1
PRIO = 0
HOSTIP = 192.168.xxx.xxx
SUBMASK = 255.255.255.0
GATEWAYIP = 192.168.xxx.xxx
MTU = 1500
DEFAULT_ETH = eth0

This is the camera subnet on the NVR. You can change it but the GUI does not allow it to be in the same subnet as above:
BONDED = 0
BRIDGEEDED = 1
HOSTIP = 10.1.0.1
SUBMASK = 255.255.0.0
GATEWAYIP = 10.1.0.1
MTU = 1500
PRIO = 1

Does anyone know what the first 3 parameters do? I changed BRIDGEEDED to 1 as you can see in red but that made the NVR unreachable:). I assumed it would bridge the "camera subnet" and the NVR-subnet together. But that did not turn out very well. Still tracking down my console cable to change it back:)

full disclosure:
The camera's are put in a separate subnet on the NVR if you connect them directly to an NVR PoE-port. I don't like that as you loose direct access to the camera's themselves.
I'm trying to modify the config so that either the interfaces are bridged or the camera's reside in the same subnet as the NVR.
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,229
Reaction score
5,325
Location
Denver, CO
yeah thats not going to work..

You'll need to setup routes, on your NVR you'll have to route traffic from PoE to LAN and vice versa.. then on your LAN's Router you'll have to define a static route for the PoE subnet to go through your NVR.

This all assumes the NVR has the appropriate kernel modules and software tools to accomplish it, I havent looked truthfully..
 

Jeroen1000

Young grasshopper
Joined
Sep 26, 2016
Messages
42
Reaction score
13
Hi Nayr,

Yes the static routing works just fine if you enable ip routing via telnet. I've tried it and it works. However, it is unfortunately disabled after a reboot. Same for telnet Access BTW.

I could try to edit the firmware and flash a "routing-enabled" firmware but I would have to unpact the cramfs and then the squashfs, which looks fairly complicated. I'll poke some more in that RW-mount.
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,229
Reaction score
5,325
Location
Denver, CO

Jeroen1000

Young grasshopper
Joined
Sep 26, 2016
Messages
42
Reaction score
13
Brilliant thanks. That is exactly what my backup plan is. Thanks for sharing. Actually the only command that needs be run (could be done via an init.d script as you say) on the NVR is echo 1 > /proc/sys/net/ipv4/ip_forward*. But unless the default firmware overwrites it on boot, I could just hack the firmware with the tools you linked to so that ip_forward always has "1". The FS is unpacked into RAM and that's why the change is gone after a reboot, not because Dahua actively overwrites it (not 100% sure about that yet though).


Besides that you only need to add a route to the cam subnet on your pc and also on the router but you appear to be very well informed:)
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,229
Reaction score
5,325
Location
Denver, CO
np, Ive managed to upgrade my firmware to the latest Chinese version.. then I mounted a NFS share with flashcp and an image of the custom partition from before the update.. flashed the old custom partition back then rebooted.. everything was back in english.. you could do the same thing but with the partition that has init on it.

*disclaimer* proceed at your own risk obviously ;)
 
Top