this post was submitted on 08 Jul 2023
4 points (83.3% liked)

networking

3178 readers
1 users here now

Community for discussing enterprise networks and the ensuing chaos that comes after inheriting or building one.

founded 2 years ago
MODERATORS
4
Advice needed (lemmy.world)
submitted 2 years ago* (last edited 10 months ago) by BloP@lemmy.world to c/networking@sh.itjust.works
 

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).

top 9 comments
sorted by: hot top controversial new old
[–] koopatroopa@lemmy.world 5 points 2 years ago* (last edited 2 years ago) (2 children)

Can you draw a diagram? It kind of sounds like you need either NAT or VPN or a combination of the two.

[–] Brunette6256@sh.itjust.works 2 points 2 years ago (1 children)

Sounds like he's behind a double NAT and wants a public IP

[–] BloP@lemmy.world 1 points 2 years ago

I don't think double NAT is my case. My ISP doesn't provide me with a public IP.

[–] BloP@lemmy.world 1 points 2 years ago (1 children)

Excuse my amateur drawing..

[–] koopatroopa@lemmy.world 2 points 2 years ago (1 children)

I agree with the double nat on the adsl side. If you have a private IP and still have internet it's behind a NAT. You need a public IP on the top right. When you say forward traffic what type of traffic is being sent? Do you want it relayed or are you ingesting it and manipulating it in some way? I guess what is the server in top left doing with it before it goes to game server at top right? A simple route would pass this traffic from server to game server at the routing level.

[–] BloP@lemmy.world 1 points 2 years ago* (last edited 2 years ago)

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.

[–] Brunette6256@sh.itjust.works 3 points 2 years ago (1 children)

Tailscale to connect everything. Then in the public server use a reverse proxy (nginx proxy manager or swag) and point it to the tailscale IP of the server you want out.

[–] BloP@lemmy.world 1 points 2 years ago (1 children)

Thanks for the reply! I will research it a bit, I still lack tons of knowledge about networking, yet still learning.

[–] orangeboats@lemmy.world 2 points 2 years ago

The above comment is right, use Tailscale or something similar. If you are interested in knowing more, search up "NAT transversal".

But my experience suggests that those solutions may introduce quite a bit of latency, which is probably not desirable when you are running a game server. If you have IPv6, take advantage of it and let the ADSL2 router connect to your forward server using IPv6.

load more comments
view more: next ›