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

    Block traffic/No routing between LANs on pfSense

    Scheduled Pinned Locked Moved Routing and Multi WAN
    15 Posts 3 Posters 5.6k 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.
    • E
      Elrick75
      last edited by

      Thanks, aliases is created :)
      I disable bogon, sorry i was not aware about this, don't hesitate to advise if you find something strange into my setup.

      So i need to create just one Rules after with rfc1918 after ?
      Could you tell me in which tab does it be created ? in Floating tab, WAN, VLAN_MY_LAN, VLAN_DMZ or VLAN_WIFI?

      Coud you edit your rules to be sure to have all good parameters set properly ?

      42fbc24c-0fd8-4f24-b92f-f3b8bd9d7b0b-image.png

      Many Thanks.

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

        You create the rules on the interfaces you want.. Just making your setup look like a picture isn't the correct way.. The correct way is understanding what the rules are doing so you can determine what rules you need per your setup..

        You place the rules on the interface where the traffic would first enter pfsense.. If you don't want your 3 vlans to talk to each other than the block would need to be on all 3 of them..

        You could put rules on floating tab - but I highly suggest against that since you don't seem to understand basic concepts as of yet and rules placed there are for more complex uses.

        Rules are evaluated as traffic enters pfsense from that network, top down, first rule to trigger wins, no other rules are evaluated..

        So if you want to block opt1 from talking to lan, where do you think the "rules" would go..

        Also there is nothing in the rules I showed other than that info, if any special things had been set you would see the little gear symbol next to them.

        advancedrule.png

        Pretty much the rules as I posted them would go on EVERY interface.. Where you would just change out the test address, and test net for the interface you are putting them on. The rules are labeled as to what they specifically do.

        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.8, 24.11

        1 Reply Last reply Reply Quote 1
        • E
          Elrick75
          last edited by Elrick75

          Hello,

          I create one rule on VLAN_MY_LAN interface, but it doesn't seems good.
          I'm still able to ping VLAN_DMZ from VLAN_MY_LAN :(

          i try to add one rule on VLAN_DMZ and VLAN_WIFI, but it's remain the same.
          My setup is like this

          ff7ead0d-706d-4f2a-8ced-466e730035a9-image.png

          204e5ea0-70af-47a8-b501-47b3e8c96a58-image.png

          afcd26cf-59f0-4afd-9b15-88acbc239c4c-image.png

          9b03a471-d20b-49d3-8c16-e8bf4a9bd56f-image.png

          557671bd-5872-4656-bcbc-573dc45f06c5-image.png

          11bc67f9-3021-45b8-863a-2ae3c0f229b4-image.png

          What's wrong please ?

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

            That is because your block rule is UNDER an allow rule... Again rules are evaluated TOP DOWN, first rule to trigger wins.. So no your block rule would never trigger.

            wrongorder.png

            And not sure what you think that nat nat rule is suppose to do?

            And if you move the block to above your allow, then how would you talk to pfsense for dns..

            When designing your rules - just think about your destination and then look at it rule from the TOP down, which rule matches first? This is the rule that will be used, any rules below a rule that matches will not be evaluated.

            So I want to ping IP in dmz.. Lets walk down you rules.

            1st anti lock, nope dest is NOT your my lan address, nor is it to port 443 or 80, so skipped
            2nd rule anything from my lan net to anywhere - well dmz fall into any (*) and its ipv4, and dest is also any.. So up allowed and rule matches.

            no other rules looked at.. So yeah you can ping something in your dmz.

            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.8, 24.11

            1 Reply Last reply Reply Quote 1
            • E
              Elrick75
              last edited by Elrick75

              After change rule order, it works better.
              The most restricitive rules need to be on top, the other after, integrate for next time.

              My setup is like this:

              b44a7a1c-6949-4eaa-a022-1868f2a0a935-image.png
              c8fd6ee5-4f45-4e20-8c00-f89f3e5b14a9-image.png
              910cefa0-597b-4734-813a-367938f8f567-image.png

              About DNS, i'm still able to ping google from workstation in VLAN MY LAN or ping server in VLAN MY LAN from workstation in VLAN MY LAN.
              From my understanding, all gateway use DNS resolver to make it possible? that's why it's still working?

              I already created one rule in floating section, how these rules will be applied versus other rules in other LAN section ? does floating rule are upper than all other LAN section?

              859e717a-0d8c-43f7-aa1a-336d6aa8303f-image.png

              About Anti-Lockout Rule, it was present by default, i don't understand what does it do...
              It seems to allow all traffic to VLAN MY LAN on http/https, but i dunno why.
              Does it make sens to keep it?

              Many thanks for your help

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

                The antilock out rule makes sure you do not lock yourself out of the web gui.. or ssh so you can admin the firewall.

                From my understanding, all gateway use DNS resolver to make it possible? that's why it's still working?

                No that is not why is still working.. Look at your rules.. Your blocking all access to any rfc1918 address, if you correctly make the alias.. What is the IP your using for dns? If its pfsense IP say 192.168.1.1, then that rule wold block it.. So how would you ask pfsense for dns..

                Now maybe your client has the IP cached for google, so it didn't have to ask dns to know what IP to ping.. That would be my guess.

                And no you don't always put most restrictive on top.. It DEPENDS on what your wanting to do.. Again follow the order of the rules to figure out how they need to be ordered to do or block what your wanting to block or allow.

                As to floating those rules are evaluated before rules on your interface, but they may or may not be "quick" it is all documented. I suggest you read over how rules are evaluated.

                https://docs.netgate.com/pfsense/en/latest/firewall/firewall-rule-processing-order.html

                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.8, 24.11

                E 1 Reply Last reply Reply Quote 1
                • E
                  Elrick75 @johnpoz
                  last edited by

                  You are right...
                  With this rules, i'm not able to ping my own gateway when i am in VLAN_MY_LAN.
                  Even if all LANs was isolated, i was figuring that i would be able to ping each gateway when i was into this LAN...
                  Does i need to modify the reject rules related to be able to ping it ? or i need to create one more rules for it ?

                  For DNS, i have registered it in workstation IP setup, i add DNS IP manually, i think that why i was able to have DNS resolution without issue.

                  So i understand the rules that you added.
                  In Green, this rules allow you to ping the default gateway when you device is on the same lan, right ?
                  In Blue, this is to allow DNS request if a workstation is using the gateway as DNS in his IP setup, right ?

                  ed24ceb4-d93a-4aa2-8a83-e5688df6a66e-image.png

                  You put these rules before the rejected rules rfc1918 to be sure that they keep in count.
                  Could you tell me what is TEST address as Destination on both ? it's another alias ?
                  Is it possible to edit each rules to be sure to replicate it please ?

                  Best Regards.

                  1 Reply Last reply Reply Quote 0
                  • E
                    Elrick75
                    last edited by

                    Up, please advise :)

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

                      You are correct, and that is how they are labeled.

                      Green allows ping, which is labeled "Allow Ping Pfsense Address" even ;)

                      You put the rules above the rejected, because as I have stated multiple times rules are evaluate top down.. So yes if you want to ping it needs to be evaluated be a rule that says reject anything to any rfc1918 address ;)

                      There is nothing to replicate.. The info shown is exactly what you would need to set in the rule.. Don't touch anything else in the rule ;)

                      The Test address, is pfsense IP on the interface called Test.. in this case its 192.168.100.1 As to what test address or net are, those are the built in aliases for any interface you have on your pfsense. like lan net or lan address. So in my case address would be 192.168.100.1 and net would be 192.168.100.0/24

                      here
                      rulepng.png
                      interface.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 24.11 | Lab VMs 2.8, 24.11

                      1 Reply Last reply Reply Quote 1
                      • E
                        Elrick75
                        last edited by

                        Many thanks for your help, it works fine.
                        You help me a lots.

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