this post was submitted on 17 Jul 2024
9 points (100.0% liked)

homelab

6648 readers
7 users here now

founded 4 years ago
MODERATORS
 

I am hosting a couple of services (Matrix chat server and a game server). I know NAT's job is to translate external requests into internal addresses, so that the traffic can hit the WAN and ultimately make it to the internal service which is expected to handle the traffic, however I'm wondering if my setup is correct.

Everything is working as expected, but I'm just wondering how the traffic knows which service to go to. If an outside requests comes in, is it just the destination port that is used to route to the correct internal IP? Do I need to do something else here for best practices?

you are viewing a single comment's thread
view the rest of the comments
[โ€“] sloppy_diffuser@sh.itjust.works 1 points 4 months ago (1 children)

Looks good to me. Interface to Dest Ports are your match conditions. NAT IP/Port are the translations performed on each packet matched inbound and the Dest.

Traffic going the other way reverses this operation on the Src instead of destination.

That's an over simplification of NAT, but for basic port forwarding the general principal holds.

[โ€“] root@lemmy.world 1 points 4 months ago

Got it, thanks so much for the explanation!