LTS virtual host with Dahua camera

tigerwillow1

Known around here
Joined
Jul 18, 2016
Messages
3,849
Reaction score
8,519
Location
USA, Oregon
I hooked a Dahua camera to my LTS (hikvision) NVR. So far, it's receiving and recording the video ok. Virtual host doesn't work with this camera. I suspect the answer is "I'm hosed", but just in case, does anybody know how to get it working?
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,963
Reaction score
6,794
Location
Scotland
Virtual host doesn't work with this camera.
Does it work with any other cameras on the NVR?

I have 3 non-Hik cameras on a Hikvision 7816 NVR which work OK when their HTTP port is set to 80, but not other values. What's the HTTP port on your Dahua?

Assuming Virtual Host on the LTS firmware operates in the same way as the Hikvision firmware, there is something else you could try.
The Hikvision firmware automatically sets NVR PoE port connected cameras default gateway to that used for the NVR LAN port, which stops the cameras communicating outside the NVR PoE network segment, by default 192.168.254.x
You may be able to connect to the cameras directly on their native 192.168.254.x address if you do 2 things:
Set the camera default gateway to the NVR PoE interface address, by default 192.168.254.1 Ensure the NVR doesn't change it back by having the channel in Manual mode, not Plug&Play.
Add a static route to your LAN gateway/router to enable traffic destined for the NVR PoE ports connected cameras to be directed via the NVR LAN interface, something like -
"For network 192.168.254.0/24 (subnet mask 255.255.255.0) route traffic via the NVR LAN port IP address"

That works OK on a Hikvision NVR.
 

tigerwillow1

Known around here
Joined
Jul 18, 2016
Messages
3,849
Reaction score
8,519
Location
USA, Oregon
Wow, you're giving me some hope! I have LTS and Hilvision cameras that virtual host works great with. The HTTP port on the Dahua camera is 80. I don't have POE ports on the NVR. I'm using both of the NVR's NICs to mimic the internal POE ports, with one NIC connecting to the home network, and the other NIC to the camera POE switch which is a different subnet.

