0

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)

seb
  • 83
  • 1
  • 7
  • Yes, a VPN is a common genertic solution for this. You'll need a policy routing also, to implement a "default vpn, but what went direct gets answered direct" policy. I myself explained a scheme several times in different answers here. – Nikita Kipriyanov Sep 26 '22 at 03:32
  • 2
    Does this answer your question? [How to hide web server IP?](https://serverfault.com/questions/956651/how-to-hide-web-server-ip) – Gerald Schneider Sep 26 '22 at 05:11
  • Nat Router? Home and end user question are not on topic for serverfault. – djdomi Sep 26 '22 at 06:30
  • We're a company and that's a hard-core server I'm talking about. – seb Sep 26 '22 at 11:40
  • do we talk about pr0|\|? whatever, use the linked article from gerald – djdomi Sep 26 '22 at 17:51
  • Not a web server... hiding the IP of a web server is easy... – seb Sep 27 '22 at 04:40

0 Answers0