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

Rule precedence between interface and group

Scheduled Pinned Locked Moved 2.0-RC Snapshot Feedback and Problems - RETIRED
6 Posts 4 Posters 3.5k 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.
  • C
    clarknova
    last edited by Aug 20, 2011, 7:08 AM

    2.0-RC3

    If interface A is a member of interface group 1, my last firewall rule on group 1 says "reject all from subnet A" and the first rule on interface 1 says "pass all from host A1", will traffic from host A1 get passed or rejected?

    db

    1 Reply Last reply Reply Quote 0
    • M
      Metu69salemi
      last edited by Aug 20, 2011, 1:37 PM

      Rules work on ingress and top-to-down order.
      first matching rule gives the order where the packet goes, if no suitable rules are found -> implicit deny

      So answer in short: First rules pass everything and last denies, everything goes out. Unless subnets A and A1 differs some how.

      1 Reply Last reply Reply Quote 0
      • C
        clarknova
        last edited by Aug 21, 2011, 4:45 AM

        Your response is correct within the context of a single interface, but doesn't answer the question that I was trying to ask.

        It is possible in 2.0 to create an interface group, composed of one or more interfaces on the firewall. This interface group then appears as its own interface in the firewall rules section, and rules can be created on that group. My question was what if I create a rule in an interface group, then a conflicting rule on an interface that is a member of the same group. Which rule will take precedence?

        The answer, after limited experimentation, appears to be that the rule on the group page will take precedence over a conflicting rule on the page of a member interface.

        db

        1 Reply Last reply Reply Quote 0
        • M
          Metu69salemi
          last edited by Aug 21, 2011, 10:10 AM

          What happens when group has no rule for something and interface itself has a rule, does pfsense work this cases in this order

          1. Group rule check
          2. Interface rule check
          1 Reply Last reply Reply Quote 0
          • S
            stephenw10 Netgate Administrator
            last edited by Aug 21, 2011, 12:35 PM

            @clarknova:

            The answer, after limited experimentation, appears to be that the rule on the group page will take precedence over a conflicting rule on the page of a member interface.

            This would seem to make sense. If you applied a rule to a group and it could be overridden by an interface rule you would have to check all you interface rules to make sure it didn't happen. If you have a lot of interfaces, when groups are really useful, that would be a PITA!
            This should be added to the wiki page.

            Now, what about floating rules?  ;)

            Steve

            1 Reply Last reply Reply Quote 0
            • J
              jimp Rebel Alliance Developer Netgate
              last edited by Aug 23, 2011, 4:20 PM

              Would have been easier to look in /tmp/rules.debug to see the actual order of the rules :-)

              Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

              Need help fast? Netgate Global Support!

              Do not Chat/PM for help!

              1 Reply Last reply Reply Quote 0
              6 out of 6
              • First post
                6/6
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                This community forum collects and processes your personal information.
                consent.not_received