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

    pfSense -> pfSense NUT connection issues

    Scheduled Pinned Locked Moved UPS Tools
    26 Posts 3 Posters 1.6k 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.
    • dennypageD
      dennypage @AngryAnt
      last edited by dennypage

      @AngryAnt said in pfSense -> pfSense NUT connection issues:

      Not following your correction to the NAT rule. Surely the destination matching should be the pfSense LAN address (192.168.1.1) and then the NAT IP (where the package is redirected to) should be 127.0.0.1 where NUT listens by default? Or am I completely misunderstanding psSense port forwarding here?

      No, when you NAT the destination of the [firewall] rule should be for the forward address, not the firewall interface address. 127.0.0.1 is the correct destination address [for the firewall rule].

      Please see the instructions for "option 1" here.

      AngryAntA 1 Reply Last reply Reply Quote 0
      • AngryAntA
        AngryAnt @dennypage
        last edited by

        @dennypage I'm sorry but I seem to be misunderstanding something core here. Looking at the option 1 instructions from your link, all of those match my forward point for point. I originally used those exact instructions to create the forward:

        Screenshot_20250603_163023.png

        (Note that I reintroduced the filter rule association as I moved away from the allow-all setup as outlined above)

        dennypageD 1 Reply Last reply Reply Quote 0
        • dennypageD
          dennypage @AngryAnt
          last edited by

          @AngryAnt said in pfSense -> pfSense NUT connection issues:

          By my understanding this still is effectively a bypass of the firewall,

          No, it's not bypassing the firewall. You aren't reposting your rules with every change, so we can't explain each success/failure, but I assure you nothing escapes the firewall rules.

          FWIW, I'm not sure exactly what you are really trying to do with the RFC1918 alias, but you may want to look at "Local networks" instead. And perhaps the Local tab on the firewall rules page. These are often overlooked simplifiers.

          AngryAntA 1 Reply Last reply Reply Quote 0
          • dennypageD
            dennypage @AngryAnt
            last edited by

            @AngryAnt The correction was for the destination of your firewall rule, not the destination of your NAT rule. Sorry this was ambiguous.

            1 Reply Last reply Reply Quote 0
            • AngryAntA
              AngryAnt @dennypage
              last edited by

              @dennypage Apologies - an obvious omission when juggling changes here. The updates are as follows - with host & port aliases added for better referencing and typo avoidance on my part:

              Screenshot_20250603_163707.png

              dennypageD 1 Reply Last reply Reply Quote 0
              • dennypageD
                dennypage @AngryAnt
                last edited by dennypage

                @AngryAnt said in pfSense -> pfSense NUT connection issues:

                @dennypage Apologies - an obvious omission when juggling changes here. The updates are as follows - with host & port aliases added for better referencing and typo avoidance on my part:

                Screenshot_20250603_163707.png

                Assuming that you still have the NAT rule in place...

                Okay, I think I may see the confusion. It's important to realize that the NAT packets do not pass through the firewall twice, only once, and that NAT is applied before the firewall are processed.

                So, looking at your rules, the rules that have source "Nilt", "Dejima", "Haro", "Toulon" are meaningless because they have the wrong Destination address. These are the rules referred to earlier that would need to have a destination address of 127.0.0.1. As it sits, these rules will have no effect because of the NATing.

                However, it won't really matter because below you have a rule that allows everyone access to 127.0.0.1. 😊

                With this in mind, it may help to re-read items 1 & 2 of the "Items related to your problem" list that I wrote above. I added a couple of words above to make it more clear.

                AngryAntA 1 Reply Last reply Reply Quote 0
                • AngryAntA
                  AngryAnt @dennypage
                  last edited by

                  @dennypage said in pfSense -> pfSense NUT connection issues:

                  Okay, I think I may see the confusion. It's important to realize that the NAT packets do not pass through the firewall twice, only once, and that NAT is applied before the firewall are processed.

                  Bingo! This is exactly the piece of the puzzle missing from my understanding. So with that in mind and given the port forward above, what should give me the result I am looking for is a ruleset like this?

                  Screenshot_20250603_170616.png

                  dennypageD 1 Reply Last reply Reply Quote 0
                  • dennypageD
                    dennypage @AngryAnt
                    last edited by

                    @AngryAnt said in pfSense -> pfSense NUT connection issues:

                    @dennypage said in pfSense -> pfSense NUT connection issues:

                    Okay, I think I may see the confusion. It's important to realize that the NAT packets do not pass through the firewall twice, only once, and that NAT is applied before the firewall are processed.

                    Bingo! This is exactly the piece of the puzzle missing from my understanding. So with that in mind and given the port forward above, what should give me the result I am looking for is a ruleset like this?

                    Screenshot_20250603_170616.png

                    Close.

                    If I understand what you are trying to do...

                    What I think you want is this (in order, following the Anti-lockout rule):

                    • Allow Nilt/Dejima/Haro/Toulon to 127.0.0.1:nut. Just as you have the rules currently.
                    • Rules to drop some of the Dejima packets without logging. FWIW, I would recommend this be done on an individual port basis to avoid issues down the road.
                    • Allow * to ! Local networks. NB: "Local networks" is a pfSense provided system alias, found at the bottom of the destination selection list.

                    In addition, you will want rules to allow access to the firewall for things like DNS and NTP. The Local tab is a good place for this.

                    AngryAntA 1 Reply Last reply Reply Quote 0
                    • AngryAntA
                      AngryAnt @dennypage
                      last edited by AngryAnt

                      @dennypage Your interpretation of my intent is exact. Thank you for the suggested improvements :)

                      Before I touch anything else here: In combination with the port forward, the given hosts should through these rules have access to the NUT server when it is only set to LISTEN 127.0.0.1 either explicitly or reliant on that default?

                      dennypageD 1 Reply Last reply Reply Quote 0
                      • dennypageD
                        dennypage @AngryAnt
                        last edited by

                        @AngryAnt said in pfSense -> pfSense NUT connection issues:

                        Before I touch anything else here: In combination with the port forward, the given hosts should through these rules have access to the NUT server when it is only set to LISTEN 127.0.0.1 either explicitly or reliant on that default?

                        Localhost is already accounted for by NUT, and you do not need to add a LISTEN directive.

                        I believe the only thing you need in the Advanced section will be the user/password entries in Additional configuration lines for upsd.users.

                        AngryAntA 1 Reply Last reply Reply Quote 0
                        • AngryAntA
                          AngryAnt @dennypage
                          last edited by

                          @dennypage Ok so something is still not right. I'm assuming with the port forward. If I drop the LISTEN directives in order to rely on the port forward and firewall rules, all clients stop being able to connect. upsc ups@192.168.1.1 times out. Adding back the LISTEN 192.168.1.1 directive restores access (but obv. no longer lets me filter access by host).

                          dennypageD 1 Reply Last reply Reply Quote 0
                          • dennypageD
                            dennypage @AngryAnt
                            last edited by

                            @AngryAnt said in pfSense -> pfSense NUT connection issues:

                            Ok so something is still not right. I'm assuming with the port forward. If I drop the LISTEN directives in order to rely on the port forward and firewall rules, all clients stop being able to connect. upsc ups@192.168.1.1 times out.

                            Here is what your NAT should look like:

                            Screenshot 2025-06-03 at 09.42.23.png

                            Note that "Filter rule association" is set to "none" in the NAT.

                            Here are two example firewall rules:

                            Screenshot 2025-06-03 at 09.48.01.png

                            The firewall first rule is an example of granting access to a specific system. The second firewall rule is an example of denying access to everyone else. You only need the second rule if you have an "allow all" rule further down in the list.

                            Btw, keep in mind that the upsc test you are running must be from one of the devices you have allowed...

                            AngryAntA 1 Reply Last reply Reply Quote 0
                            • AngryAntA
                              AngryAnt @dennypage
                              last edited by

                              @dennypage That all checks out. I had explicited the firewall allow rules to the NUT port only, but changing them to any had no effect. My best guess is still that I have managed to have something somewhere else mess up my port forward even though it is configured identically to what has been shown in this thread and indeed your latest reply here.

                              I will keep chasing what might possibly trip up that port forward. Thanks again for all of your patience and help :)

                              dennypageD 1 Reply Last reply Reply Quote 0
                              • dennypageD
                                dennypage @AngryAnt
                                last edited by

                                @AngryAnt said in pfSense -> pfSense NUT connection issues:

                                I had explicited the firewall allow rules to the NUT port only

                                Yes, that is appropriate. The allow example really should have had a destination port like so:

                                Screenshot 2025-06-03 at 10.56.00.png

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