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

    firewall rules to block ports not working

    Scheduled Pinned Locked Moved Firewalling
    11 Posts 4 Posters 1.1k 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.
    • A
      akuma1x
      last edited by

      Off the top of my head, I don't see anything wrong with your rules.

      However, as a general rule of thumb, you want to position your BLOCK or DENY rules at the top of your rule list(s). Try that and see if it triggers. The way it is now, and I'm pretty sure you realize this, there is nothing getting "caught" by that block rule you've got in position 3.

      Jeff

      1 Reply Last reply Reply Quote 0
      • chpalmerC
        chpalmer
        last edited by

        Yes.. rules are parsed from the top down. Any rule that trumps another rule must be on top of that rule.

        Triggering snowflakes one by one..
        Intel(R) Core(TM) i5-4590T CPU @ 2.00GHz on an M400 WG box.

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

          Keep in mind that if there are existing states the rules are not evaluated.

          If you want to block something, you need to make sure you clear any states that would match up with you rules.

          Also can not tell what interface you have that rule on? Sure doesn't look like the normal lan, since I don't see the antilock out rule?

          You need to place rules on the interface where traffic would enter pfsense. Rules are evaluated top down, first rule to trigger wins, no other rules will be evaluated.

          If you are trying to place those rules in floating, you need to make sure you click quick on the rules and pick the correct interface for the direction your going to create the rule for (floating allows for inbound or outbound rules).

          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 0
          • T
            tl5k5
            last edited by

            If you'll look, the top two rules are deactivated.
            So the top, active rule is the blocking rule.

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

              I didn't say anything about those rules.. Block not working normally means it didn't match because it not setup correctly fort what your trying to block.. Or there is an existing state that is allowing it.

              Or its on the wrong interface, etc.

              Never in 11 some years of using pfsense have I ever see a block rule that didn't block what it was suppose to block ;) Be it my own setups, or any thread I can ever recall. If a block is not working, then there is a state allowing it. Or its not being evaluated for some reason.

              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

              T 2 Replies Last reply Reply Quote 0
              • T
                tl5k5 @johnpoz
                last edited by

                @johnpoz That last response was not directly for you, but for those others that are posting to put the "block/deny" at the top.
                Thanks for your help!

                1 Reply Last reply Reply Quote 0
                • T
                  tl5k5 @johnpoz
                  last edited by

                  @johnpoz BTW...someone on the proxmox forum said that pfsense will not block/deny within the same subnet. So if I try to block ports from systems within the network, it will not work. Only across other vlans/networks. Is this correct?

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

                    Yes - its not possible to block clients on the same network from talking to each other.. Why would a device on a network need to talk to the gateway to talk to its own network? You only need to talk to your gateway (pfsense) to get off your local network.

                    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

                    T 1 Reply Last reply Reply Quote 0
                    • T
                      tl5k5 @johnpoz
                      last edited by

                      @johnpoz Thank you

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

                        if you need to block devices on the same network from talking to each other.. If they are wireless you would do that on the AP, with isolation. Different makers users slightly different names, AP isolation, client isolation, etc.

                        For wired clients your switch would need to support what is normally called private vlans, which can prevent clients from talking to each other.

                        If you want to do it and your L2 infrastructure doesn't support it, then you would normally split devices you don't want talking to each other into different vlans, so their traffic between each other would have to be routed (through pfsense) now you can filter it..

                        Other option is using host firewall on each device to block traffic you don't want to allow between hosts.

                        There are many ways to skin a cat, but no pfsense has no control over devices on the same L2 from talking to each other.

                        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
                        • First post
                          Last post
                        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.