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

    Best topology for my network

    Scheduled Pinned Locked Moved General pfSense Questions
    43 Posts 5 Posters 4.8k 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
      tknospdr @Austin 0
      last edited by

      @tknospdr rules apply on an interface as packets arrive on that interface. They apply in order top down.
      https://docs.netgate.com/pfsense/en/latest/firewall/fundamentals.html

      Thanks for that, reading through it all now, but I think what I need is multiple practical examples. I'll just keep making rules and asking the hive mind if they're right before I turn them on

      Packets from a LAN device to another LAN device will not go through the firewall.

      Packets to a device on another network need to be allowed by that server’s firewall if it has one. Some allow only their own subnet by default.

      @tknospdr Yes the firewall will not filter traffic destined to the same subnet as it originated from. This is because the traffic will be directed by the switch and never actually go to the firewall.

      Okay, so that's good info to know.

      Now my question is...

      Is there a functional difference between a rule denying all traffic on 'ANY' vs denying all traffic !ETH3 net "not matching" originating LAN?

      Austin 0A 1 Reply Last reply Reply Quote 0
      • Austin 0A
        Austin 0 @tknospdr
        last edited by

        @tknospdr The first option will match traffic originated from this lan interface and destined to pfsense or other networks, the second option does not.

        T 1 Reply Last reply Reply Quote 0
        • T
          tknospdr @Austin 0
          last edited by

          @Austin-0
          So what DOES the 2nd option do?

          Austin 0A 1 Reply Last reply Reply Quote 0
          • Austin 0A
            Austin 0 @tknospdr
            last edited by

            @tknospdr It would not match traffic coming from the interface and destined to the firewall or other networks.

            T 1 Reply Last reply Reply Quote 0
            • T
              tknospdr @Austin 0
              last edited by

              @Austin-0

              Okay, here's where I get confused then, because to me saying:

              If source is ETH3, but destination is NOT ETH3, drop the packets
              Like the bottom rule here

              Seems like the most efficient way to express a rule where you want all outbound (from the subnet) packets dropped unless they match an incoming state.

              What's the flaw in my thinking?
              And seriously, I'm not being argumentative, this is just the best way for me to learn.

              S NollipfSenseN 2 Replies Last reply Reply Quote 0
              • S
                SteveITS Galactic Empire @tknospdr
                last edited by

                @tknospdr It is a subtle difference but it's possible to have a network behind ETH3 that is routed through ETH3 but is a different subnet. It's not a common setup though so if you're not routing internal traffic then there's not really a difference.

                Your example is only blocking "ETH3 Net" but the default block rule would block it.

                Your example is also invalid btw...which interface is this ruleset on? If it is on ETH3, the destination can never be ETH3. If it is not on ETH3, then the source for the last rule can never be ETH3 Net.

                Pre-2.7.2/23.09: Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
                When upgrading, allow 10-15 minutes to restart, or more depending on packages and device speed.
                Upvote 👍 helpful posts!

                T 1 Reply Last reply Reply Quote 1
                • NollipfSenseN
                  NollipfSense @tknospdr
                  last edited by NollipfSense

                  @tknospdr said in Best topology for my network:

                  What's the flaw in my thinking?
                  And seriously, I'm not being argumentative, this is just the best way for me to learn.

                  Screenshot 2023-07-21 at 11.45.44 AM.png

                  If you say that, then you're. As SteveTS said, you cannot have source and the destination the same...that's not how network works.
                  Would you go to the airport, say JFK (source or origination) to catch a flight going to JFK destination? You won't find any airline. Or, if you say I want to drop flights going to destination JFK, if the source or origination is JFK...you wouldn't find any flights to drop because no airline flies that route either.

                  Makes sense?

                  pfSense+ 23.09 Lenovo Thinkcentre M93P SFF Quadcore i7 dual Raid-ZFS 128GB-SSD 32GB-RAM PCI-Intel i350-t4 NIC, -Intel QAT 8950.
                  pfSense+ 23.09 VM-Proxmox, Dell Precision Xeon-W2155 Nvme 500GB-ZFS 128GB-RAM PCIe-Intel i350-t4, Intel QAT-8950, P-cloud.

                  T 1 Reply Last reply Reply Quote 0
                  • T
                    tknospdr @SteveITS
                    last edited by

                    @SteveITS said in Best topology for my network:

                    @tknospdr It is a subtle difference but it's possible to have a network behind ETH3 that is routed through ETH3 but is a different subnet. It's not a common setup though so if you're not routing internal traffic then there's not really a difference.

                    Are you talking about a VLAN, or something else. Because I do have 2 VLANs traversing ETH3. If those don't count I don't want to learn any other stuff I don't have to deal with right now.
                    My ears are already smoking with this learning module.

                    Your example is only blocking "ETH3 Net" but the default block rule would block it.

                    The default block rules that I keep seeing mentioned are implied right? I don't actually see anything in any of the FW rule lists so it's just "zero rules = block everything" right?

                    Your example is also invalid btw...which interface is this ruleset on?

                    The ruleset is on ETH3

                    If it is on ETH3, the destination can never be ETH3.

                    I don't understand this. You can't make a rule on a subnet regarding traffic on itself?

                    If it is not on ETH3, then the source for the last rule can never be ETH3 Net.

                    Similar question... You can't make a rule saying for incoming packets on adapter ETH2, if the source is ETH3 do X?

                    S johnpozJ 2 Replies Last reply Reply Quote 0
                    • T
                      tknospdr @NollipfSense
                      last edited by

                      @NollipfSense said in Best topology for my network:

                      Makes sense?

                      What you're saying makes sense, but I didn't think that's what I was saying.

                      I thought the rule I created said:

                      If I go to JFK, show me a list of flights that !JFK (are not destined for JFK), then ground them so they can't leave the airport. Effectively grounding ALL flights out of JFK.

                      It seems like I'm misunderstanding the usage of 'Invert match', so what would I use that for?
                      I thought it meant "everything that is not X", but clearly that's faulty thinking.

                      NollipfSenseN 1 Reply Last reply Reply Quote 0
                      • NollipfSenseN
                        NollipfSense @tknospdr
                        last edited by

                        @tknospdr said in Best topology for my network:

                        If I go to JFK, show me a list of flights that !JFK (are not destined for JFK), then ground them so they can't leave the airport. Effectively grounding ALL flights out of JFK.

                        But, the thing is there is no such list and will never be such list; so, there will be no flights to ground ever. These two threads should help you understand "invert match:" https://forum.netgate.com/topic/100836/firewall-invert-match-question - https://www.reddit.com/r/PFSENSE/comments/lyxkoj/invert_match/

                        pfSense+ 23.09 Lenovo Thinkcentre M93P SFF Quadcore i7 dual Raid-ZFS 128GB-SSD 32GB-RAM PCI-Intel i350-t4 NIC, -Intel QAT 8950.
                        pfSense+ 23.09 VM-Proxmox, Dell Precision Xeon-W2155 Nvme 500GB-ZFS 128GB-RAM PCIe-Intel i350-t4, Intel QAT-8950, P-cloud.

                        T 1 Reply Last reply Reply Quote 0
                        • T
                          tknospdr @NollipfSense
                          last edited by tknospdr

                          The list IS the rule.

                          Sorry for being so dense, but those threads basically say the same thing I'm saying.

                          If the source of the packet is ETH3 net, and it's destination is NOT ETH3 net, block it.

                          I'm sure there's an "Ah ha!" moment ahead, I just haven't reached that nirvana yet.
                          There's some crazy subtle difference I'm not picking up on.

                          1 Reply Last reply Reply Quote 0
                          • S
                            SteveITS Galactic Empire @tknospdr
                            last edited by

                            @tknospdr said in Best topology for my network:

                            You can't make a rule on a subnet regarding traffic on itself?

                            Packets from ETH3-PC1 to ETH-PC2 should not go to the router, they go across the switch, from one port to another.

                            Though is is interesting your top two rules show matching traffic which makes me wonder what's going on...

                            typically a packet arriving from ETH3 at the router would be going anywhere else except ETH3.

                            Pre-2.7.2/23.09: Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
                            When upgrading, allow 10-15 minutes to restart, or more depending on packages and device speed.
                            Upvote 👍 helpful posts!

                            T 1 Reply Last reply Reply Quote 0
                            • T
                              tknospdr @SteveITS
                              last edited by

                              @SteveITS

                              My pfS box has 4 un-switched 2.5GbE ports on it.
                              ETH0 is WAN, ETH1 is LAN, I'm not currently using ETH2, and ETH3 goes to my WAP which hosts 3 different subnets.
                              10.100.10.0 is my IOT/HomeKit stuff
                              10.100.20.0 is on VLAN20 for wifi computers
                              10.100.30.0 is on VLAN30 for Nintendo Switches and other older wifi stuff that can't do RADIUS auth

                              If you click the link in the 4th post you can see a crude drawing of my network (I added the 3rd wifi network since my masterpiece)

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

                                @tknospdr said in Best topology for my network:

                                I don't understand this. You can't make a rule on a subnet regarding traffic on itself?

                                You can make the rule - but what would trigger it? As stated, traffic that is to something else on the same network never would go to pfsense.

                                Traffic is only sent to the router/gateway (pfsense) when the destination is not the local network.

                                The use of ! rules, while might be useful in some special use case. Are not normally needed, and are harder for humans to read. If you want a rule that allows something on eth3 to go anywhere it wants, then the clearer destination is ANY.. not ! Eth3 Net..

                                Also your more likely to run into some weirdness when doing such a rule - there have been issues in the past when VIPs are involved for example. Its best to be very explicit in your rules, allow/deny/reject with very specific and easy for human to understand at a glance.

                                If you want to do allow source eth3 net, destination !Eth3 Net. sure go ahead.. But since no traffic would be sent to pfsense anyway if the destination was eth3 net what is the point. You would also by that rule be blocking access to pfsense IPs on eth3 net.. Which you prob using for dns, ntp, or wanting to ping for connectivity check, etc.

                                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 24.11 | Lab VMs 2.7.2, 24.11

                                Austin 0A 1 Reply Last reply Reply Quote 0
                                • T
                                  tknospdr
                                  last edited by

                                  Okay, so there is an unwritten but implied 'deny all' rule on every subnet by default, right?

                                  If all I want to do is contain all packets generated on the network connected to ETH3 to that network, I would start with ZERO rules in place?

                                  VLANs traveling over ETH3 are distinct and their traffic should not affect or be affected by ETH3s FW entries, right? Seems self evident by them having their own entries on the FW page, but I'm not assuming anything at this point.

                                  Now, if I want devices on other networks to be able to talk with the devices on ETH3 I'd just create explicit ALLOW rules on ETH3 to let them in?

                                  I need to learn more about the traffic that HomeKit uses to communicate with it's home hubs so that I can create the correct rules to allow only that traffic.
                                  Are there any HomeKit recipes out there already? No, I have not googled it yet. I wanted to get this straight in my head first.

                                  johnpozJ S 2 Replies Last reply Reply Quote 0
                                  • Austin 0A
                                    Austin 0 @johnpoz
                                    last edited by

                                    @johnpoz said in Best topology for my network:

                                    If you want to do allow source eth3 net, destination !Eth3 Net. sure go ahead.. But since no traffic would be sent to pfsense anyway if the destination was eth3 net what is the point. You would also by that rule be blocking access to pfsense IPs on eth3 net.. Which you prob using for dns, ntp, or wanting to ping for connectivity check, etc.

                                    Would the firewall address not be in the same eth3 subnet? Now I am confused too lol.

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

                                      @Austin-0

                                      Yeah that was my point.. He would be blocking them if used a ! eth3 net rule, unless he had rules above at to allow what he wanted to allow first.

                                      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 24.11 | Lab VMs 2.7.2, 24.11

                                      Austin 0A 1 Reply Last reply Reply Quote 1
                                      • johnpozJ
                                        johnpoz LAYER 8 Global Moderator @tknospdr
                                        last edited by

                                        @tknospdr said in Best topology for my network:

                                        Now, if I want devices on other networks to be able to talk with the devices on ETH3 I'd just create explicit ALLOW rules on ETH3 to let them in?

                                        No.. Those rules would be put on the source interfaces.

                                        Rules are evaluated top down, first rule to trigger wins no other rules are evaluated. On the interface where it would first enter pfsense,.

                                        If you have something on LAN wanting to go to eth3 network - that traffic would enter pfsense on the LAN interface, so that is where you would place the rule to either allow or deny it.

                                        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 24.11 | Lab VMs 2.7.2, 24.11

                                        1 Reply Last reply Reply Quote 0
                                        • S
                                          SteveITS Galactic Empire @tknospdr
                                          last edited by

                                          @tknospdr said in Best topology for my network:

                                          there is an unwritten but implied 'deny all' rule on every subnet by default, right

                                          yes

                                          @tknospdr said in Best topology for my network:

                                          If all I want to do is contain all packets generated on the network connected to ETH3 to that network, I would start with ZERO rules in place

                                          sure

                                          @tknospdr said in Best topology for my network:

                                          VLANs traveling over ETH3 are distinct and their traffic should not affect or be affected by ETH3s FW entries, right

                                          right, VLANs have their own interface in pfSense.

                                          @tknospdr said in Best topology for my network:

                                          if I want devices on other networks to be able to talk with the devices on ETH3 I'd just create explicit ALLOW rules on ETH3 to let them in?

                                          no, you would create a rule on LAN, from source LAN Net to dest ETH3 Net.

                                          @Austin-0 said in Best topology for my network:

                                          Would the firewall address not be in the same eth3 subnet

                                          That one is but the pfSense LAN IP and WAN IP are not. (there is a This Firewall choice when creating a rule, for all of them)

                                          Pre-2.7.2/23.09: Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
                                          When upgrading, allow 10-15 minutes to restart, or more depending on packages and device speed.
                                          Upvote 👍 helpful posts!

                                          1 Reply Last reply Reply Quote 1
                                          • Austin 0A
                                            Austin 0 @johnpoz
                                            last edited by

                                            @johnpoz Okay I just misunderstood what you were saying. Thought I was going crazy there for a second.

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