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

    NAT Port Forward vs Firewall Rule

    Scheduled Pinned Locked Moved General pfSense Questions
    5 Posts 4 Posters 1.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.
    • P Offline
      Peter847
      last edited by

      Could someone help me improve my understanding of PfSense?

      I have a device on my network that has its DNS servers hard coded so I use a NAT port forward rule to catch everything it sends on port 53 and redirect it to the DNS server of my choice.  I copied the setup from one of the posts in this forum.  Is there any reason why I should use the NAT rule, can I just achieve the same thing with a standalone Firewall rule and dispense the linked NAT rule?

      Peter

      1 Reply Last reply Reply Quote 0
      • johnpozJ Online
        johnpoz LAYER 8 Global Moderator
        last edited by

        how would your firewall rule redirect traffic to say 8.8.8.8 on udp to the IP address your redirecting too..

        An intelligent man is sometimes forced to be drunk to spend time with his fools
        If you get confused: Listen to the Music Play
        Please don't Chat/PM me for help, unless mod related
        SG-4860 24.11 | Lab VMs 2.8, 24.11

        1 Reply Last reply Reply Quote 0
        • K Offline
          kpa
          last edited by

          NAT stands for "Network Address Translation". In PF (and pfSense) this process is totally separate from the packet filtering process. The packet filtering process does just filtering as the name suggests, if you want to do any sort of address translation you have to use the NAT engine of PF and its RDR and NAT rules.

          1 Reply Last reply Reply Quote 0
          • P Offline
            Peter847
            last edited by

            Ah, yes!

            I thought the NAT linked firewall rule was just the same as any other firewall rule but I now see that the "destination" section of the NAT rule is the destination for the redirected packet whereas the destination for a normal firewall rule just selects the packets for Pass/Reject.  Correct?

            Peter

            1 Reply Last reply Reply Quote 0
            • DerelictD Offline
              Derelict LAYER 8 Netgate
              last edited by

              The complement each other / work in tandem.

              You can forward the port but without the firewall rule no traffic will pass.

              You can add the firewall rule but without the port forward there will be no inbound traffic for the destination address (usually an RFC1918 address).

              Chattanooga, Tennessee, USA
              A comprehensive network diagram is worth 10,000 words and 15 conference calls.
              DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
              Do Not Chat For Help! NO_WAN_EGRESS(TM)

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