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

How to find the rule that blocks given IP

Scheduled Pinned Locked Moved Firewalling
5 Posts 3 Posters 558 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.
  • M
    markster
    last edited by markster May 8, 2025, 3:32 PM May 8, 2025, 2:47 PM

    I have many rules on my pfsense and mostly blocking certain countries. These rules have been created using URL Tables.
    Sometimes I encounter a problem where IP is blocked and I want to find out which rule is doing that.
    Is there a better way than manually looking at the rules and trying to find that IP?
    For example, all rules are lists and if ther are stored in one folder on pfsense I could just use grep.

    M M J 3 Replies Last reply May 8, 2025, 2:51 PM Reply Quote 0
    • M
      mcury @markster
      last edited by May 8, 2025, 2:51 PM

      @markster said in How to find the rule that blocks given IP:

      Is there a better way than manually looking at the rules and trying to find that IP?

      https://forum.netgate.com/post/91660

      dead on arrival, nowhere to be found.

      1 Reply Last reply Reply Quote 0
      • M
        markster @markster
        last edited by May 15, 2025, 9:59 PM

        @markster
        I have found out that all alias tables are stored in /var/db/aliastables directory. So basically you can run a grep command to find out if any of the files contain IP you are looking for.
        Simple.

        1 Reply Last reply Reply Quote 0
        • J
          johnpoz LAYER 8 Global Moderator @markster
          last edited by johnpoz May 15, 2025, 10:54 PM May 15, 2025, 10:50 PM

          @markster huh? Firewall log lists the rule that blocked, if your logging the rule.. Are you not logging your block rules?

          block.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 24.11 | Lab VMs 2.8, 24.11

          M 1 Reply Last reply 19 days ago Reply Quote 1
          • M
            markster @johnpoz
            last edited by 19 days ago

            @johnpoz
            I do not log block rules. Good point.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
              [[user:consent.lead]]
              [[user:consent.not_received]]