setup VPN with static ip on a server [closed]

Solution 1:

There is some confusion over what a VPN is as it's been used by a lot of commercial vendors to imply a system where you tunnel all your PCs traffic to their endpoint. VPNs are also links between your machine and a private infrastructure (like a corporate or school infrastructure), but that limits the traffic that flows over it to just private IPs and DNS.

You probably want a VPN bridge between your PC and your CentOS server. For that, I'd suggest looking at WireGuard. There are many tutorial on it. Choose a private IP range and create a WireGuard link so you can SSH to your server over it. Then you can restrict SSH access on your machine so it's only accessible via the WireGuard IP address, and not the whole world.

The next step would be to tunnel your traffic through your CentOS box. There are two ways you can do this. Setup WireGuard to route all your Internet traffic, or just install a proxy server on your CentOS VM for web traffic. There's TinyProxy, Dante, and others. Then you can use the FoxyProxy browser extension to access that proxy server (be sure to access it over WireGuard/VPN and limit the proxy access to your VPN IP range). This is a good solution if you only want to proxy your HTTP/Web browsing traffic.

There are many tutorial on how to do this, on the WireGuard official page, and on the pages for the proxy servers I've listed.

You might also want to look at OpenVPN. It's older than WireGuard, and slower, but there is more documentation on setting it up.