Score:0

OpenVPN route to other local IP Address than PC

tm flag

I have VPS with server OpenVPN. iptables rules on VPS:

iptables -A PREROUTING -t nat -i ens3 -p tcp --dport 54000 -j DNAT --to 10.8.0.2:8080
iptables -A FORWARD -p tcp -d 10.8.0.2 --dport 8080 -j ACCEPT

Actually it works like that:

  • I connect to OpenVPN from PC
  • Port 8080 from PC is forwarded to VPS and i can connect it via web: 51.xx.xx.xx:54000

What i need:

  • I connect to OpenVPN from PC
  • Port 8080 from Camera is forwarded to VPS and i can connect it via web: 51.xx.xx.xx:54000

It is possible?

Setup:

  • Router: 192.168.100.1
  • PC: 192.168.100.164
  • Camera: 192.168.100.165

Thanks in advance for help.

paladin avatar
id flag
Use a reverse proxy (for example NGINX) at your PC which points to the camera. Then you can forward the port of your reverse proxy to your VPS.
Krop avatar
tm flag
Ok, now HTTP it's working, but i can't do RTSP with this method on port 554, why? It's possible using NGINX?
Krop avatar
tm flag
It says "rtsp://admin:[email protected]:XXXX: Invalid data found when processing input
paladin avatar
id flag
In default NGINX only does reverse proxy for HTTP and maybe HTTPS. Additional protocols have to be configured. Ask Google and take a look into the documentation.
Krop avatar
tm flag
Ok, thank you very much :).
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.