1

My goal is to set up a public IP for a Android Smartphone which is running an "IP Cam" software. The interface can be accessed in local network on (example) 192.168.0.2:8080, but it has no public IP, as it should also work in the 3G network.

I know there are services which offer a VPN with static dedicated addresses; the free one I found offers only PPTP with IPv6 (didn't work).

The rest of them offer IPv4 for much higher cost than an actual VPS at Host1Plus with the lowest specs, so I went with this. At least I can practice and/or use the VPS for other projects. I followed this tutorial.

Now I am at the point where I created a new user, assigned a static VPN Address in the OpenVPN Admin Panel to the account, and logged in with my device.

Everything works so far. My android device gets the public IP of the VPS while browsing.

I can ping the device's private VPN IP in the ssh terminal of the VPS.
What is the next step?

I tried this, but it doesn't really work. I am lost at this point. I never did anything with routes or forwarding.

If I enter the public VPS IP right now, I get the openVPN Login Form as before. If I enter [PublicVPSIP]:8080 I get a "Server not reachable etc." error.

At the end it should work like this.

Android (running some service at port 8080) (VPN IP: 1.2.3.4)

connects via openVPN to my VPS

VPS (running openVPN Server) (Public IP: 123.123.123.123)

Traffic from visitor at 123.123.123.123:8080 should be redirected/forwarded to my android device. (1.2.3.4:8080)

0

I solved it. For other people with the same problem.

This article helped me: Forward a TCP port to another IP or port using NAT with Iptables

Additionally (as I have no idea if this is enough because of attacks) I followed this: How to block all ports except ...

Just to block all remaining ports which might be open which I don´t need. Of course don´t forget to add your SSH port to the exception or you get locked out of your SSH terminal.

Although I am not sure if this is enough to really harden Your VPS against attacks etc. So I am happy about further suggestions

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.