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

    How to backup pfblockerng please?

    Scheduled Pinned Locked Moved pfBlockerNG
    18 Posts 7 Posters 4.2k 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.
    • K
      Koent
      last edited by

      Hello,

      How can you backup the pfBlockerNG config please?
      I tried looking into XMLRPC, but I'm confused. What software should I install on the target please?

      Thanks.

      provelsP 1 Reply Last reply Reply Quote 0
      • provelsP
        provels @Koent
        last edited by

        @Koent Just use the "Diagnostics/Backup and Restore" or "Services/Auto Config Backup" to backup the entire system's config.xml. It's all in there.

        Peder

        MAIN - pfSense+ 24.11-RELEASE - Adlink MXE-5401, i7, 16 GB RAM, 64 GB SSD. 500 GB HDD for SyslogNG
        BACKUP - pfSense+ 23.01-RELEASE - Hyper-V Virtual Machine, Gen 1, 2 v-CPUs, 3 GB RAM, 8GB VHDX (Dynamic)

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

          Check out the "Sync" 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 0
          • K
            Koent
            last edited by

            Hello,

            I cannot find a target to receive the files. Any idea what I should install on the receiving host please. I have a qnap NAS, an Ubuntu server and an Arch laptop. Sorry to disturb with this. I 've looked around for a couple of hours but I cannot find a solution.

            Thanks.

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

              @Koent
              You don't need to install anything except pfBlockerNG-devel on both boxes. They must both be the same pfSense version tho. Then you configure the sync settings on the master to push settings to the other machine. This will occur on a Force Update or Cron event. Then once its sync'd once, you can remove the sync.

              "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/

              K D 2 Replies Last reply Reply Quote 0
              • K
                Koent @BBcan177
                last edited by

                @BBcan177 OK. Thanks.

                1 Reply Last reply Reply Quote 0
                • D
                  Draco @BBcan177
                  last edited by

                  @bbcan177 Reopening an old topic: is there a list of which files to download from pfSense to my PC that will save my pfBlocker configuration? I almost had to repave my pfSense box and would've lost my config if I had.

                  Thanks!

                  S 1 Reply Last reply Reply Quote 0
                  • S
                    SteveITS Galactic Empire @Draco
                    last edited by

                    @draco Just save the config file:
                    https://forum.netgate.com/topic/146705/how-to-backup-pfblockerng-please/2

                    Pre-2.7.2/23.09: 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 restart, or more depending on packages and device speed.
                    Upvote 👍 helpful posts!

                    D 1 Reply Last reply Reply Quote 0
                    • S SteveITS referenced this topic on
                    • D
                      Draco @SteveITS
                      last edited by

                      @steveits I thought that PFblocker had more configuration info than was found in the config.XML file. Did I misunderstand?

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

                        @draco
                        You did.
                        The config file contains all the settings from all the packages and all pfSense itself.

                        Take note : default settings don't need to be saved.

                        Try it out for yourself :
                        Re install pfSense.
                        Import the saved config file.
                        All settings will get restored.

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

                        D 1 Reply Last reply Reply Quote 0
                        • L
                          luas
                          last edited by

                          I'm in a similar situation. We have a backup from "Auto Config Backup" and our hardware died. Restoring backup lacked pfblocker config, such as websites we had manually put on allow-lists..
                          Did I get this right from here that Auto Config Backup skips pfblocker config, while manual backup includes it? If so, is there any chance to restore these settings in case the ssd is still intact?
                          Thanks in advance!

                          S GertjanG 2 Replies Last reply Reply Quote 0
                          • S
                            SteveITS Galactic Empire @luas
                            last edited by

                            @luas I had not heard that about the auto backup. We don't use that. We just download a copy whenever changes are made, to our office and/or the client's site. The downloaded config has everything.

                            There is this:
                            https://docs.netgate.com/pfsense/en/latest/backup/restore.html#restoring-by-mounting-the-disk

                            Pre-2.7.2/23.09: 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 restart, or more depending on packages and device speed.
                            Upvote 👍 helpful posts!

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

                              @luas said in How to backup pfblockerng please?:

                              Did I get this right from here that Auto Config Backup skips pfblocker config

                              Services > Auto Configuration Backup > Restore
                              and use the Show Info button :

                              e94afe02-547f-4f10-bba5-c1fa7f63064d-image.png

                              My backups do contain all the pfblockerng settings.

                              Btw : I'm only using "abc" in the daily mode :

                              51a7f02f-2323-4057-b64f-d0ca8f38ebdb-image.png

                              the "on every config change" will backup ... as said, on every config change.
                              That's fine, but, if you edit your config a lot on one day, and knowing that abc has a limit to the last 100 configs or so, I prefer to have a 'daily' copy.

                              Also : I have a PC on my LAN executing a daily script that grabs a copy of the config, just to have a local backup plan.

                              Can't find any traces about "pfblockerng" being excluded, neither why this would be needed :

                              b783300a-0e49-45fd-b7f1-000bbfa11e2a-image.png

                              anyway, the discussed pfblockerng version on redit is old.

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

                              L 1 Reply Last reply Reply Quote 1
                              • L
                                luas @Gertjan
                                last edited by

                                Thanks @SteveITS and @Gertjan
                                In the meantime, I was able to stick the ssd from the broken firewall into another device and boot up there. My apologies - saying whitelists were missing was not true. Indeed they're there, and massed user feedback about sites being blocked that worked before had led me to wrong assumptions.

                                Our pfblocker specialist is on vacation, and frankly speaking, I'm not sure what happened exactly. Thanks for your support anyway!

                                1 Reply Last reply Reply Quote 0
                                • D
                                  Draco @Gertjan
                                  last edited by

                                  @gertjan To test this idea, I started grep'ing /conf/config.xml. A lot of the configuration information is there. However not all of it is present. For instance entries from manual/custom DNSBL Whitelists and Blacklists is not in config.xml (I confirmed this with a couple of greps -- if even one entry is missing then it would seem it ain't all there).

                                  Another user just asked about this on Reddit.

                                  Now I wonder what else is not stored in Config.xml ... ?? Had I flattened my box and tried to restore it using a backup Config.xml, I would've lost my at least the data in my custom DNSBL White/Black-lists.

                                  @BBcan177 - when you come up for air again, any guidance you can offer would be appreciated!

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

                                    @draco

                                    I decided to unblock "metrics.icloud.com" :

                                    On the Alert page :

                                    8c16b91f-8349-4f91-9a03-d63bcb912564-image.png

                                    and added a comment "20230316".

                                    The message showed up at the top :

                                    ee9dfc84-86d9-484c-bc09-e48f5b07b57a-image.png

                                    After a somewhat slow realod of the Alert page :

                                    e2250e88-2cc7-4aec-9a22-80bf91ffacf8-image.png

                                    On the main Firewall > pfBlockerNG > DNSBL page, close to the bottom, I found :

                                    b89dec4c-5306-4ba0-8188-fd410cf0eeab-image.png

                                    so that is where the white listed DNSBL are added. Note the comment "20230316".

                                    You said : I can't find these entries in the config.xml
                                    The answer is : you have to know how to look 😊

                                    To find it, I used 'grep' also, but took another approach.

                                    Take another look at this :

                                    b89dec4c-5306-4ba0-8188-fd410cf0eeab-image.png

                                    and now look at it with your browser developper tool, so you can see the html :

                                    5618364a-810f-4593-9fb3-c7cd96aae28a-image.png

                                    Now I know that html texarea is called 'suppression'.

                                    I grepped 'suppression' in the config.xml file, and sure enough, several exist, but one is our potential candidate :

                                    		<pfblockerngdnsblsettings>
                                    			<config>
                                    				<pfb_dnsvip>10.10.10.1</pfb_dnsvip>
                                    				<pfb_dnsport>8081</pfb_dnsport>
                                    				<pfb_dnsport_ssl>8443</pfb_dnsport_ssl>
                                    				<pfb_dnsblv6>on</pfb_dnsblv6>
                                    				<pfb_dnsbl>on</pfb_dnsbl>
                                    				<suppression>czMuYW1hem9uYXdzLmNvbQ0KczMtMS5hbWF6b25hd3MuY29tDQpnaXRodWIuY29tDQpnaXRodWJ1c2VyY29udGVudC5jb20NCmdpdG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vkb3Vlc3QuZnINCnRyYWNraW5nLmJwMDEubmV0ICMgQ05BTUUgZm9yICh0ci5jb3Vycmllci5zdWRvdWVzdC5mcikNCnBhcmtpbmdjcmV3Lm5ldA0Kd3d3LnBhcmtpbmdjcmV3Lm5ldA0KLmluZm8tZnIuYnVyZWF1dmVyaXRhcy5jb20NCi50YWJvb2xhLmNvbQ0KLm1ldHJpY3MuaWNsb3VkLmNvbSAjIHRlc3QgMjAyMzAzMTYgd2hpdGVsaXN0DQo=</suppression>
                                    				<pfb_tld>on</pfb_tld>
                                    ......
                                    etc
                                    .....
                                    		</pfblockerngdnsblsettings>
                                    

                                    So the entire text area block is base64 encoded.
                                    Not really to hide it for privacy reason, as it can be decoded easily, but to take care of all kind user entered comment text that could contain accents, international ASCI and whatever. It's a save way to store random text in a xml file, which imposes it's own encoding.
                                    Btw : Most user entered text will be base64 encoded.

                                    Let's check my <suppression> block with ... (200 msec Google grep ) : https://www.base64decode.org/, pasted in the <suppression> block and :

                                    9779836a-0c36-4587-a895-0a38a2558abe-image.png

                                    Case closed : 😊

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

                                    BBcan177B D 2 Replies Last reply Reply Quote 3
                                    • BBcan177B
                                      BBcan177 Moderator @Gertjan
                                      last edited by

                                      All custom lists are stored as base64 entries in the config.xml

                                      "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
                                      • D
                                        Draco @Gertjan
                                        last edited by

                                        @gertjan Rarely am I so happy to be shown that I am wrong. Thank you for your detailed rundown (and to @BBcan177 for confirming that all custom lists are base64 encoded)!

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