Kind of a newbie question. I have an Ubuntu server (18.04) behind a NAT router. I need to hide the router's IP address (=server's public IP).
Basically, I need a proxy.
I have set up reverse proxies for outside's clients to connect to the server (i.e., incoming traffic); works fine.
Now I need a proxy for outgoing traffic. i.e., traffic initiated by the server. Traffic can be on almost any port (source/destination) so web proxies are a no-go.
All outgoing traffic should go to the proxy then to the destination (except responses to the incoming traffic).
Sounds easy enough to set up a proxy, but I haven't been able to find good docs on it. Must be too easy. Found stuff on Squid and the like (web proxy) but that's about it.
I think I know how to set up a proxy server so that part is fine. (I have set up reverse proxies, after all)
What should I do on my server to make it send traffic to the proxy? Change default route and point it to the proxy? But the server is behind NAT… if the default route doesn't point to the NAT router, traffic will never go outside.
Sorry for the basic question. And if you have another way of hiding the public IP address than a proxy, please suggest it. (Use a VPN service maybe?)
Edit: This is not a web server. And we can already hide the IP to clients. Problem is the server gives away its address with its outgoing traffic. (testing VPN now, looks promising)