This question was originally asked in networkengineering.stackexchange and suggested to be moved here.
TL;DR
Multiple locations with local CCTV. How to remote access all of them, with an ISP that services IPv4 behind CGNAT and the DVR doesn't supports DDNS for IPv6. DVR also offers API, SDK, P2P and PPPoE:
API: Needs an HTTP connection to make the calls, CGNAT on the way.
SDK: Not sure how to leverage the SDK. Maybe I can embed software in the DVR, but don't know how to do it or where to start.
P2P: Don't know how to reproduce this connection. Also, it probably only allows live footage, which I already have with RTSP.
PPPoE: Not sure if it is even related to the problem.
Possible solutions that I was recently made aware and I'm still researching:
a. IPv6 to IPv4 tunneling
b. Is it possible to config a VPN just for the cameras/DVR traffic?
Intro
My family owns a local business that have 2 stores and a warehouse. They all have CCTV footage locally stored. I'm developing a side project for me to access those images remotelly, process them in a ML model and raise more relevant alarms.
I have a limited knowledge in computer networks, but my understanding is:
- For all the locations, the ISP services us with IPv4 behind a CGNAT, meaning my public IPv4 is not only "mine".
- I was able to access the live feed of the cameras using RTSP protocol with IPv4, by configuring port forwarding in the local router (of each location) for port 554. AFAIK this shouldn't be possible behind the CGNAT. The delay is sometimes ok (~2 sec) and sometimes awful (~20sec).
- I've tried configuring port forwarding of ports 80, 8080, 37777 and 443 so I could be able to access the DVR interface remotely. That didn't work, I got either
ERR_CONECTION_TIMED_OUT
orERR_EMPTY_RESPONSE
. I've tried all these ports just to be sure, but internally in the network I can access the DVR interface by accessinghttp://192.168.15.93:8080
, so just port 8080 should be enough. (Yes, I'm using the public IP when trying to access from outside the network)
My understanding is that I can't access the DVR interface because of the CGNAT, but shouldn't that also mean that the RTSP should also fail?
Problem
I'm exploring solutions beyond getting a static IPv4.
I don't want to process all cameras 24/7 through RTSP, for a number of reasons: bandwidth consumption, cost of executing the model 24/7 * {nr of cameras}
, large delays with RTSP (probably caused by network conditions?), etc
I managed to get API docs and SDK for the DVR. I will be honest and say that I have no idea what to do with the SDK, as most of my programming has been for online platforms. I suppose that it's for embedding the software in the DVR or Cameras? I'd love to do that, but have no idea where to start.
With the API I can listen to the events the camera's raises, so I can process images only when there are events. However I can't reach the DVR remotely because of the CGNAT. I could, in theory do it through IPv6, but it's a dynamic IP and that means I'd have to reconfigure every time it changes. The DVR supports DDNS, but apparently only for IPv4.
Finally, there are two other types of connection supported by the DVR:
- One is called P2P, I can use the camera's APP to connect to it so I can see footage, but I don't know how to reproduce this connection so I can retrieve the image myself and process it. Not sure if this allows me to reach the API though.
- The second is PPPoE, which I also don't know how it works, and a quick google fu didn't help. It may not be related to the problem at all.
Note: Read somewhere about ipv6 to ipv4 tunneling, still reading about it, unsure if this is the right path.
Question
How can I connect remotely to my DVR if it's behing a CGNAT in IPv4, and IPv6 doesn't have DDNS support (in the DVR)?
Ideally I'm looking for a solution that runs remotely and not running locally on each location. (Besides the DVRs, obviously)