I have a client with locally hosted security cameras. There is a DVR box that has a port open and a 3rd party app you can view the cameras from. Traditionally we have been forwarding the port to the WAN via the router there. Its a restaraunt btw.
When the ISP upgrades the router every few years there’s a huge headache trying to get the ports back open and bridging the modem and router blah blah blah. Not only this, even though they are supposed to have a static wan ip, it does change from time to time.
What i would like to do is plug in a raspberry pi on the network and forward the DVR’s ports somewhere accessable.
Im thinking of something along the lines of wireguard, but just for a single ip/port that i can tunnel over ngrok. Seems doable but i’m having trouble finding the proper terms to google. Port forwarding generally brings up router config, and tunnelling seems to expect you to be on the device who’s ports you wish to access.
Any advice?
SSH can do just that, example:
ssh -L 8080:localhost:8080 user@host
You can also automate this with autossh which is designed for exactly this kind of persistent tunnel. Although a simple “while” loop might seem like the intuitive way to keep it running, autossh is very reliable and takes care of all the corner cases for you.
Check out tailscale
You would configure your pi to be a subnet router it should be stupid easy to get going.
Something ive noticed from using wireguard from my phone is my traffic across the board slows down significantly while connected because everything is routed back home.
With tailscale can the user be connected, and only have a specific ip/domain routed through it? I also dont have access to the dvr’s internal system to run tailscale from it.
Anyway thanks for the lead, im reading up now
You can set what traffic goes across wireguard, either all of it, or only what is intended for the IP you are needing to connect to.
Someone recommended ssh, which is good, but it can’t do udp connections.
https://github.com/anderspitman/awesome-tunneling
From this list, I selected rathole since they claimed to be more performant than frp, the most popular solution.
Edit: just looked at your link. I think for the time being im going to use tailscale. Its a restaraunt, and they dont have a self-hosted server. Im trying to get around opening ports, so using an existing service. Your link did make me aware of cloudflare tunnels whick looks like it allows 50 users on a free plan vs tailscale’s 3. Although the 3 might work for them, I’ll have to check. Ill probably drop in an ngrok tunnel too so i can maintenence the pi remotely. (They are in a different state) i was mostly looking for advice on how to connect a port on one machine to another over a lan, and socat looks perfect
Actually, i found socat which seems to work just fine so far, and appears to be a standard linux command.
socat TCP4-LISTEN:8096 TCP4:192.168.86.2:8096
Thats a test i did with jellyfin at home