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

Country Block

Scheduled Pinned Locked Moved pfSense Packages
691 Posts 79 Posters 691.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.
  • C
    Cino
    last edited by Oct 28, 2011, 3:32 PM

    I did another re-install. Same results.. Let me know how your test turns out… Wondering if its because i'm running 2.1

    1 Reply Last reply Reply Quote 0
    • M
      marcelloc
      last edited by Oct 28, 2011, 3:43 PM

      @Cino:

      I did another re-install. Same results.. Let me know how your test turns out… Wondering if its because i'm running 2.1

      Does 2.1 uses same pkg repo as 2.0?

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

      Help a community developer! ;D

      1 Reply Last reply Reply Quote 0
      • C
        Cino
        last edited by Oct 28, 2011, 3:46 PM

        @marcelloc:

        @Cino:

        I did another re-install. Same results.. Let me know how your test turns out… Wondering if its because i'm running 2.1

        Does 2.1 uses same pkg repo as 2.0?

        as far as i know, yes

        1 Reply Last reply Reply Quote 0
        • M
          marcelloc
          last edited by Oct 28, 2011, 3:47 PM

          I found the error.

          I'm fixing it right now.

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

          Help a community developer! ;D

          1 Reply Last reply Reply Quote 0
          • C
            Cino
            last edited by Oct 28, 2011, 4:51 PM

            @marcelloc:

            I found the error.

            I'm fixing it right now.

            that did it.. Thank you!!! Only using the country blocking right now, over the weekend, i'll give the ip-list side a tried

            1 Reply Last reply Reply Quote 0
            • M
              marcelloc
              last edited by Oct 28, 2011, 7:26 PM

              pfBlocker 0.1.2 is out.

              Now with widget.

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

              Help a community developer! ;D

              1 Reply Last reply Reply Quote 0
              • T
                tommyboy180
                last edited by Oct 28, 2011, 7:44 PM

                I we can't figure out how to increase the table size limits for large lists like level1 then perhaps we can break the lists into multiple tables.

                Example:
                table limit will be 10,000 entries. More entries will go into another table. So if Level1 has 35,000 lines the we will have 3 tables

                • pfblocker - 10000 lines

                • pfblocker1 - 10000 lines

                • pfblocker2 - 10000 lines

                • pfblocker3 - 5000 lines

                What do you think? I hope we can find a way to increase the memory limit.

                -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
                • M
                  marcelloc
                  last edited by Oct 28, 2011, 7:55 PM

                  Could be a solution for this problem.

                  I'm still looking for a way to do it without multiple tables or file hacks.

                  Does it happens on x64 versions with for example 4g ram?

                  And thanks for widget clue.  :)

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

                  Help a community developer! ;D

                  1 Reply Last reply Reply Quote 0
                  • M
                    marcelloc
                    last edited by Oct 28, 2011, 8:16 PM

                    I've included all countries and levels 1,2,3 plus some ads, virus, etc

                    total:449418 Networks

                    no erros.

                    my system is x64 with more then 4g ram.

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

                    Help a community developer! ;D

                    1 Reply Last reply Reply Quote 0
                    • T
                      tommyboy180
                      last edited by Oct 28, 2011, 8:18 PM

                      The problem is it isn't a RAM limitation. It's a memory max allocation variable that is small to begin with. So no matter how much RAM you have on x86 or x64 you will get that error once that limitation is hit.

                      This is why it is a problem. We need to be able to raise that limit other wise the functionality will be greatly limited, leaving users to fall back on IP-Blocklist.

                      -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
                        tommyboy180
                        last edited by Oct 28, 2011, 8:19 PM

                        449418 Networks seems very small for level1, 2, and 3 with others. Are you sure those lists were all successful?

                        -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
                        • M
                          marcelloc
                          last edited by Oct 28, 2011, 8:29 PM Oct 28, 2011, 8:22 PM

                          Could we include in GUI an option to increase this value and advise users that its unsupported?

                          EDIT:

                          wc -l in level files downloaded in cidr from fetch:

                          245749 level1
                            85703 level2
                            18753 level3
                            350205 total

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

                          Help a community developer! ;D

                          1 Reply Last reply Reply Quote 0
                          • T
                            tommyboy180
                            last edited by Oct 28, 2011, 9:29 PM

                            kk. We could give the users the option. It would just be inserting that text every time that file gets recreated. I've already done most of the work in IP-Blocklist and Countryblock.

                            /usr/local/pkg/pf/pf-blocker.sh

                            
                            #!/bin/sh
                            export t=`grep -n 'User Aliases' /tmp/rules.debug |grep -o '[0-9]\{1,2\}'`
                            t=$(($t+'1'))
                            #Insert table-entry limit 
                            /usr/bin/sed -i -e '/900000/d' /tmp/rules.debug
                            
                            while read line
                            	do a=$(($a+1)); 
                            	#echo $a;
                            	if [ "$a" = "$t" ]; then
                            		echo "" >> /tmp/rules.debug.tmp
                            		echo "set limit table-entries 900000" >> /tmp/rules.debug
                            	fi
                            	echo $line >> /tmp/rules.debug
                            done < "/tmp/rules.debug"
                            
                            

                            This code isn't tested but it's on the right track. We will have to have it check if the user has enabled this feature. I do this is IP-Blocklist and countryblock. Basically if the user enables it the package will create a file. If it's disabled the the file will be deleted. The script above will check if the file exists```
                            if [ -e FILE ] ....code here

                            -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
                            • M
                              marcelloc
                              last edited by Oct 28, 2011, 9:37 PM

                              ok, I think its good enough to prevent errors until some 'core developer' could help us.

                              I'll try to put it in php way for most code compatibility.

                              The last thing to finish pfBlocker is cron package integration.

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

                              Help a community developer! ;D

                              1 Reply Last reply Reply Quote 0
                              • T
                                tommyboy180
                                last edited by Oct 28, 2011, 9:44 PM Oct 28, 2011, 9:42 PM

                                Cron for the updates?

                                -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
                                • M
                                  marcelloc
                                  last edited by Oct 28, 2011, 9:56 PM

                                  use cron package instead of editing /etc/cront for lists updates…

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

                                  Help a community developer! ;D

                                  1 Reply Last reply Reply Quote 0
                                  • S
                                    sekular
                                    last edited by Oct 29, 2011, 12:40 AM

                                    Great work so far on the pfblocker package. I currently have a problem with it. I had countryblock installed and working previously. I removed that package and then installed the pfblocker package. The widget says that it is blocking networks but it comes up with a fail to load list message in the syslog.

                                    Oct 29 01:38:43 php: : The command '/sbin/pfctl -o basic -f /tmp/rules.debug' returned exit code '1', the output was 'no IP address found for 1139.82.0.0/16 /tmp/rules.debug:16: file "/var/db/aliastables/pfBlockerInbound.txt" contains bad data no IP address found for 1139.82.0.0/16 /tmp/rules.debug:18: file "/var/db/aliastables/pfBlockerOutbound.txt" contains bad data pfctl: Syntax error in config file: pf rules not loaded'
                                    Oct 29 01:38:43 php: : New alert found: There were error(s) loading the rules: no IP address found for 1139.82.0.0/16 /tmp/rules.debug:16: file "/var/db/aliastables/pfBlockerInbound.txt" contains bad data no IP address found for 1139.82.0.0/16 /tmp/rules.debug:18: file "/var/db/aliastables/pfBlockerOutbound.txt" contains bad data pfctl: Syntax error in config file: pf rules not loaded The line in question reads [16]: table <pfblockerinbound>persist file "/var/db/aliastables/pfBlockerInbound.txt"
                                    Oct 29 01:38:43 php: : There were error(s) loading the rules: no IP address found for 1139.82.0.0/16 /tmp/rules.debug:16: file "/var/db/aliastables/pfBlockerInbound.txt" contains bad data no IP address found for 1139.82.0.0/16 /tmp/rules.debug:18: file "/var/db/aliastables/pfBlockerOutbound.txt" contains bad data pfctl: Syntax error in config file: pf rules not loaded - The line in question reads [16]: table <pfblockerinbound>persist file "/var/db/aliastables/pfBlockerInbound.txt"

                                    This is what happens when i only try to block countries and set none on the list block. I can try inbound or outbound and still get same error. I have tried reinstalling it. Do you know what it might be?</pfblockerinbound></pfblockerinbound>

                                    1 Reply Last reply Reply Quote 0
                                    • M
                                      marcelloc
                                      last edited by Oct 29, 2011, 12:46 AM

                                      Post here the countries you selected.

                                      I will check the script.

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

                                      Help a community developer! ;D

                                      1 Reply Last reply Reply Quote 0
                                      • S
                                        sekular
                                        last edited by Oct 29, 2011, 1:11 AM

                                        I tired various countries, I get the same result when I select whitelist. I get the same result with all the countries. I have selected one from top spammers and one from south america. I also noticed that when i select one country from a tab then i can not unselect it. I can only select other ones. Using Chrome.

                                        Oct 29 02:07:23 php: : The command '/sbin/pfctl -o basic -f /tmp/rules.debug' returned exit code '1', the output was 'no IP address found for 192.168.81.0/2411.0.1.0/24 /tmp/rules.debug:16: file "/var/db/aliastables/pfBlockerWL.txt" contains bad data pfctl: Syntax error in config file: pf rules not loaded'
                                        Oct 29 02:07:23 php: : New alert found: There were error(s) loading the rules: no IP address found for 192.168.81.0/2411.0.1.0/24 /tmp/rules.debug:16: file "/var/db/aliastables/pfBlockerWL.txt" contains bad data pfctl: Syntax error in config file: pf rules not loaded The line in question reads [16]: table <pfblockerwl>persist file "/var/db/aliastables/pfBlockerWL.txt"
                                        Oct 29 02:07:23 php: : There were error(s) loading the rules: no IP address found for 192.168.81.0/2411.0.1.0/24 /tmp/rules.debug:16: file "/var/db/aliastables/pfBlockerWL.txt" contains bad data pfctl: Syntax error in config file: pf rules not loaded - The line in question reads [16]: table <pfblockerwl>persist file "/var/db/aliastables/pfBlockerWL.txt"

                                        The rules and alias appear to be created ok.</pfblockerwl></pfblockerwl>

                                        1 Reply Last reply Reply Quote 0
                                        • M
                                          marcelloc
                                          last edited by Oct 29, 2011, 1:54 AM Oct 29, 2011, 1:31 AM

                                          I found the error.

                                          It's fixed now.

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

                                          Help a community developer! ;D

                                          1 Reply Last reply Reply Quote 0
                                          665 out of 691
                                          • First post
                                            665/691
                                            Last post
                                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                                            This community forum collects and processes your personal information.
                                            consent.not_received