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

    GeoIP Blocking with pfBlockerNG

    Scheduled Pinned Locked Moved Firewalling
    11 Posts 5 Posters 1.4k 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.
    • N Offline
      netblues @theodric
      last edited by

      @theodric Everything is fine with your rules.
      I suspect there isn't much traffic matcing.
      If yoou are interested in just two or three countires maybe its better to allow just those
      But also do take care other needed traffic too.

      Denying access to the world isn't a good idea in practice, however if you know what you are doing its an option.

      T 1 Reply Last reply Reply Quote 0
      • T Offline
        theodric @netblues
        last edited by

        @netblues Hi, thanks for your reply. Actually there is a huge amount of traffic that is getting through that matches the IP networks in the other lists (Africa, Asia, SAmerica, etc.). I can see traffic from those IP networks in the web server logs.

        Thanks again for your comment.

        Theodric

        keyserK 1 Reply Last reply Reply Quote 0
        • keyserK Offline
          keyser Rebel Alliance @theodric
          last edited by

          @theodric Hmm, the rules look correct. Are you saying you can identify IP adresses in your webserver logs that you can also find within the ranges in the source blocklists (verified - not guessing)?

          I’d say you are just not seeing traffic that matches or there is something in the pfBlocker IP lists you are fetching that causes them to be defective.

          Love the no fuss of using the official appliances :-)

          johnpozJ 1 Reply Last reply Reply Quote 0
          • johnpozJ Offline
            johnpoz LAYER 8 Global Moderator @keyser
            last edited by

            those other rules are not triggering - the 0/0 shows nothing matched on those rules.

            Did your ruleset fully load? You start creating lots of lists, you could be run into tables memory issue, and some off the rules might not even load.

            Do you have anything in floating that could be allowing it?

            I am with @netblues trying to block the world is normally a bad idea - vs trying to block all the bad guys its easier to just allow the guys you want.

            I have rule that allows only US based IPs, and belgium - because users of my services I have opened would all be in the US, and some family members currently in belgium.. There is little point to creating block lists for all the other continents. Since if they are not listed in my allow then they wouldn't get in.

            An intelligent man is sometimes forced to be drunk to spend time with his fools
            If you get confused: Listen to the Music Play
            Please don't Chat/PM me for help, unless mod related
            SG-4860 25.07.1 | Lab VMs 2.8.1, 25.07.1

            1 Reply Last reply Reply Quote 0
            • S Offline
              SteveITS Rebel Alliance @theodric
              last edited by

              @theodric agree just allow your country.

              One pitfall for the continent blocks is you still need to select the countries on the page, otherwise the generated aliases are empty.

              Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
              When upgrading, allow 10-15 minutes to reboot, or more depending on packages, and device or disk speed.
              Upvote 👍 helpful posts!

              S 1 Reply Last reply Reply Quote 0
              • S Offline
                SteveITS Rebel Alliance @SteveITS
                last edited by

                said in GeoIP Blocking with pfBlockerNG:

                select the countries

                Since I can log in now, this part:
                6de4d5f1-3df2-4fb2-b560-f1d4d54bef90-image.png

                Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
                When upgrading, allow 10-15 minutes to reboot, or more depending on packages, and device or disk speed.
                Upvote 👍 helpful posts!

                johnpozJ 1 Reply Last reply Reply Quote 1
                • johnpozJ Offline
                  johnpoz LAYER 8 Global Moderator @SteveITS
                  last edited by

                  @SteveITS that is a great point - yeah I think those lists are empty until you pick what you want in them..

                  list.jpg

                  I just took a look at them and nothing is selected in any of them.

                  An intelligent man is sometimes forced to be drunk to spend time with his fools
                  If you get confused: Listen to the Music Play
                  Please don't Chat/PM me for help, unless mod related
                  SG-4860 25.07.1 | Lab VMs 2.8.1, 25.07.1

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

                    @theodric said in GeoIP Blocking with pfBlockerNG:

                    Theodric Young
                    System: Netgate SG-4860
                    Version: 2.4.5-RELEASE-p1 (amd64)

                    And while we are at it, how about upgrading to a recent version?
                    Teaching an old dog new (pfblockerng) trcks won't cut it.

                    I'm not saying this is the issue though too.

                    With the seer amount of "generated" traffic perhaps opting for a two server setup is the option.
                    Fairs better than a server farm with a load balancer and lots of instances. (unless of course money is not an issue and you are facebook, or maybe tesla)

                    Setup a web front for the country traffic that interests you, and send all other traffic to another instance
                    If you are using haproxy, you will need to handle this there, with the additional benefit of rate limiting bulk traffic.
                    If you are doing nat, then this can be done at the nat port forward level, where you can specify pfblocker generated source ip lists. Send a few countries to the premium web server and the rest to another instance, and let it "burn".
                    Augment list with a block list at the wan level for the known "abuse" countries (like china , pakistan, brazil and india) and you will be good to go.

                    johnpozJ 1 Reply Last reply Reply Quote 1
                    • johnpozJ Offline
                      johnpoz LAYER 8 Global Moderator @netblues
                      last edited by johnpoz

                      @netblues good catch - I didn't even notice that... Yeah that is quite an old version.. 2020..

                      Looks like 6 major versions behind.. That is crazy..

                      An intelligent man is sometimes forced to be drunk to spend time with his fools
                      If you get confused: Listen to the Music Play
                      Please don't Chat/PM me for help, unless mod related
                      SG-4860 25.07.1 | Lab VMs 2.8.1, 25.07.1

                      S 1 Reply Last reply Reply Quote 0
                      • S Offline
                        SteveITS Rebel Alliance @johnpoz
                        last edited by

                        …and for a couple years, give or take, MaxMind has required the additional field/info to update so the geoIP data probably isn’t updating.

                        Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
                        When upgrading, allow 10-15 minutes to reboot, or more depending on packages, and device or disk speed.
                        Upvote 👍 helpful posts!

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