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 398 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

      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 johnpozJ 3 Replies Last reply Reply Quote 0
      • M
        mcury @markster
        last edited by

        @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

          @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
          • johnpozJ
            johnpoz LAYER 8 Global Moderator @markster
            last edited by johnpoz

            @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 Reply Quote 1
            • M
              markster @johnpoz
              last edited by

              @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.