9
Question about NAT (lemmy.world)
submitted 2 months ago by root@lemmy.world to c/homelab@lemmy.ml

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 2 months ago

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 2 months ago

Got it, thanks so much for the explanation!

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

homelab

6460 readers
4 users here now

founded 4 years ago
MODERATORS