3

I am already sorry for what I am asking but I cannot find the right keywords for that.

I got a server with git, homepage etc. Now I just installed openvpn and it works great (except for the part where sometimes my isp shows up- dns leak?!)

But I want to know how I can do something like this: My Computer (no public ipv4) ---> My Server (public ipv4) --> Internet.

Let's say I have a Raspberry Pi and want to use the server as some kind of gateway(?) for some homepages I will host on the Pi. (Just as a use-case - please do not advice me to do it on the actual Server)

All in all I would be thankful if you can provide me some keywords I have to know and maybe some useful Links for that general topic. I would really like to get into that stuff some earlier because I will deal with that later in university (studying computer science).

Am I right when I have to 'google' for iptables to solve that problem?

Thanks in advance

I am still so sorry for that kinda beginner questions

2 Answers 2

0

Reverse proxy to a nonstandard port with ddns (I like google's free ddns on their registrar) or vpn or even tunnelbroker.net ipv6 tunnel (you get a static ipv6 block you can use for the backend)

Nginx does well with this, but you can use haproxy, Apache, F5, A10, others...

If you have more than one public IP you could do ssh tunneling or iptables.

0

If you want to utilize a vpn tunnel to redirect the traffic from your server to the client (raspberry pi), that is quite easy to accomplish using iptables. You need to define 2 rules, one is called DNAT (destination network address translation), which redirects the internet traffic arriving on your server on a given port to the client's vpn IP address and port and the other SNAT (source network address translation), which masks the IP of the client with the IP of the server and sends the answer back to the internet.

You won't need any ddns at all, the server does not need to know the client's IP address as the vpn connection is established from the client side via your static IP.

You need to enable IP forwarding on the server and define the routing using the OpenVPN configuration.

Official documentation

Related answers

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .