Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login
    Introducing Netgate Nexus: Multi-Instance Management at Your Fingertips.

    GeoIP Not Blocking Inbound

    Scheduled Pinned Locked Moved pfBlockerNG
    13 Posts 6 Posters 690 Views 8 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.
    • S Offline
      Spyderturbo007
      last edited by

      I'm seeing an issue were pfBlocker isn't bocking IP addresses that should be blocked according to the GeoIP blocking rules. I have a Synology NAS that is open, but I have the autoblock setup to block the IP address after 2 failed login attempts.

      Someone has been trying to password spray it for the last few hours, but when looking at the IP addresses, they are all out of the country.

      Here is how it's setup:

      e6debfe3-a880-4b39-8165-05984f932735-image.png

      And here are just a few of the addresses that have been able to successfully try to login to the NAS.

      118.140.120.110 (China)
      91.6.126.17 (Germany)
      175.115.153.172 (South Korea)
      121.138.203.128 (South Korea)

      The rules are at the top of the list, so I'm not sure what is wrong.

      e48e5bd8-6d1d-4a56-b57f-822e66410289-image.png

      johnpozJ SteveITSS 2 Replies Last reply Reply Quote 0
      • johnpozJ Offline
        johnpoz LAYER 8 Global Moderator @Spyderturbo007
        last edited by

        @Spyderturbo007 as you can see by the 0/0 none of those rules have ever triggered. Do you maybe have floating rule which would be evaluated before the wan rules.

        Have the tables populated, look under diagnostics, tables.

        Also its better to allow what you want vs try and deny the planet.. I use a rule to only allow US ips for example.

        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 26.07 | Lab VMs 2.9.0, 26.07

        S 1 Reply Last reply Reply Quote 0
        • S Offline
          Spyderturbo007 @johnpoz
          last edited by

          @johnpoz Thank you for your help!

          No floating rules it seems.

          No floating rules are currently defined. Click the button to add a new rule.

          The tables are populated and here is a screenshot of the list of tables.

          c3857d3a-0dfb-40a9-884e-57e9e7fb744b-image.png

          johnpozJ 1 Reply Last reply Reply Quote 0
          • tinfoilmattT Offline
            tinfoilmatt LAYER 8
            last edited by

            It's not clear what the issue could be with the information provided. It's not clear if it's a pfBlockerNG configuration issue or a general firewalling issue (or other). You'll have to reveal more about your setup.

            You might start with the interface tabs of your firewall ruleset and pfBlockerNG's relevant auto rule config.

            block out log on { ix0 } inet from any to any
            block out log on { ix0 } inet6 from any to any

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

              @Spyderturbo007 said in GeoIP Not Blocking Inbound:

              The tables are populated and here is a screenshot of the list of tables.

              and when you pick one of those tables - they have ip entries?

              example

              table.jpg

              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 26.07 | Lab VMs 2.9.0, 26.07

              1 Reply Last reply Reply Quote 0
              • SteveITSS Offline
                SteveITS Galactic Empire @Spyderturbo007
                last edited by SteveITS

                @Spyderturbo007 A common issue is, one selects the continent but on the page does not select any countries:
                1a9d79e5-3ed1-4841-ad32-3b7ecffce687-image.png

                You can also do this for certain countries on the IPv4/6 tabs:
                531afb0e-b913-4a08-8aa3-e46c84f2324f-image.png

                Also it is probably more memory/resource intensive to block the entire world, than allow your country. For instance you could set a source on the OpenVPN rule of US IPs, via an Alias Native entry created on the IPv4 tab.

                Edit:
                acf14b17-8a53-4918-9ab1-714aa643de2f-image.png

                To upgrade, select your branch in System/Update/Update Settings. When upgrading, allow 10-15 minutes to reboot, or more depending on packages, CPU, and/or disk speed.
                Only install packages for your version of pfSense.
                Upvote 👍 helpful posts!

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

                  @SteveITS said in GeoIP Not Blocking Inbound:

                  Also it is probably more memory/resource intensive to block the entire world, than allow your country.

                  Even if it wasn't - just easier.. Should I pick every single place that I don't want to allow, or just pick the place(s) I do want.. Just makes no sense to try and block the planet, when you can just allow what you want.. Firewalls are default deny for a reason, not default allow.

                  Isn't this easier? One simple port forward and only what I want is allowed.

                  allow.jpg

                  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 26.07 | Lab VMs 2.9.0, 26.07

                  S 1 Reply Last reply Reply Quote 0
                  • S Offline
                    Spyderturbo007 @johnpoz
                    last edited by

                    @johnpoz said in GeoIP Not Blocking Inbound:

                    @SteveITS said in GeoIP Not Blocking Inbound:

                    Also it is probably more memory/resource intensive to block the entire world, than allow your country.

                    Even if it wasn't - just easier.. Should I pick every single place that I don't want to allow, or just pick the place(s) I do want.. Just makes no sense to try and block the planet, when you can just allow what you want.. Firewalls are default deny for a reason, not default allow.

                    Isn't this easier? One simple port forward and only what I want is allowed.

                    allow.jpg

                    I appreciate your response, but that's where I get confused. I have a few ports open, but I guess I don't understand on how to only allow them from US IP addresses. It looks like you created a custom list of addresses named pfB_AllowPfb_v4 addresses and then just changed the source from * to that custom list?

                    If that's the case, I would need to do some reading on how to create that list.

                    I guess I should only allow inbound VPN traffic and force the users to connect to the VPN before accessing the internal resources.

                    SteveITSS johnpozJ GertjanG 3 Replies Last reply Reply Quote 0
                    • SteveITSS Offline
                      SteveITS Galactic Empire @Spyderturbo007
                      last edited by

                      @Spyderturbo007 See my post above. In the IPv4 section, create a list, set format=GeoIP, and type a country code/name for it to autocomplete for you. You can name the list "US" or "allowed_countries" or whatever you like.

                      (pfB adds the "pfB_" prefix and "_v4" suffix)

                      To upgrade, select your branch in System/Update/Update Settings. When upgrading, allow 10-15 minutes to reboot, or more depending on packages, CPU, and/or disk speed.
                      Only install packages for your version of pfSense.
                      Upvote 👍 helpful posts!

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

                        @Spyderturbo007 said in GeoIP Not Blocking Inbound:

                        If that's the case, I would need to do some reading on how to create that list.

                        SteveITS has it pretty much - for example here is my list.

                        pfb.jpg

                        I use to have Belgium in there as well - since family was living there so they could watch my plex server, but just removed it since they are now in China, and using a vpn into the states anyway.

                        The other ones there are monitoring services - so they can warn me when my home connection is down, or plex goes down. They are not always from US ips. And then there is one that is how plex knows if your service is available remotely so users can direct connect. Again not always us based IPs, and those lists can change now and then so why they are pulled from sources they provide.

                        There is also custom area if you scroll down so you can add any specific IPs or network that might not be in the US, etc.

                        Once you create the alias - just use it in your port forward or rules.. You mention vpn, yes I use it in my vpn rules - I update it if going to travel out of the US, recent trip to Ireland, trip next year to Italy, etc.. I just update the alias to allow for where I will be traveling.

                        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 26.07 | Lab VMs 2.9.0, 26.07

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

                          @Spyderturbo007 said in GeoIP Not Blocking Inbound:

                          I guess I don't understand on how to only allow them from US IP addresses

                          You will understand as soon as IPv6 comes into play 😊 Your wallet will explain it.
                          You can't create a list or table with all existing IPv6 networks used on the world, as the RAM needed to load these would cost you a fortune.
                          Instead of filtering at the gate for those who are not allowed to get in, filter for those who are allowed, and refuse the rest. Where 'refuse' is pf's default behavior so nothing to.

                          My own WAN rule collection :

                          ac64672b-41f9-45e0-aa51-08748b6385af-image.png

                          The first rule allows incoming traffic with the classic port 1194 IPv4 UDP filter. The incoming IPv4 must belong to the "pfB_Europe_v4" list which I narrowed down to 'France' only.
                          Lines 2,3,4 are coming from my dedicated data center based server for NAS syncing. and munin traffic.
                          5 and 6 are basic ICMP rules.
                          7 and 8 are my own "shut the door" rules. The hidden rule "9" will do the same thing.

                          No "help me" PM's please. Use the forum, the community will thank you.

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

                            @SteveITS said in GeoIP Not Blocking Inbound:

                            @Spyderturbo007 See my post above. In the IPv4 section, create a list, set format=GeoIP, and type a country code/name for it to autocomplete for you. You can name the list "US" or "allowed_countries" or whatever you like.

                            (pfB adds the "pfB_" prefix and "_v4" suffix)

                            Thanks @SteveITS does this mehtod of defining a geo ip list still requires us to confiure the maxmind key ?
                            earlier i was doing it using geo ip > Continetn > select appropriate coutry for creating alias native.

                            Best Regards.

                            SteveITSS 1 Reply Last reply Reply Quote 0
                            • SteveITSS Offline
                              SteveITS Galactic Empire @Snailkhan
                              last edited by

                              @Snailkhan Yes, the free Maxmind account+key is required to be able to download the geographical IP lists/data.

                              To upgrade, select your branch in System/Update/Update Settings. When upgrading, allow 10-15 minutes to reboot, or more depending on packages, CPU, and/or disk speed.
                              Only install packages for your version of pfSense.
                              Upvote 👍 helpful posts!

                              1 Reply Last reply Reply Quote 0
                              • First post
                                Last post
                              Copyright 2026 Rubicon Communications LLC (Netgate). All rights reserved.
                              Privacy Policy · Cookie Policy