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

    Access pfSense alias from other boxes

    Scheduled Pinned Locked Moved Off-Topic & Non-Support Discussion
    6 Posts 4 Posters 903 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.
    • J
      joelones
      last edited by

      I'd like to define an aliases with IPs on pfSense and be able to access this list of IPs from internal clients on my LAN, from within a bash script (using curl or something similar). Thoughts on whether this is possible via the UI?

      1 Reply Last reply Reply Quote 0
      • KOMK
        KOM
        last edited by

        You might be able to symbolically link the aliases file to the root of the web server and then access it via HTTP.

        1 Reply Last reply Reply Quote 0
        • J
          joelones
          last edited by

          @KOM:

          You might be able to symbolically link the aliases file to the root of the web server and then access it via HTTP.

          Not exactly sure how to accomplish this. I noticed that the directory /var/db/aliastables/ doesn't have the IP Aliases.

          1 Reply Last reply Reply Quote 0
          • KOMK
            KOM
            last edited by

            No idea either.  I was totally guessing to get you started (or waste your time, 50/50….)  If it's in some binary format then good luck.

            1 Reply Last reply Reply Quote 0
            • K
              kpa
              last edited by

              You can extract contents of PF tables from the active ruleset with something like "/sbin/pfctl -T show -t bogons". I wouldn't use the webgui for that but run it over SSH with the root user and with  public keys to avoid use of passwords.

              1 Reply Last reply Reply Quote 0
              • bmeeksB
                bmeeks
                last edited by

                To expound a bit on what @kpa is saying –-

                Aliases defined on the FIREWALL >> ALIASES tab in pfSense eventually wind up defined as pf tables.  The table name matches the alias name, and the table's content will be the IP address or addresses the alias resolves to at run time.  So the CLI command he gave an example of is used to dump out the contents of a specific table name.  In the example given, the table name is "bogons".

                If you don't know the table name in advance, you can do this to get a list of all the tables –

                /sbin/pfctl -s Tables
                

                You could code all this in a shell script to list the tables and then grab the contents (IP addresses) of each table.

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