pfSense

Guides, Tweaks and Tips for pfSense.

Install CrowdSec on pfSense

Step‑by‑Step Guide: Install CrowdSec on pfSense & Enroll in Console

1. Access pfSense via SSH or Console

2. Install CrowdSec Package

3. Configure CrowdSec via GUI

4. Verify Service Status

5. Viewing Alerts & Blocked IPs

6. Test the Setup

7. Optional: Whitelist Local Networks


Enroll Your pfSense Instance in CrowdSec Console

A. Setup Integration in the CrowdSec Console

  1. Log in to your [CrowdSec Console] account.
  2. Go to Blocklist → Integrations.
  3. Click Connect under pfSense.
  4. Provide a meaningful name (e.g., "My Firewall").
  5. Copy the credentials and integration ID — this will only display once(docs.crowdsec.net).

B. Configure pfSense to Fetch Blocklists

  1. In pfSense Web UI, go to Firewall → Aliases → URLs → Add.
  2. Create a new URL alias:

    • Name: crowdsec_blocklist (or similar)
    • Type: URL Table (IPs)
    • URL:

      https://<username>:<password>@admin.api.crowdsec.net/v1/integrations/<integration_id>/content
    • Set update frequency (e.g., daily)(docs.crowdsec.net).
  3. Save and Apply.

C. Create Firewall Rule to Block Malicious IPs

  1. Navigate to Firewall → Rules → WAN (or desired interface).
  2. Add a rule:

    • Action: Block
    • Interface: WAN
    • Source: use the alias created (crowdsec_blocklist)
    • Destination: Any
    • Description: e.g., “Block CrowdSec IPs”
  3. Save and apply changes(docs.crowdsec.net).

Summary Table of Steps

Step Action
1⃣ SSH into pfSense
2⃣ Install CrowdSec package (script or manual)
3⃣ Enable components in Services → CrowdSec
4⃣ Verify and manage services in GUI or shell
5⃣ Monitor alerts, decisions, and blocked IPs
6⃣ Test blocking with a temporary ban rule
7⃣ Optionally whitelist local networks
8⃣ Enroll instance in CrowdSec Console (Integrations)
9⃣ Set up URL alias to fetch CrowdSec blocklist
1️⃣0️⃣ Create firewall rule to block malicious IPs

Tips & Caveats


By following these steps, you'll achieve a well‑integrated CrowdSec deployment on pfSense — complete with automated blocking, visibility into attacks, and centralized management via the CrowdSec Console.

Ins0mniA

pfSense Auto Update OS + Packages

pfSense Auto Update OS + Packages

For administrators who prefer managing their pfSense firewall from the command line, knowing the right tools for updating is essential. Two key utilities are pkg-static for managing add-on packages and pfSense-upgrade for handling major OS releases.

🚀 One-Line Download & Execute:

clear && curl -fsSL https://docs.greenhome.stream/attachments/46 -o auto_upgrade.sh && chmod +x auto_upgrade.sh && clear && ./auto_upgrade.sh

This guide breaks down two powerful one-liner commands for automating these updates.

Part 1: Updating Installed Packages (pkg-static)

This command updates all installed add-on packages (like pfBlockerNG, Suricata, or other packages from the System > Package Manager menu) to their latest versions, without changing the core pfSense OS.

The Command:
/usr/local/sbin/pkg-static update -f && /usr/local/sbin/pkg-static upgrade -y
What It Does:

This is a two-part command joined by &&, which means the second part only runs if the first part succeeds.

  1. /usr/local/sbin/pkg-static update -f
    • This command contacts the pfSense package repositories and forces a refresh of the package catalog. The -f (force) flag ensures you have the absolute latest list of available package versions, bypassing any local cache.[^1][^2]
  2. /usr/local/sbin/pkg-static upgrade -y
    • This command compares the versions of your installed packages to the newly updated catalog. It then proceeds to download and install the latest versions for all packages that have an update available. The -y flag automatically answers "yes" to any confirmation prompts, making the process non-interactive.[^1]
Use Case:

Run this command when you want to update your add-on packages but are not ready to upgrade the entire pfSense operating system.

Part 2: Upgrading the pfSense OS (pfSense-upgrade)

This command initiates a full pfSense software upgrade, moving the system to the next major or minor release (e.g., from version 2.7.0 to 2.7.2).

The Command:
pfSense-upgrade -d -u -y
What It Does:

This command uses the official pfSense upgrade script with several flags to automate the process.

Use Case:

This is the command to use for a complete, non-interactive system OS upgrade. Be aware that this process will download several hundred megabytes of data and will automatically reboot the firewall upon completion.

Important Considerations & Best Practices

Ins0mniA