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?

  • sloppy_diffuser@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    0
    ·
    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.