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

    Rules not working unless restart

    Scheduled Pinned Locked Moved Firewalling
    10 Posts 4 Posters 1.9k Views 4 Watching
    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.
    • L Offline
      lcs
      last edited by

      Hello,
      I've been experiencing this issue for the past 1-2 weeks now.
      What happens exactly is : if I add a new rule, change a rule, create NAT, open port.. no matter what, I have to reboot the firewall or do /etc/rc.reload_all otherwise the rules are not working.
      This happened first at 2.5.x, I've reinstalled, restored from backup all was good for 1-2 days, then the issue started again.
      I replaced the ssd with another one and installed 2.6.0 - clear install, no restoration from backup. I did the rules from 0. All was working fine. Couple of days later - same behavior.
      Any ideas? This is driving me insane.

      N 1 Reply Last reply Reply Quote 0
      • N Offline
        netblues @lcs
        last edited by

        @lcs This isn't certainly the case in general.
        And replacing the ssd is irrelevant too.
        If it boots, and works, then ssd is ok.

        What kind of rules?
        Have you tried clearing states after applying rules?

        L 1 Reply Last reply Reply Quote 0
        • L Offline
          lcs @netblues
          last edited by

          @netblues When I reinstalled and did backup-restore, I thought maybe the backup file was corrupted, so I changed the entire sdd and rebuild the config from 0. The point of swapping the ssd was to have a semi-working state system with the entire rule set, if I should need those later.

          I did try to clear the states, no luck.
          This is happening with all rules, WAN/LAN.
          Even if I change the Description of any rule, I can still see the pass/block event (if logging is enabled) with the old description.
          When I reboot or reload_all the issue is fixed and I can see the updated description.

          GertjanG 1 Reply Last reply Reply Quote 0
          • GertjanG Offline
            Gertjan @lcs
            last edited by

            @lcs said in Rules not working unless restart:

            Even if I change the Description of any rule,

            Open the content of /tmp/rules.debug in a text editor.

            Now, change a LAN rules, only the description will do.

            Open again the /tmp/rules.debug file in another editor - compare with the first editor.

            You should find :

            ...... "USER_RULE: xxxxxx "
            

            where xxxxxx is your modified comment.

            Btw : /tmp/rules.debug are the rules loaded into the firewall 'pf'.

            No "help me" PM's please. Use the forum, the community will thank you.
            Edit : and where are the logs ??

            L 1 Reply Last reply Reply Quote 0
            • L Offline
              lcs @Gertjan
              last edited by

              @gertjan as of this moment it's working.
              I can see the change in the file and in the UI.
              I'll test later again and upload the results.

              1 Reply Last reply Reply Quote 0
              • L Offline
                lcs
                last edited by lcs

                example :
                As you can see from the screenshot, the rule is disabled.
                Screenshot_20220418_202713.png

                And it's still allowing traffic to pass.
                No change after states reset.
                Screenshot_20220418_202723.png

                Another example.
                I have a NAT forwarding port 80 from public internet for acme challenge.
                Screenshot_20220418_192408.png

                Traffic is blocked by a rule which was disabled.

                Screenshot_20220418_192428.png

                On top of that, for some reason, I cannot open port 80 in any way anymore.
                Example
                I have a NAT allowing port 80
                fa9255ff-8b31-406d-9eaf-e846a0e1e681-image.png

                This is the firewall rule
                54108908-eb03-4c10-9cc7-72b40013bbfc-image.png
                and yet while testing from external network, the port is listed as closed.

                This is a capture during my tests. I can see the incomming traffic on port 80 but the rule allowing that is never triggered.
                ex.jpg

                The ports are open when tested from internal network.

                4550ebf9-06e7-4d43-b0c8-0fd006ff5c94-image.png

                L 1 Reply Last reply Reply Quote 0
                • L Offline
                  lcs @lcs
                  last edited by lcs

                  Some more details
                  As you can see, this alias contains ports 80 and 443
                  199bf3e0-6773-4f14-84cb-4feffd65ae4c-image.png

                  Extract from rules.debug
                  Untitled.jpg

                  And after this I can see ports 80 and 443 open

                  1 Reply Last reply Reply Quote 0
                  • N Offline
                    netblues
                    last edited by

                    So basically you say that any change you make isn't applied unless you reboot/update rules by hand, and you have tried clearing states too.

                    Clearly if this was the general case there would be numerous posts here.

                    Any other software used? eg squid/pfblockerng
                    Anything else from packages?

                    Floating rules have a tendency to create difficult to comprehend corner cases, however behaviour is constant, and not after a couple of days.

                    L 1 Reply Last reply Reply Quote 0
                    • L Offline
                      lcs @netblues
                      last edited by lcs

                      @netblues I have pfblocker ng for geoblock on one of my services, which is not related to this. Even with pfblocker disabled it's the same. I tried disabling suricata - same behavior.
                      Yesterday the new rulleset wouldn't apply even after restart. I had to manually reload all a couple of times.

                      This is what I got
                      927da914-74a5-4d9c-b5a9-ed5e03f57a08-image.png

                      The weird thing is, sometimes it's working just fine for days and days, and sometimes it just stops without any prior changes done.

                      S 1 Reply Last reply Reply Quote 0
                      • S Offline
                        swinster @lcs
                        last edited by

                        @lcs FWIW, I appear to have a similar issue (using v2.6.0). This is caused for me, when I use aliases.

                        So, for example, I had a simple inverted block rule against a single hosts IP address, which worked just as expected. I then needed to extend this rule by adding an additional host, so a created an alias to capture both hosts IP's, then edited the original rule to use the alias rather than the original IP. I actually made a typo in the alias IP, but once it was updated to be correct, the rule was not applied as expected until pfsense is rebooted.

                        Just to test this, I set up a continual ping to a host in another subnet that should match the rule and be allowed to pass. Of course, this did not work, then I rebooted pfsense, as as it came up, so the ICMP message started getting through.

                        I was looking for a way to reload the rule set without rebooting and came across this post.

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