Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    NAT port forward with alias (multiple ports)?

    Scheduled Pinned Locked Moved NAT
    3 Posts 2 Posters 9.9k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • X
      xarope
      last edited by

      Hi all,

      I'm wondering if this will work properly, to port forward all the ports required for an email server, from the external WAN interface to an internal server.

      1. Define alias A1=ports 25, 465, 587, 143, 993 (i.e. all the ports required for SMTP/IMAP)

      2. Then create a NAT port forward rule, Source: WAN IP, Destination Ports: A1, Destination: Internal LAN IP, NAT ports: A1
        (Rather than creating 5 separate NA port forward rules)

      Does pfSense automagically know that it needs to port forward to the respective ports (i.e. WAN IP port 25 -> LAN IP port 25, WAN IP Port 143 -> LAN IP port 143, WAN IP Port 993 -> LAN IP port 993 etc)?  Versus just trying to forward packets either in round robin or random fashion, e.g. port 25 sometimes goes to port 143, or 465 etc?

      My testing seems to indicate it's working properly; I did a bunch of telnet tests to port 25, and kept getting ESMTP prompts, so either I very luckily only ever hit 25/587, and never 465/143/993, or else it is working correctly!

      Thanks in advance.

      1 Reply Last reply Reply Quote 1
      • GruensFroeschliG
        GruensFroeschli
        last edited by

        No round robin included ;)

        It does forward the ports correctly.

        However what doesn't work is if you want to forward ports with aliases if the internal port differs from the external port
        (eg. you want to forward port "25, 93 and 110" to "10025, 10093 and 10110")

        We do what we must, because we can.

        Asking questions the smart way: http://www.catb.org/esr/faqs/smart-questions.html

        1 Reply Last reply Reply Quote 0
        • X
          xarope
          last edited by

          @GruensFroeschli:

          No round robin included ;)

          It does forward the ports correctly.

          However what doesn't work is if you want to forward ports with aliases if the internal port differs from the external port
          (eg. you want to forward port "25, 93 and 110" to "10025, 10093 and 10110")

          Great, that just saved me having to create 7 different rules, instead of just 1 (I forgot to also add 80 and 443 for the webmail component).  Thanks again!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.