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

    Multiple Interface DNS Rule Configuration

    Scheduled Pinned Locked Moved Firewalling
    11 Posts 2 Posters 1.1k Views 2 Watching
    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.
    • johnpozJ Offline
      johnpoz LAYER 8 Global Moderator
      last edited by

      Which interface do you have those rules on?

      You have allow to lanscape net - which is what interface?
      And then block with source of lanscape net??

      Rules are evaluated on the interface the traffic enters pfsense on.. So if you don't want lanscape going somewhere the rules would be on the lanscape interface.

      They are evaluted top down, first rule to trigger wins, not other rules are evaluted... When you post your rules - please post ALL of them, and what interface they are on.

      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 25.07 | Lab VMs 2.8, 25.07

      House Of CardsH 1 Reply Last reply Reply Quote 0
      • House Of CardsH Offline
        House Of Cards @johnpoz
        last edited by

        @johnpoz

        All those rules are on the LAN in that order. I just have it named LANSCAPE for the hell of it.

        The idea is that if the DNS is destined for the interface itself it allows it... If the DNS request is headed anywhere else it is blocked. I only want the DNS requests served by those defined in my general tab.

        Not sure I’m thinking right about how to go about it though.

        Steve

        1 Reply Last reply Reply Quote 0
        • johnpozJ Offline
          johnpoz LAYER 8 Global Moderator
          last edited by

          That would be lanscape address then, not net

          But looks like your missing some rules there.. Since nothing would work with just those rules other than dns. Which is why you need to show ALL the rules, since they are evaluated in order.. So you have to see all of them.

          Your general tab doesn't have anything to do with it, if you are using unbound (resolver) out of the box it resolves - it doesn't forward..

          Also btw dot or dns over tls (port 853) would be tcp, not udp.

          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 25.07 | Lab VMs 2.8, 25.07

          House Of CardsH 1 Reply Last reply Reply Quote 0
          • House Of CardsH Offline
            House Of Cards
            last edited by

            Thanks for the help with this... Keep in mind, I'm just learning as I go here.

            There are more rules obviously. LOL. I have left the default "pass all" rule at the bottom of my rules list while I'm configuring/learning. My goal (and to keep things working while I mess around) is to gradually add rules above that "pass all" rule to pass or reject traffic until, eventually, that generic rule isn't needed. Eventually I will reach a point where that last rule isn't capturing anything, and I have made a deliberate decision about each type of traffic as I get to that point.

            Wikipedia shows port 853 as "official" for TCP and UDP which is what I selected. Am I missing something?

            Again, thanks for putting up with us over-ambitious home users. 👍

            Steve

            1 Reply Last reply Reply Quote 0
            • House Of CardsH Offline
              House Of Cards @johnpoz
              last edited by

              @johnpoz

              Settings.png

              The general settings page.

              1 Reply Last reply Reply Quote 0
              • johnpozJ Offline
                johnpoz LAYER 8 Global Moderator
                last edited by

                And again those don't do anything... Out of the box pfsense resolves, it doesn't forward...

                If you do not show me all the rules... I can not help you.

                dns over tls does not use UDP... It only uses TCP.. now there is another protocol DNS-over-DTLS (DNSoD) which could use udp..

                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 25.07 | Lab VMs 2.8, 25.07

                House Of CardsH 1 Reply Last reply Reply Quote 0
                • House Of CardsH Offline
                  House Of Cards @johnpoz
                  last edited by

                  @johnpoz

                  These are what I have on the LAN...

                  1.png

                  The anti-lockout rule which I'd like to kill eventually. And a series of forward rules which allow me to forward different classifications of devices out to the VPN on demand.

                  Then pass/block rules...

                  2.png

                  These basic rules seem to catch most everything, but there is still some stuff the "pass all" rule has to deal with.

                  As for the DNS rules, they are working, because on every device which I don't force to VPN, only Cloudflare is returning DNS results. 1.1.1.1

                  3.png

                  I'm not forwarding DNS, I've entered the list of servers I want to use for DNS in the section that is there to enter DNS servers you want to use. The rules should simply be allowing traffic following those guidelines, and blocking any tricky devices trying to proxy their DNS requests around what I've configured.

                  4.png

                  The general foundation seems to be working, but I want to get opinions about my overall structure before I get serious about making all the necessary rules and disabling the default ones.

                  Thanks.

                  1 Reply Last reply Reply Quote 0
                  • johnpozJ Offline
                    johnpoz LAYER 8 Global Moderator
                    last edited by

                    @wormuths said in Multiple Interface DNS Rule Configuration:

                    I'm not forwarding DNS

                    Then those IPs would not be used!!! You must be handing those IPs to clients via dhcp, or your setting them static, or the clients are using those on their own via some other means. If cloudflare is showing up that test.

                    Out of the box pfsense dhcp will only hand out its OWN ip for dns, unless you turned off unbound, forwarder, etc services.. Then it will hand out what you put in there, or what it got from dhcp on its wan..

                    The note on the bottom clearly states how they are used. Those could be used by pfsense, if say the local service crashed.. But if a client ask pfsense, it will resolve - it will not use those..

                    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 25.07 | Lab VMs 2.8, 25.07

                    House Of CardsH 1 Reply Last reply Reply Quote 0
                    • House Of CardsH Offline
                      House Of Cards @johnpoz
                      last edited by

                      @johnpoz

                      I'm not arguing with you. It's very possible I'm not understanding how this process works in pfSense on some fundamental level. I'm trying to ensure that I'm on the right path, and what I have configured seems to be working.

                      I have DHCP on each interface. I only give it a small range to assign for initial connections, guest access, etc. Anything I'm permanently adding to the network gets statically assigned by DHCP an IP in the range of the appropriate alias so rules will take over using those alias'...

                      From there, I simply wanted to prevent questionable devices like home automation gadgets from doing any funny business, so I started with DNS. I want to force these devices to use 1.1.1.1 as their DNS service. I told pfSense to use 1.1.1.1 and created rules which A) allow DNS heading to the interface itself, and B) block DNS heading anywhere else.

                      Is that incorrect? If it is, why are my DNS queries heading to 1.1.1.1 as I have configured?

                      Thanks again for the insight.

                      1 Reply Last reply Reply Quote 0
                      • johnpozJ Offline
                        johnpoz LAYER 8 Global Moderator
                        last edited by johnpoz

                        Out of the box pfsense resolves, and yes clients can ask it for dns on its IP.. And it will then resolve what they ask..

                        it will walk down from roots to find the authoritative nameserver in question, and then ask that ns for whatever.domain.tld your looking for.. it does not forward anywhere.. No matter what you put in the dns servers under general.

                        The only time those would/could be used is if pfsense itself is looking for something.

                        If you want unbound to forward to 1.1.1.1 then you have to tell unound to forward.

                        forwardmode.png

                        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 25.07 | Lab VMs 2.8, 25.07

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