Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Register
    • Login
    Introducing Netgate Nexus: Multi-Instance Management at Your Fingertips.

    Block and Pass rule priority

    Scheduled Pinned Locked Moved Firewalling
    5 Posts 3 Posters 2.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.
    • H
      Heli0s
      last edited by

      I understand that firewall rules are processed from the top down, however, what's the pass and block priority of the rules and does one override the other?

      For example, if I have two hosts on my network and I want to block Host A from accessing Host B, but be able to access everything else on the network, should I have a "Block A to B" rule first and THEN the "Allow A everywhere" or "Allow all everywhere" rule or vice versa?

      1 Reply Last reply
      Reply Quote 0
      • P
        phil.davis
        last edited by

        Rules are matched from the top down. So if you want to block a few things then allow the rest you would do like this:

        1. Block from LAN IP/s A,B,C.. to X,Y,Z…
        2. Allow lots of stuff

        The parameters in a packet (source IP, source port, destination IP, destination port...) are matched against each rule. The first rule to match with everything in the packet is applied.

        As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
        If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

        1 Reply Last reply
        Reply Quote 0
        • H
          Heli0s
          last edited by

          So if I want to stop a protocol from communicating on an interface (for example, TCP on LAN), I should make the top rule to block all TCP from any to any and then add the allow all any to any?

          1 Reply Last reply
          Reply Quote 0
          • P
            phil.davis
            last edited by

            Yes, in general put all the block rules first, then more general pass rules - that way you block all the bits and pieces you want to explicitly block, then let the rest through.
            If you have some complicated mix of IP addresses and ports to block and pass, then you have to think through the rule order.

            As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
            If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

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

              If you block any any tcp, not going to be much good allowing anything after that for tcp..  Now if you want to block say tcp 21 for ftp and then allow after that - this makes more sense.  But a any any block tcp pretty much going to to shut down everything - unles you want to say ping or udp through 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 26.07 | Lab VMs 2.9.1, 26.07.1

              1 Reply Last reply
              Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • First post
                Last post
              Copyright 2026 Rubicon Communications LLC (Netgate). All rights reserved.
              Privacy Policy · Cookie Policy