HP-UX IPFilter Version A.03.05.14 Administrator's Guide
Firewall Building Concepts
Improving Performance with Rule Groups
Chapter 472
Improving Performance with Rule Groups
Rule groups allow you to write your ruleset in a tree structure, instead of
as a linear list, so that if an incoming packet is unrelated to a set of rules,
those rules will never be processed. This reduces IPFilter processing
time on each packet and improves IPFilter system performance.
The following is a simple rule group example:
block out quick on lan1 all head 10
pass out quick proto tcp from any to 20.20.20.64/26 port = 80
flags S keep state group 10
block out on lan2 all
In this example, if the packet is not destined for lan1, the head of rule
group 10 does not match; IPFilter does not process any of the rules in
group 10. Rules processing continues at the root level (group 0). If the
packet does match lan1, the quick keyword stops further processing at
the group 0 level. IPFilter then processes all rules in group 10 against
the packet.
Rule groups can be used to break up a complex firewall ruleset. For
example, there are three interfaces in the firewall with interfaces lan0,
lan1, and lan2.
• lan0 is connected to external network 20.20.20.0/26.
• lan1 is connected to DMZ network 20.20.20.64/26.
• lan2 is connected to protected network 20.20.20.128/25.
A complete ruleset for this situation would be complex and significantly
slow user connections to the network. To prevent this, a ruleset is created
with rule groups:
block in quick on lan0 all head 1
block in quick on lan0 from 192.168.0.0/16 to any group 1
block in quick on lan0 from 172.16.0.0/12 to any group 1
block in quick on lan0 from 10.0.0.0/8 to any group 1
block in quick on lan0 from 127.0.0.0/8 to any group 1
block in log quick on lan0 from 20.20.20.0/24 to any group 1
block in log quick on lan0 from any to 20.20.20.0/32 group 1
block in log quick on lan0 from any to 20.20.20.63/32 group 1
block in log quick on lan0 from any to 20.20.20.64/32 group 1
block in log quick on lan0 from any to 20.20.20.127/32 group 1
block in log quick on lan0 from any to 20.20.20.128/32 group 1