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

    Link Alias to existing table

    Scheduled Pinned Locked Moved General pfSense Questions
    7 Posts 3 Posters 582 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
      Maarten. 0
      last edited by

      Hi,

      Is it possible to create/link an alias to an existing pf table so I can use this table in my firewall rules?

      If I create an alias and update the contents of the corresponding pf table in the background, the table is cleared when the pfsense rules are refreshed with /etc/rc.filter_configure_sync. So I'm looking for a way to prevent this table clean up.

      I think this needs a modification in /etc/inc/filter.inc but I'm not sure how.

      (I know the url alias function, but that does not really permit fast updates.)

      Thanks.

      Maarten

      1 Reply Last reply Reply Quote 0
      • stephenw10S
        stephenw10 Netgate Administrator
        last edited by

        What table are you wanting to use in a rule that doesn't exist as a an alias out of interest?

        Steve

        1 Reply Last reply Reply Quote 0
        • M
          Maarten. 0
          last edited by

          In the background I create a table like this: pfctl -t DynTestHosts -T add 1.1.1.1/32

          I add hosts to this table with the same command, and let entries expire after 48 hours.

          The problem I have to work around is the following:

          I have a few dns names that resolves in a list of ip addresess, but these addresses change constantly.

          When I add these dns names to a pfsense alias table, pfsense resolves the dns names and replaces all IP's in this list. So every ip that is not resolved that time is being removed.

          1 Reply Last reply Reply Quote 0
          • stephenw10S
            stephenw10 Netgate Administrator
            last edited by

            So the issue is previously resolved IPs are removed everytime filterdns is run and creates a new list?

            Pulling the IPs from an external list seems like the way to go here, just how fast do you need them to update?

            Steve

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

              Make an alias in the GUI with a dummy address inside, then use it in rules, etc. You can still edit its contents with pfctl.

              If you make it a persist table (e.g. URL table alias) then it should keep your custom values across filter reloads.

              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
              • M
                Maarten. 0
                last edited by

                Thanks, I'm using the URL table alias right now.

                1 Reply Last reply Reply Quote 0
                • stephenw10S
                  stephenw10 Netgate Administrator
                  last edited by

                  But I assume you want new resolved IPs to be added to the list as they are seen right?

                  Or are you OK adding the IPs manually via pfctl?

                  Steve

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