Trying to use OpenVPN to access NVR from outside network

justinneed

n3wb
Oct 22, 2019
11
4
United States
I've setup a raspberry pi with openvpn using pivpn. I can use the VPN to access my home network, but I'm unable to access my Northern Video NVR that is connected to the network. When I connect back to my home network directly (no VPN), I can use the ip address of the NVR to view the NVR streams and recordings. The VPN allows me to get on the network (i.e. my public IP changes to home network, I can see router settings, etc.), but I cannot get a connection to my NVR. Can someone help me out?
 
I could be wrong,.. with my limited exposure to all this,.. having said that I have setup OpenVPN on my router and its all working for me.

OpenVPN may be 'presenting' you to the NVR appearing to come from a network other than your internal address range; I've configured mine to 'map my connections' to '10.x.0.0' range, If you have any sort of restrictions on your end device that only 'allows' from your internal network, e.g. '192.168.x.0' then chances are you'd be rejected when coming over VPN.
 
I could be wrong,.. with my limited exposure to all this,.. having said that I have setup OpenVPN on my router and its all working for me.

OpenVPN may be 'presenting' you to the NVR appearing to come from a network other than your internal address range; I've configured mine to 'map my connections' to '10.x.0.0' range, If you have any sort of restrictions on your end device that only 'allows' from your internal network, e.g. '192.168.x.0' then chances are you'd be rejected when coming over VPN.

When I connect to OpenVPN it assigns me the IP address in that 10.x.0.0 range you mentioned. What I'm working on right now is configuring the router to have a local IP in that range. I'm hoping that doing all of this might help me access the cameras. I'm trying a bunch of different things as part of process of elimination. If something ends up working, I'll update this post.
 
Maybe add a route to your main router so that it shoves traffic destined for the 10.x.0.0 range to the local interface of the RPi might do the trick. Currently its default would be the internet I'd presume,. and you're probably dishing out a default route via DHCP to your router. Your router needs to know how to reach 10.x.0.0 - at least that's what I think.
 
Maybe add a route to your main router so that it shoves traffic destined for the 10.x.0.0 range to the local interface of the RPi might do the trick. Currently its default would be the internet I'd presume,. and you're probably dishing out a default route via DHCP to your router. Your router needs to know how to reach 10.x.0.0 - at least that's what I think.

How would I go about doing this? I have no clue where to even get started with this.

I did try changing my router's local IP to the 10.x.0.0 IP that matched what the device on VPN would get, but it totally messed up my internet connection for my devices whenever I connected to the VPN, so I stopped that.

This has honestly been very frustrating because most people I've talked to, online forums, and tutorials have mentioned how this is a pretty simple process where logging into a VPN is the best way of viewing cameras without having them accessing the internet. Setting up the VPN should have allowed me to view the cameras as if I'm sitting at home connected to my home network, but guess what I can connect to my home network and remotely access my home devices except the one I need to access! What a disaster... Now I'm dealing with all of these issues that other people supposedly didn't have. It's really frustrating that a 30 minute job is turning into this.
 
Wouldn't have thought this was all a 30minute job,.. if your NVR doesn't need any internet access, you'd probably get away with making its default gateway address point to the RPi's internal address, e.g. 192.168.x.x.