Block and Pass rule priority
-
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?
-
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:
- Block from LAN IP/s A,B,C.. to X,Y,Z…
- 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.
-
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?
-
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. -
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.
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 LoginPrivacy Policy · Cookie Policy