OpenVPN route client traffic to server

StaticDev

New Member
Joined
May 17, 2022
Messages
1
Reaction score
0
Credits
14
Good day,
I have my home server (on which I test my systems) freshly set up with Debian 11 today, and would like others to be able to connect to it. Of course I don't want my IPv4 to be shared, so I thought of the following solution: buy a cheap vServer and forward all requests to it. Theoretically, you could set up a VPN (with OpenVPN) and share the ports from the VPN client (my home server). Now I have the problem that I do not know exactly how to set this configuration.

Kind regards
Nicklas
 


You don't have to do such a complicated setup, you could just use Cloudflare to reverse proxy to your systems where you don't want your public ip to be exposed. That would look something like this.
If you would want to do that with an openvpn server you would have to have a public ip for every host on your home network and that each host connects to your openvpn server.

So that you could create firewall rules on your openvpn server based on the destintation(the public ip's) and port that it is correctly forwarded/natted to the correct system on your home netwerk with the forward adress being the correct vpn/private ip of that particular system. That would maybe look something like this as in logic of firewall rules.
Code:
if dest == 111.111.111.111 and port == 8080
then
       forward/nat 192.168.122.10 8080
elif dest == 112.112.112.112 and port == 9090
       forward/nat 192.168.122.11 9090
fi
The above logic example it to show that you can use different port numbers but you could just as well only do it with 443 like this.
Code:
if dest == 111.111.111.111 and port == 443
then
       forward/nat 192.168.122.10 443
elif dest == 112.112.112.112 and port == 443
       forward/nat 192.168.122.11 443
fi
However you will have an easier time and it will be less effort if you used Cloudflare as a reverse proxy.
 
Last edited:

Members online


Latest posts

Top