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

    All alerts showing as unk country code.. help

    Scheduled Pinned Locked Moved pfBlockerNG
    26 Posts 6 Posters 3.3k 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.
    • S
      sesipod
      last edited by

      .... I just realized my issue I think

      NogBadTheBadN 1 Reply Last reply Reply Quote 0
      • NogBadTheBadN
        NogBadTheBad @sesipod
        last edited by

        @sesipod said in All alerts showing as unk country code.. help:

        .... I just realized my issue I think

        Thats what I see in the alerts:-

        Screenshot 2020-02-02 at 10.45.37.png

        Andy

        1 x Netgate SG-4860 - 3 x Linksys LGS308P - 1 x Aruba InstantOn AP22

        S 1 Reply Last reply Reply Quote 0
        • S
          sesipod
          last edited by

          So I actually was not running dev version .. so I updated to that now and yet still the same issue. Also made a new key just to be sure.

          alt text

          1 Reply Last reply Reply Quote 0
          • NogBadTheBadN
            NogBadTheBad
            last edited by

            Space at the start or end of your MaxMind License Key?

            Andy

            1 x Netgate SG-4860 - 3 x Linksys LGS308P - 1 x Aruba InstantOn AP22

            1 Reply Last reply Reply Quote 0
            • S
              sesipod
              last edited by

              Nope no space :'/

              1 Reply Last reply Reply Quote 0
              • S
                sesipod
                last edited by

                So it's all fixed after a reboot of pfsense. Guess something was clogged up ¯_( ͠° ͟ʖ °͠ )_/¯

                1 Reply Last reply Reply Quote 1
                • S
                  sesipod @NogBadTheBad
                  last edited by

                  @NogBadTheBad how did you get the asn ?

                  Mine only shows CC
                  alt text

                  1 Reply Last reply Reply Quote 0
                  • NogBadTheBadN
                    NogBadTheBad
                    last edited by NogBadTheBad

                    Not a clue sorry, it maybe that I have a few rules set to block by ASN.

                    AFAIK its been there all the time.

                    Screenshot 2020-02-02 at 11.16.51.png

                    Andy

                    1 x Netgate SG-4860 - 3 x Linksys LGS308P - 1 x Aruba InstantOn AP22

                    1 Reply Last reply Reply Quote 0
                    • S
                      sesipod
                      last edited by

                      Iptab

                      ASN Reporting

                      1 Reply Last reply Reply Quote 1
                      • S
                        sesipod
                        last edited by

                        A reboot seems to force geoip cc updates and asn updates 🍕

                        BBcan177B 1 Reply Last reply Reply Quote 0
                        • BBcan177B
                          BBcan177 Moderator @sesipod
                          last edited by

                          @sesipod
                          This is fixed in the next version. The pfb_filer service needs to be restarted on first download of MaxMind.

                          https://github.com/pfsense/FreeBSD-ports/pull/762/files

                          "Experience is something you don't get until just after you need it."

                          Website: http://pfBlockerNG.com
                          Twitter: @BBcan177  #pfBlockerNG
                          Reddit: https://www.reddit.com/r/pfBlockerNG/new/

                          1 Reply Last reply Reply Quote 0
                          • S
                            serbus
                            last edited by serbus

                            Hello!

                            sg-3100 running 2.4.5.r.20200305.1800
                            pfblockerng-devel 2.2.5_29

                            I have been having this problem and just found this thread.
                            Maxmind key is good.
                            Manually ran the pfblockerng.php dc command with success.
                            extras.log shows successful download and parsing.
                            Restarted the router.
                            Tried clearing all downloaded lists (disable/enable pfBlockerNG & Keep Settings check boxes).
                            pfBlockerNG Reports -> Alerts and IP Stats still show "Unk" for GeoIP in all reports.

                            Is there anything else I can check or try?

                            Thanks!

                            John

                            Lex parsimoniae

                            BBcan177B 1 Reply Last reply Reply Quote 0
                            • BBcan177B
                              BBcan177 Moderator @serbus
                              last edited by

                              @serbus

                              Restart the "pfb_filter" service and it should start reporting on new events as long as Maxmind DB was previously downloaded successfully.

                              "Experience is something you don't get until just after you need it."

                              Website: http://pfBlockerNG.com
                              Twitter: @BBcan177  #pfBlockerNG
                              Reddit: https://www.reddit.com/r/pfBlockerNG/new/

                              1 Reply Last reply Reply Quote 0
                              • S
                                serbus
                                last edited by

                                Hello!

                                How do I restart the service?

                                Not sure if this test is valid, but I ran this:

                                /usr/local/bin/mmdblookup -v -f /usr/local/share/GeoIP/GeoLite2-Country.mmdb -i 1.1.1.1 country iso_code

                                and got this:

                                Can't open /usr/local/share/GeoIP/GeoLite2-Country.mmdb - The MaxMind DB file contains invalid metadata

                                John

                                Lex parsimoniae

                                1 Reply Last reply Reply Quote 0
                                • S
                                  serbus
                                  last edited by serbus

                                  Hello!

                                  I tried deleting the GeoLite2-Country.mmdb file and then recreating it by running :

                                  php /usr/local/www/pfblockerng/pfblockerng.php dc

                                  It was recreated, but still gives the same error when running mmdblookup.

                                  The size of the mmdb file in pfb is :

                                  -rw-r--r-- 1 root wheel 2048734 Mar 7 22:24 GeoLite2-Country.mmdb

                                  When I download the GeoLite2-Country.mmdb file directly from maxmind, the file looks like this :

                                  GeoLite2-Country.png

                                  John

                                  Lex parsimoniae

                                  1 Reply Last reply Reply Quote 0
                                  • S
                                    serbus
                                    last edited by serbus

                                    Hello!

                                    Sorry to keep bugging you...

                                    It looks like pfb is just renaming the download from maxmind to ,mmdb without actually extracting the files.

                                    The GeoLite2-Country.mmdb file is 2048734 bytes, which is the same length as the GeoLite2-Country_20200303.tar.gz download from maxmind.

                                    cp GeoLite2-Country.mmdb GeoLite2-Country.tar.gz
                                    and then
                                    gzip -l ./GeoLite2-Country.tar.gz
                                    shows that the mmdb file was really a tar.gz file

                                    I think....

                                    John

                                    Lex parsimoniae

                                    1 Reply Last reply Reply Quote 0
                                    • S
                                      serbus
                                      last edited by

                                      Hello!

                                      Just more guessing...I am not sure I am looking at the correct code...

                                      The download from maxmind is 'application/gzip'

                                      The code doesnt look like it will decompress this type, and will only rename the downloaded file.

                                      Maybe

                                      if ($file_type == 'application/x-gzip' || $file_type == 'application/gzip' )

                                      ?

                                      John

                                      Lex parsimoniae

                                      1 Reply Last reply Reply Quote 0
                                      • E
                                        ex1580
                                        last edited by ex1580

                                        @BBcan177 I am still seeing this as of today on pfSense 2.4.5-RELEASE and pfBlockerNG-devel 2.2.5_30. Restarting the pfb_filter service didnt seem to fix it.
                                        8d41c7dd-4501-4ae1-a5b8-11406b2465b7-image.png

                                        BBcan177B 1 Reply Last reply Reply Quote 0
                                        • GertjanG
                                          Gertjan
                                          last edited by

                                          If "191.232.138.2" isn't present in any of your GeoIP files, then the "unknown" is understandable.

                                          While waiting for a reply from BBcan177, have a look at the files and check if this is true ?

                                          No "help me" PM's please. Use the forum, the community will thank you.
                                          Edit : and where are the logs ??

                                          1 Reply Last reply Reply Quote 0
                                          • BBcan177B
                                            BBcan177 Moderator @ex1580
                                            last edited by

                                            @ex1580
                                            Yes there was a change to the file mime-types in pfSense 2.4.5 and the change to fix Shallalist and UT1 is also needed to download one of the MaxMind databases.

                                            Install the latest version of the package and re-download MaxMind from the shell with this command:

                                            php -f /usr/local/www/pfblockerng/pfblockerng.php dc
                                            

                                            New events should show the GeoIP column in the alerts tab.

                                            "Experience is something you don't get until just after you need it."

                                            Website: http://pfBlockerNG.com
                                            Twitter: @BBcan177  #pfBlockerNG
                                            Reddit: https://www.reddit.com/r/pfBlockerNG/new/

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