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

    Country Block

    pfSense Packages
    79
    691
    663.0k
    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.
    • S
      Supermule Banned
      last edited by

      I have never seen updates come this fast…....;)

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

        @robfantini:

        thank you for the update. we are lucky to have you working on this package.

        0.1.6 would not stay running.

        0.1.7 has been up approx an hour without a  problem…

        one question - i enabled logging.   do I need to setup log rotation ?

        Thank you. I hope it keeps running.
        As far as log rotation goes: unless you are blocking a huge amount of networks and need to keep track of a couple days worth then no. Blocking a couple countries may increase your log size significantly depending on your networks, however. It's really Dependant on how many entries are being produced and how much you need to keep track of.

        Thank you Supermule :)  I got off work early today and I wanted to fix this problem that some people were having with the last update.

        -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
        • K
          kilthro
          last edited by

          I dont have traffic shaping running

          Packages are
          Country Block
          Cron
          DarkStat
          nmap
          snort

          I will give the updated version a try and see if that resolves it.

          Thanks so much for your support and quick updates on this package. :-)

          1 Reply Last reply Reply Quote 0
          • R
            robfantini
            last edited by

            After a few hours CB is still running.

            Here is one thing to check:

            when I  click 'Country Block' under 'Firewall' section in Pfsense the 'Enable Country Block' is 'on'

            when I add countries, the 'Enable Country Block' is unchecked or 'off' at the top of the screen.
            so for now if you add/change countries , reclick the 'Enable Country Block'

            CB for us is working a lot better.

            1 Reply Last reply Reply Quote 0
            • M
              mgc6288
              last edited by

              @tommyboy180:

              Version 1.7 is available.

              Changes:

              • Complete UI overhaul

              • Changed execution process

              Hopefully these changes will help those people that are having trouble keeping the package running.

              To upgrade Uninstall Countryblock, reboot, and then install the newest version.

              Outstanding.  Like the new UI and cron is still tickin'.  Thanks!

              1 Reply Last reply Reply Quote 0
              • K
                kilthro
                last edited by

                Well so far so good. It has been running for 3 hours now and its still up and not stopped. :-) So your changes seem to have corrected the issue. Thanks!

                The only thing that doesnt seem to be automatic is if I change the firewall states with another package or clear it ect in settings which resets the current table which kills country block (as its mentioned in the package that it will), it doesn't seem like country block will start on its own with the cron job entry.  When I make the changes mentioned, I will let it sit there for 10 minutes and it will not start back up. Once I start it manually it seems to stay running.  So I am unclear why it will not start back up. I guess as long as I know I make changes and check to start it back up it should stay up and running without issue i suppose.

                I do have this cron entry
                minute: 0
                hour: *
                mday: *
                month: *
                wday: *
                who: root
                command: /usr/local/etc/rc.d/countryblock.sh

                1 Reply Last reply Reply Quote 0
                • R
                  robfantini
                  last edited by

                  @kilthro:

                  Well so far so good. It has been running for 3 hours now and its still up and not stopped. :-) So your changes seem to have corrected the issue. Thanks!

                  The only thing that doesnt seem to be automatic is if I change the firewall states with another package or clear it ect in settings which resets the current table which kills country block (as its mentioned in the package that it will), it doesn't seem like country block will start on its own with the cron job entry.  When I make the changes mentioned, I will let it sit there for 10 minutes and it will not start back up. Once I start it manually it seems to stay running.  So I am unclear why it will not start back up. I guess as long as I know I make changes and check to start it back up it should stay up and running without issue i suppose.

                  I do have this cron entry
                  minute: 0
                  hour: *
                  mday: *
                  month: *
                  wday: *
                  who: root
                  command: /usr/local/etc/rc.d/countryblock.sh

                  for every 5 min use
                  Minute: */5

                  */2  # every 2 min etc.

                  1 Reply Last reply Reply Quote 0
                  • K
                    kilthro
                    last edited by

                    @robfantini:

                    @kilthro:

                    Well so far so good. It has been running for 3 hours now and its still up and not stopped. :-) So your changes seem to have corrected the issue. Thanks!

                    The only thing that doesnt seem to be automatic is if I change the firewall states with another package or clear it ect in settings which resets the current table which kills country block (as its mentioned in the package that it will), it doesn't seem like country block will start on its own with the cron job entry.  When I make the changes mentioned, I will let it sit there for 10 minutes and it will not start back up. Once I start it manually it seems to stay running.  So I am unclear why it will not start back up. I guess as long as I know I make changes and check to start it back up it should stay up and running without issue i suppose.

                    I do have this cron entry
                    minute: 0
                    hour: *
                    mday: *
                    month: *
                    wday: *
                    who: root
                    command: /usr/local/etc/rc.d/countryblock.sh

                    for every 5 min use
                    Minute: */5

                    */2  # every 2 min etc.

                    I changed the 0 to */1 and then reset the states and it killed country block and waited a minute and it started back up. That seemed to do the trick. Thanks alot.
                    I

                    1 Reply Last reply Reply Quote 0
                    • D
                      darklogic
                      last edited by

                      Glad to know I was not crazy, well to some degree. Tommy, thanks for looking into this. I love this package, I really feel you have developed something that should be a standard option in most firewalls but is not.

                      Thanks for the quick replies and fast updates. Hands down to you…

                      Thanks again,

                      Matt

                      1 Reply Last reply Reply Quote 0
                      • X
                        XIII
                        last edited by

                        Nice new interface tommy appreciate it.

                        Gotta question for you though, i see that there are a few packages related to dns (country block,dns blacklist), is it possible to get something like OpenDNS but locally? mostly the custom shortcuts andstats (top domains etc)? if so how hard would it be?

                        -Chris Stutzman
                        Sys0:2.0.1: AMD Sempron 140 @2.7 1024M RAM 100GHD
                        Sys1:2.0.1: Intel P4 @2.66 1024M RAM 40GHD
                        freedns.afraid.org - Free DNS dynamic DNS subdomain and domain hosting.
                        Check out the pfSense Wiki

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

                          @XIII:

                          Nice new interface tommy appreciate it.

                          Gotta question for you though, i see that there are a few packages related to dns (country block,dns blacklist), is it possible to get something like OpenDNS but locally? mostly the custom shortcuts andstats (top domains etc)? if so how hard would it be?

                          I'm really not sure. Countryblock uses CIDR ranges which works nicely with the firewall and is really easy to script. As far as DNS stuff goes, I have no idea. I bet you could modify the DNS blacklist package to support what you are looking for.

                          I'm glad to see that people are getting better results with the latest version. Thank you all for your support.

                          -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
                          • X
                            XIII
                            last edited by

                            The DNS Blacklist doesnt have anything at the GUI end for doing what I want, it would have to be done under the hood and I was thinking of something that would be easy for all, even those with out programming skills, though I am willing to learn.

                            I was thinking the tinyDNS package could do this but I gave up on it when I messed up DNS on my network (didnt get very far before doing this >:(), waiting until I can get a test system ready before trying it again, if I do get it working I plan on doing an FAQ/Tutorial on it as no one has made one publicly available that I could find.

                            -Chris Stutzman
                            Sys0:2.0.1: AMD Sempron 140 @2.7 1024M RAM 100GHD
                            Sys1:2.0.1: Intel P4 @2.66 1024M RAM 40GHD
                            freedns.afraid.org - Free DNS dynamic DNS subdomain and domain hosting.
                            Check out the pfSense Wiki

                            1 Reply Last reply Reply Quote 0
                            • R
                              robfantini
                              last edited by

                              regarding cron  .

                              with CB getting closer to real stable, it is probably a bad thing to run the cron start job very often.

                              I may be wrong, as happens not infrequently , but  the 1-st part of the script /usr/local/www/packages/countryblock/execute.sh
                              {{{
                              pfctl -t countryblock -T kill
                              }}}
                              seems to disable the  countryblock rules .

                              shortly after the rules are enabled.

                              so the more stable this great package gets, the less frequent the cronjob should be run.

                              Also
                              /usr/local/www/packages/countryblock/execute.sh should be improved  if possible to check if the countryblock rules are active.  then restart only if needed.

                              Maybe someone who knows about pfctl could help with the script?

                              thanks again to the author for this package.  I owe you some beer.

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

                                @robfantini:

                                regarding cron  .

                                with CB getting closer to real stable, it is probably a bad thing to run the cron start job very often.

                                I may be wrong, as happens not infrequently , but  the 1-st part of the script /usr/local/www/packages/countryblock/execute.sh
                                {{{
                                pfctl -t countryblock -T kill
                                }}}
                                seems to disable the  countryblock rules .

                                shortly after the rules are enabled.

                                so the more stable this great package gets, the less frequent the cronjob should be run.

                                Also
                                /usr/local/www/packages/countryblock/execute.sh should be improved  if possible to check if the countryblock rules are active.  then restart only if needed.

                                Maybe someone who knows about pfctl could help with the script?

                                thanks again to the author for this package.  I owe you some beer.

                                Great suggestion! Checking to see if it's running before processing is easy but if changes are made while it's running then the firewall entries for countryblock need to be deleted and re-added. If this isn't done then duplicate data will be written to the firewall config resulting is lower performance and very possibly syntax errors in the config.
                                Since all updates to the config are done via the GUI I can move this code to the php page and leave it out of the script. I will change the script to see if it's running before processing.

                                Give me some time to make the changes and test since today is my birthday! Thanks again for the helpful suggestion.

                                Edit: I will also add a log system log entry every time the script is run and whether the processes are already running of if countryblock had to be started back up.

                                -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
                                • S
                                  Supermule Banned
                                  last edited by

                                  Congrats Tom!! ;) Rest and enjoy your day!

                                  1 Reply Last reply Reply Quote 0
                                  • K
                                    kilthro
                                    last edited by

                                    well happy bday!!!!!!

                                    Again thanks for the continued updates

                                    1 Reply Last reply Reply Quote 0
                                    • M
                                      mgc6288
                                      last edited by

                                      I have a question on the selectable interfaces.  I will be installing some additional NICs in the box so that my personal PC is separate from the server.  Currently I don't select outbound because it blocks some pages I try to view and I'd really like to have this feature for my server.  Thus, I assume I would want to uncheck the WAN and my personal interface and just have my server interface checked, correct?  Just curious.

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

                                        @mgc6288:

                                        I have a question on the selectable interfaces.  I will be installing some additional NICs in the box so that my personal PC is separate from the server.  Currently I don't select outbound because it blocks some pages I try to view and I'd really like to have this feature for my server.  Thus, I assume I would want to uncheck the WAN and my personal interface and just have my server interface checked, correct?  Just curious.

                                        Not checking your WAN interface will leave you vulnerable to attack from your blocked counties. However, yes. If you do not select your WAN and your LAN, then you will be able to enforce outbound access, on the DMZ, to the countries while still being able to access them on your LAN.
                                        For a customized configuration you can always edit /usr/local/www/packages/countryblock/execute.sh to give you more control over how you want to block access to the countries.

                                        -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
                                        • B
                                          Bai Shen
                                          last edited by

                                          Is there a way to get notified when Country Block stops?  I keeps not running for me, and I can't tell if it's because of something I did or not.

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

                                            @Bai:

                                            Is there a way to get notified when Country Block stops?  I keeps not running for me, and I can't tell if it's because of something I did or not.

                                            I am working on email notifications for the next version. Right now I'm looking at gmail support only.

                                            -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
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.