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

How to unblock IP on pfSense+Snort using API or command line ?

Scheduled Pinned Locked Moved IDS/IPS
3 Posts 2 Posters 1.5k 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.
  • I
    itmnetworks
    last edited by May 20, 2022, 4:43 AM

    Hello,

    I need to create one way that I fill the blocked IP into one form on my NOC system and this IP need to be unblocked on Snort that running on pfSense.

    I'm not found the documentation about pfSense + Snort API or command line

    do you know how I can do this ?

    very thanks,
    Rodrigo

    1 Reply Last reply Reply Quote 0
    • B
      bmeeks
      last edited by bmeeks May 20, 2022, 1:32 PM May 20, 2022, 1:30 PM

      Yes, you can do this via a simple script using the pfctl utility. It will be up to you to figure out how to make it work in your NOC setup.

      This is the command line to execute:

      /sbin/pfctl -t snort2c -T delete {$ip}
      

      where you replace {$ip} with the actual IP address you want removed. So assuming I wanted to "unblock" 10.10.1.1, I would execute:

      /sbin/pfctl -t snort2c -T delete 10.10.1.1
      

      Snort blocks by putting IP addresses into a predefined pf table called snort2c. You can list all of the IP addresses currently stored in that table, and thus get a list of currently "blocked" IPs, using this command:

      /sbin/pfctl -t snort2c -T show
      
      I 1 Reply Last reply May 21, 2022, 1:36 AM Reply Quote 1
      • I
        itmnetworks @bmeeks
        last edited by May 21, 2022, 1:36 AM

        @bmeeks perfect, very very very thanks

        1 Reply Last reply Reply Quote 0
        1 out of 3
        • First post
          1/3
          Last post
        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
          This community forum collects and processes your personal information.
          consent.not_received