R
R
roxyroxy2020-10-05 16:14:11
openvpn
roxyroxy, 2020-10-05 16:14:11

How to open access to the server from the outside using a tunnel to a VPS with a white IP?

Good day. I continue my "entertainment" with VPS and OpenVPN, simultaneously pumping my networking skills.
There is a VPS (ubuntu) with a white static IP, I managed to tunnel through OpenVPN and on a personal computer (windows 10, where the gray address was originally) the IP address changed to the server address.
But here's the question now. I have a desire to run a game server on a PC in order to give IP to friends without any stupid services - and they safely logged into this server. But, alas, the result is negative. Although the IP has changed, the server is not visible from the outside and there is no way to connect to it. My assumptions - you need to arrange port forwarding, or maybe something else? If the ports, then registered on the router to the internal address of the computer, maybe you need to do a redirect? Here I feel that something is close, but I do not know what exactly and how.
Maybe I built the tunnel incorrectly? Or not built at all.
Once I used the Ngrok utility - it seems to also create a tunnel and return a public address, in this case the result is favorable, but did not suit me for a number of reasons.
I hope there is an opportunity to fulfill my little dream with the help of a personal VPS (which I only have because of a white IP). Tell me, where did I turn wrong? In which direction to move? I will be grateful if you can get me out of this jungle :) !

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nird, 2020-10-05
@roxyroxy

*nat
-A PREROUTING -d external_ip_VPS/32 -i eth0 -p tcp -m tcp --dport External_VPS_port -j DNAT --to-destination internal_IP_VPN_clienta:port_on_local_service_running
-A POSTROUTING -d internal_IP_VPN_clienta/32 -o wg0(VPS VPN interface) -p tcp -m tcp --dport port_on_which_service_runs_in_locale -j MASQUERADE
COMMIT
Well, enable routing.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question