When I added the Dahua camera to the NVR I selected ONVIF for the protocol. This sets the Management Port to 80, and I left the Transfer Protocol on Auto. Channel Number is set to 1 (I don't have a clue what this is). I tried to set the camera's default gateway to my router, but it won't let me set it to a different subnet than what its ip address is. I tried setting it to the NVR's NIC address, which didn't help. So now I'm losing hope :-( yet I can't help thinking if the LTS cameras work with virtual host the others should, too.

My router is locked down by the ISP, so I can't use it to talk to a second subnet. As a final fallback I'm assuming I could put everything on the same subnet and configure VLANs on the switch to block the cameras from communicating with the router. I'll keep thinking on this, and sure appreciate any suggestions.
 

tigerwillow1

Known around here
Joined
Jul 18, 2016
Messages
3,849
Reaction score
8,519
Location
USA, Oregon
Follow-up: I found a post on another forum saying virtual host doesn't work with ONVIF. However, one of the Hikvision NVR manuals shows a virtual host example with one of the cameras using ONVIF, suggesting it should work. The LTS manual example has the protocol set to Default, so there's no help from that.
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,963
Reaction score
6,794
Location
Scotland
Follow-up: I found a post on another forum saying virtual host doesn't work with ONVIF.
My non-Hik cameras are connected as ONVIF and work OK via Virtual Host.

However - when you mentioned Virtual Host I made the assumption we were discussing access to cameras connected on NVR PoE ports, normally not directly accessible, which is what Virtual Host aims to provide connectivity to.
But it seems that's not correct, it sounds like you have set up an isolated subnet on the second LAN interface of the NVR and connected a set of cameras to it.

On the assumption that the Virtual Host in the LTS firmware enables the Linux kernel 'IP_forward' capability between the 2 NVR LAN interfaces, if you want to try it there may be another possibility.
My router is locked down by the ISP, so I can't use it to talk to a second subne
But, it seems, not via your router.
It's possible to set up additional routing in Windows.
So maybe try this out:
Let's say NVRLAN1_IP is the IP address of the NVR LAN interface on the segment to which your PC is connected, and NVRLAN2_IP is the IP address of the NVR second LAN interface. And LAN2 is the network address consisting of NVRLAN2_IP but with a '0' instead as the last number.
And that CAM2_IP is the IP address of a camera connected to the segment that NVRLAN2_IP is on.
At a command prompt in Windows (using Run as Administrator) first confirm there is no access to CAM2_IP
ping CAM2_IP
tracert CAM2_IP

Then try adding a route:
route add LAN2 mask 255.255.255.0 NVRLAN1_IP metric 2
And if that is 'OK!' then try the ping and tracert again.
If it does work - maybe optimistic but easy to test - then add a '-p' to the 'route add' command to make the route addition persistent.
In the absence of being able to add the route to the router, this, if it works, would need to be done for each PC used for access.

*edit*
tried setting it to the NVR's NIC address, which didn't help.
I forgot to mention that you'd also need to do this - the default gateway on the camera would need to be set to NVRLAN2_IP
 
Last edited:

tigerwillow1

Known around here
Joined
Jul 18, 2016
Messages
3,849
Reaction score
8,519
Location
USA, Oregon
Thank you again for the help. I have to walk away from this for a few days because of the holidays, but really do want to get it working. This IP camera system is turning out to be much more headache than I ever thought. I'm constantly fiddling settings trying to work around the many bugs, and there are so many things that are either missing or incorrect in the documentation. The only reason I'm trying the Dahua camera is my disappointment in several aspects of the Hilvision cameras. I'm having to learn much more about networking that I want to. It's useful of course, just that I'd rather be spending my time on other things.
 

tigerwillow1

Known around here
Joined
Jul 18, 2016
Messages
3,849
Reaction score
8,519
Location
USA, Oregon
I found time to work on this. After a lot of steps, Virtual Host to the Dahua camera is "accidentally" fixed.

The route command as suggested works. I pulled connectors and changed configurations to convince myself that the direct connection to the camera was in fact going through the NVR, and not some other path. I got distracted because the Hikvision and LTS cameras don't answer pings. Dahua does.

As part of verifying the camera connection was going through the NVR, I disabled Virtual Host. Interesting that with Virtual Host off I could still access both NICs on the NVR, but not the cameras. Then I turned Virtual Host back on, and all of a sudden Virtual Host to the Dahua camera works! I deleted the route added to windows, and it still works.

I think the answer to the puzzle is:

After adding a camera, turn Virtual Host off, then turn it back on. Otherwise, Virtual Host won't work for the added camera.

Initially I'm favorably impressed with the Dahua camera compared to LTS/Hikvision. I'm going to put together a side-by-side setup to see if that impression holds.

After going through all of this I have the sinking feeling that with Virtual Host turned on, the cameras have access to the main network via the NVR. Is that a bad conclusion?
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,963
Reaction score
6,794
Location
Scotland
I pulled connectors and changed configurations to convince myself that the direct connection to the camera was in fact going through the NVR, and not some other path.
The 'tracert' Windows command will show the hops the packets pass through.
the Hikvision and LTS cameras don't answer pings.
Certainly the Hikvision cameras respond to a ping - if the network routing allows it.

with Virtual Host turned on, the cameras have access to the main network via the NVR.
Yes, that is likely.
If the LTS NVR firmware is like the Hikvision NVR firmware, enabling Virtual Host turns on the Linux kernel 'IP_forward' capability, which enables network traffic to flow between the 2 NVR LAN interfaces.
 

BankBuster

n3wb
Joined
Dec 6, 2016
Messages
6
Reaction score
14
Thanks,
After adding a Dahua camera to the Hikvision NVR, I could not browse through the NVR web GUI to the camera's GUI. Turning Virtual Host OFF then ON fixed it. Now I can setup my detailed configs in my cameras without extra cables, etc. K.I.S.S. is the right approach.
 

Valton

n3wb
Joined
Jun 2, 2019
Messages
8
Reaction score
2
Location
Orlando
Fellas, thanks a bunch for the idea of toggling Virtual Host off/on. I’ve been beating my head trying to login to my Dahua’s on the HIK NVR and this worked! Thx again
 
Top