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

    Add Custom Tables

    Scheduled Pinned Locked Moved General pfSense Questions
    9 Posts 5 Posters 1.0k 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
      meaglerick
      last edited by

      I'm writing a custom script that should import tables into the pfsense firewall.

      Where does pfsense store the tables it uses to enforce rules? sshguard, virusprot, or aliases?

      I have looked through the documentation but cannot seem to find it there. Thank you.

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

        Tables? What are you talking about? Do you mean iptables? pfSense uses pf, not iptables.

        1 Reply Last reply Reply Quote 0
        • M
          meaglerick
          last edited by

          Not ipTables, but the custom tables that pfSense reads to make rules. i.e. I create a custom Alias table called "streaming_services" and add "netflix.com, youtube.com, prime.amazon.com"

          Is there a way for me to interact with these from the FreeBSD by writing a script?

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

            Try the pfctl command.

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

              If you use a URL alias in pfSense it will pull in a alias and make a table from it for you.

              Or use pfBlocker to do it for more options. You can probably just use pfBlocker instead of a custom script in fact.

              Steve

              M 1 Reply Last reply Reply Quote 0
              • S
                sabinlal28
                last edited by

                i think you are looking for this /vat/db/
                note : if you overload the alias table you might faces issues in firewall part. according to pfsense max data store of a alias table is around 1000 ip address . The number might be work please check pfsense book for that.

                1 Reply Last reply Reply Quote 0
                • M
                  meaglerick @stephenw10
                  last edited by

                  @stephenw10 I see the DNSBL IP section to whitelist or blacklist top level domain names. Would there be a way I can use this to create separate firewall rules that allows split routing? I'm trying to get after having most traffic go out my VPN gateway, but then anything destined for *.netflix.com, *.nflx.net, or *.netflix.video out my WAN interface so that netflix will stop blocking all my traffic. I haven't found a place to define wildcards on any subdomain names to date.

                  Thank you.

                  K 1 Reply Last reply Reply Quote 0
                  • K
                    Konstanti @meaglerick
                    last edited by Konstanti

                    @meaglerick

                    Hello
                    I don't think this can be implemented by standard PF means. And using aliases for this will not help solve the problem. The TTL value in DNS responses for Netflix servers is very small and there are many Netflix servers, so each DNS server returns a different ip in its responses.
                    Netflix uses domains for its work
                    netflix.com
                    nflxso.net
                    nflxvideo.net
                    nlfximg.net

                    To split the traffic, you can examine the responses from the DNS server and then manually enter data about the networks (not hosts) that Netflix uses into the PF tables. But this list of these networks is constantly updated .

                    Or you can write a program that will analyze the responses from the DNS server and put these responses in the PF tables.

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

                      Yes, there's no way to do that directly. You can try using the Netflix ASN in pfBlocker to create an alias then use that in a policy routing rule. https://forum.netgate.com/post/848939

                      Steve

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