Hello networking community! I need a setup where I can forward my server from my private network to another network which has a public ip to forward the server itself to the internet. When a client connects to the server, traffic should get forwarded to my private network somehow. I know that’s possible, but don’t know how I can achive that.
Came back after a year, got some knowledge. I achieved this setup using WireGuard (+ PersistentKeepAlive) and custom iptables rules on an old laptop with barebones arch install. By masquerading, we loose the source ip when forwarding, and to preserve it we need a L2 tunnel (L2GRE).
I cannot acquire a public ip on the top right, it is nearly impossible. Forwarded traffic will mostly be straight TCP and UDP traffic. The server at the top left must only forward all traffics to top right network somehow. It should not modify anything. I just need to make use of that public ip from my private network.