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

    PfBlocker

    Scheduled Pinned Locked Moved pfSense Packages
    896 Posts 143 Posters 1.3m 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.
    • T
      taryezveb
      last edited by

      I keep getting these messages in the system log:

      Dec 29 17:01:02 php: : There were error(s) loading the rules: /tmp/rules.debug:19: cannot define table pfBlockerTBG: Cannot allocate memory pfctl: Syntax error in config file: pf rules not loaded - The line in question reads [19]: table <pfblockertbg>persist file "/var/db/aliastables/pfBlockerTBG.txt"

      Dec 29 17:01:02 php: : New alert found: There were error(s) loading the rules: /tmp/rules.debug:19: cannot define table pfBlockerTBG: Cannot allocate memory pfctl: Syntax error in config file: pf rules not loaded The line in question reads [19]: table <pfblockertbg>persist file "/var/db/aliastables/pfBlockerTBG.txt"

      Dec 29 17:00:53 php: : The command '/sbin/pfctl -o basic -f /tmp/rules.debug' returned exit code '1', the output was '/tmp/rules.debug:19: cannot define table pfBlockerTBG: Cannot allocate memory pfctl: Syntax error in config file: pf rules not loaded'

      Dec 29 17:00:23 php: : There were error(s) loading the rules: /tmp/rules.debug:19: cannot define table pfBlockerTBG: Cannot allocate memory pfctl: Syntax error in config file: pf rules not loaded - The line in question reads [19]: table <pfblockertbg>persist file "/var/db/aliastables/pfBlockerTBG.txt"

      Dec 29 17:00:23 php: : New alert found: There were error(s) loading the rules: /tmp/rules.debug:19: cannot define table pfBlockerTBG: Cannot allocate memory pfctl: Syntax error in config file: pf rules not loaded The line in question reads [19]: table <pfblockertbg>persist file "/var/db/aliastables/pfBlockerTBG.txt"

      Dec 29 17:00:15 php: : The command '/sbin/pfctl -o basic -f /tmp/rules.debug' returned exit code '1', the output was '/tmp/rules.debug:19: cannot define table pfBlockerTBG: Cannot allocate memory pfctl: Syntax error in config file: pf rules not loaded'

      Dec 29 16:59:45 php: : There were error(s) loading the rules: /tmp/rules.debug:19: cannot define table pfBlockerTBG: Cannot allocate memory pfctl: Syntax error in config file: pf rules not loaded - The line in question reads [19]: table <pfblockertbg>persist file "/var/db/aliastables/pfBlockerTBG.txt"

      Dec 29 16:59:45 php: : New alert found: There were error(s) loading the rules: /tmp/rules.debug:19: cannot define table pfBlockerTBG: Cannot allocate memory pfctl: Syntax error in config file: pf rules not loaded The line in question reads [19]: table <pfblockertbg>persist file "/var/db/aliastables/pfBlockerTBG.txt"

      Dec 29 16:59:36 php: : The command '/sbin/pfctl -o basic -f /tmp/rules.debug' returned exit code '1', the output was '/tmp/rules.debug:19: cannot define table pfBlockerTBG: Cannot allocate memory pfctl: Syntax error in config file: pf rules not loaded'

      Dec 29 16:59:06 php: : There were error(s) loading the rules: /tmp/rules.debug:19: cannot define table pfBlockerTBG: Cannot allocate memory pfctl: Syntax error in config file: pf rules not loaded - The line in question reads [19]: table <pfblockertbg>persist file "/var/db/aliastables/pfBlockerTBG.txt"

      Dec 29 16:59:06 php: : New alert found: There were error(s) loading the rules: /tmp/rules.debug:19: cannot define table pfBlockerTBG: Cannot allocate memory pfctl: Syntax error in config file: pf rules not loaded The line in question reads [19]: table <pfblockertbg>persist file "/var/db/aliastables/pfBlockerTBG.txt"

      Dec 29 16:58:58 php: : The command '/sbin/pfctl -o basic -f /tmp/rules.debug' returned exit code '1', the output was '/tmp/rules.debug:19: cannot define table pfBlockerTBG: Cannot allocate memory pfctl: Syntax error in config file: pf rules not loaded'

      But in the Dashboard everything looks good.

      2011-12-29-170804_1438x884_scrot.png
      2011-12-29-170804_1438x884_scrot.png_thumb
      2011-12-29-171601_1438x884_scrot.png
      2011-12-29-171601_1438x884_scrot.png_thumb</pfblockertbg></pfblockertbg></pfblockertbg></pfblockertbg></pfblockertbg></pfblockertbg></pfblockertbg></pfblockertbg>

      1 Reply Last reply Reply Quote 0
      • marcellocM
        marcelloc
        last edited by

        Increase even more Firewall Maximum Table Entries in system->advanced -> firewall/NAT

        Treinamentos de Elite: http://sys-squad.com

        Help a community developer! ;D

        1 Reply Last reply Reply Quote 0
        • T
          taryezveb
          last edited by

          Ok, will try that. Now is at 3000000, will try with 4000000.

          Edit: with 4000000 still getting those messages. Will keep trying until I find a number that works and report back.

          1 Reply Last reply Reply Quote 0
          • marcellocM
            marcelloc
            last edited by

            Don't forget to see memory use in dashboard. If you are getting more then 80% may be time for an upgrade or smaller lists.

            Treinamentos de Elite: http://sys-squad.com

            Help a community developer! ;D

            1 Reply Last reply Reply Quote 0
            • T
              taryezveb
              last edited by

              Memory is at 44% at the moment, I should have plenty of headroom.

              1 Reply Last reply Reply Quote 0
              • T
                tommyboy180
                last edited by

                Personally I took mine up to a high value that would never be reached (something like 9999999999999999 or similar). I did this for several reasons.
                No memory is allocated based on this number and it makes it easy to increase my table usage without trying to find a limit that will work. So it doesn't cost you anything and this ensures that no matter how many lists I use I won't run into any issue. Just in case someone is wondering my system only has 2GB of mem which is more than enough.

                -Tom Schaefer
                SuperMicro 1U 2X Intel pro/1000 Dual Core Intel 2.2 Ghz - 2 Gig RAM

                Please support pfBlocker | File Browser | Strikeback

                1 Reply Last reply Reply Quote 0
                • T
                  taryezveb
                  last edited by

                  I was trying to do it incrementally, but that is not working. Got up to 15000000, but then saw your post. So I'm going to try that large number[9999999999999999].

                  1 Reply Last reply Reply Quote 0
                  • marcellocM
                    marcelloc
                    last edited by

                    Are you sure you are not reading an old alert?

                    BTW, if a really large value does not exaust memory, It's an excelent option to prevent errors.

                    Treinamentos de Elite: http://sys-squad.com

                    Help a community developer! ;D

                    1 Reply Last reply Reply Quote 0
                    • T
                      taryezveb
                      last edited by

                      @marcelloc:

                      Are you sure you are not reading an old alert?

                      BTW, if a really large value does not exaust memory, It's an excelent option to prevent errors.

                      Yes, I was making sure they where not old. I have 4GB in this box. Current memory usage:
                      Mem: 603M Active, 67M Inact, 1151M Wired, 1048K Cache, 406M Buf, 1991M Free
                      Swap: 8192M Total, 8192M Free

                      When I initially click on save, it all works fine for a few minutes[~2]. Then after a random amount of time, clicking different menus to check the settings the error pops back up. At first after using 9999999999999999; I was still getting the error. It has now been ~19 minutes since the last error message. Will keep my on it too see if the error comes back. If the error comes back, I will try deleting the offending list and re adding it, to see if that helps.

                      Thanks for the help!

                      1 Reply Last reply Reply Quote 0
                      • marcellocM
                        marcelloc
                        last edited by

                        Check on widget if were changes on amount of cidrs applied.

                        CIDRs are get from applied file and package count from firewall tables.

                        Treinamentos de Elite: http://sys-squad.com

                        Help a community developer! ;D

                        1 Reply Last reply Reply Quote 0
                        • T
                          tommyboy180
                          last edited by

                          @marcelloc:

                          Check on widget if were changes on amount of cidrs applied.

                          CIDRs are get from applied file and package count from firewall tables.

                          IP-Blocklist injects a large number like that to /tmp/rules.debug at the top to ensure no matter how many lists a user has there won't be any errors. So with pfBlocker, even though it's a manual process, I add that large number.

                          -Tom Schaefer
                          SuperMicro 1U 2X Intel pro/1000 Dual Core Intel 2.2 Ghz - 2 Gig RAM

                          Please support pfBlocker | File Browser | Strikeback

                          1 Reply Last reply Reply Quote 0
                          • T
                            taryezveb
                            last edited by

                            The CIDRs are the same as in the screenshot I posted above:

                            pfBlockerBluetack 761470
                            pfBlockerTBG 1262743

                            It has been ~35 minutes and no new errors :) I'm crossing my fingers ;)

                            1 Reply Last reply Reply Quote 0
                            • marcellocM
                              marcelloc
                              last edited by

                              I need to improve lists size check to reduce this kind of issues or change error message suggesting tommyboy180 large configuration.

                              It's in my 'todo list when time permits'  ;)

                              Treinamentos de Elite: http://sys-squad.com

                              Help a community developer! ;D

                              1 Reply Last reply Reply Quote 0
                              • T
                                taryezveb
                                last edited by

                                Needed to restart Squid and the got an alert with the error.

                                EDIT: Every time Squid is restarted is when the error occurs. I was messing with Squid yesterday, but did not put it together until now.

                                1 Reply Last reply Reply Quote 0
                                • marcellocM
                                  marcelloc
                                  last edited by

                                  There was a update on squid package today, apply it and see what happens.

                                  Treinamentos de Elite: http://sys-squad.com

                                  Help a community developer! ;D

                                  1 Reply Last reply Reply Quote 0
                                  • T
                                    taryezveb
                                    last edited by

                                    @marcelloc:

                                    There was a update on squid package today, apply it and see what happens.

                                    Squid was reinstalled with the latest version, but still the same.

                                    1 Reply Last reply Reply Quote 0
                                    • marcellocM
                                      marcelloc
                                      last edited by

                                      I'll try to reproduce it here.

                                      You get this memory alert once or after squid restart alerts are frequent?

                                      Treinamentos de Elite: http://sys-squad.com

                                      Help a community developer! ;D

                                      1 Reply Last reply Reply Quote 0
                                      • T
                                        taryezveb
                                        last edited by

                                        @marcelloc:

                                        I'll try to reproduce it here.

                                        You get this memory alert once or after squid restart alerts are frequent?

                                        The memory alerts only shows after a Squid restart. After the initial alerts there are no more alerts. At least that is what is occurring here.

                                        Dec 30 15:11:54 php: : There were error(s) loading the rules: /tmp/rules.debug:19: cannot define table pfBlockerTBG: Cannot allocate memory pfctl: Syntax error in config file: pf rules not loaded - The line in question reads [19]: table <pfblockertbg>persist file "/var/db/aliastables/pfBlockerTBG.txt"

                                        Dec 30 15:11:54 php: : New alert found: There were error(s) loading the rules: /tmp/rules.debug:19: cannot define table pfBlockerTBG: Cannot allocate memory pfctl: Syntax error in config file: pf rules not loaded The line in question reads [19]: table <pfblockertbg>persist file "/var/db/aliastables/pfBlockerTBG.txt"

                                        Dec 30 15:11:46 php: : The command '/sbin/pfctl -o basic -f /tmp/rules.debug' returned exit code '1', the output was '/tmp/rules.debug:19: cannot define table pfBlockerTBG: Cannot allocate memory pfctl: Syntax error in config file: pf rules not loaded'

                                        Dec 30 15:11:16 php: : There were error(s) loading the rules: /tmp/rules.debug:19: cannot define table pfBlockerTBG: Cannot allocate memory pfctl: Syntax error in config file: pf rules not loaded - The line in question reads [19]: table <pfblockertbg>persist file "/var/db/aliastables/pfBlockerTBG.txt"

                                        Dec 30 15:11:16 php: : New alert found: There were error(s) loading the rules: /tmp/rules.debug:19: cannot define table pfBlockerTBG: Cannot allocate memory pfctl: Syntax error in config file: pf rules not loaded The line in question reads [19]: table <pfblockertbg>persist file "/var/db/aliastables/pfBlockerTBG.txt"

                                        Dec 30 15:11:07 php: : The command '/sbin/pfctl -o basic -f /tmp/rules.debug' returned exit code '1', the output was '/tmp/rules.debug:19: cannot define table pfBlockerTBG: Cannot allocate memory pfctl: Syntax error in config file: pf rules not loaded'
                                        Dec 30 15:10:32 php: /pkg_edit.php: Reloading Squid for configuration sync
                                        Dec 30 15:10:32 check_reload_status: Reloading filter
                                        Dec 30 15:10:32 check_reload_status: Syncing firewall
                                        Dec 30 15:10:32 check_reload_status: Reloading filter
                                        Dec 30 15:10:31 php: /pkg_edit.php: Reloading Squid for configuration sync</pfblockertbg></pfblockertbg></pfblockertbg></pfblockertbg>

                                        1 Reply Last reply Reply Quote 0
                                        • T
                                          taryezveb
                                          last edited by

                                          When that error occurs, Squid fails to work as a transparent proxy. Squid still works if you manually set the proxy settings in a browser for example. I disabled pfBlocker for now. Will try a few things.

                                          1 Reply Last reply Reply Quote 0
                                          • L
                                            LEPM
                                            last edited by

                                            @marcelloc:

                                            Increase even more Firewall Maximum Table Entries in system->advanced -> firewall/NAT

                                            not!!!!      Firewall Maximum States ;)

                                            Your new system is probably coming with some hyper trash like Windows 8

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