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

    URL Table Formatting?

    Scheduled Pinned Locked Moved Firewalling
    3 Posts 2 Posters 2.1k 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.
    • T Offline
      tdotcspot
      last edited by

      Hey everyone.

      I'm currently generating a text file (via php script) with a list of IPs that pfSense will read using Firewall : Aliases -> URL Table. I know that pfSense can access it, but I end up getting the following error:

      There were error(s) loading the rules: no IP address found for grep:
      /tmp/rules.debug:84: file "/var/db/aliastables/test.txt" contains bad data
      pfctl: Syntax error in config file: pf rules not loaded The line in question reads [
      /tmp/rules.debug]:

      The php script is pretty basic (doing fwrites to a file), but I am wondering if my format is wrong?

      The file reads like:

      192.168.1.100
      172.17.1.100
      198.18.0.100/29

      Line by line and I also trimmed out any whitespace Is this format ok? I've also tried this without the IP block, but I get the same error.

      Any help would be greatly appreciated. I'm not sure where to go from here. :(

      Thanks.
      -T

      1 Reply Last reply Reply Quote 0
      • T Offline
        tdotcspot
        last edited by

        Hello again,

        Just wanted to update this as I'm still looking for a solution. It would seem that the formatting that I created was correct as the rc.update_urltables script it uses to feed the IPs into the pftctl table works fine. I can see all my IP addresses in the table. But the error emails still persists. I receive these errors at least every hour. I think it has to do with the script after the fact that processes the IPs and places the firewall rules.

        Would anyone know which script performs that? Maybe I can look at that file and see why its giving that grep error.

        Thanks.
        -T

        1 Reply Last reply Reply Quote 0
        • jimpJ Offline
          jimp Rebel Alliance Developer Netgate
          last edited by

          The format is right, it's just one IP per line, or a CIDR masked net per line, it should skip whitespace and commented lines.

          If you cat /var/db/aliastables/test.txt it should show only the IP/CIDR lines

          Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

          Need help fast? Netgate Global Support!

          Do not Chat/PM for help!

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