Hi Guys,
I have a question about the correct ordering the rule set. I have an Firewall running in bridged mode with two interfaces. I started to order my old unsorted rules like the following criteria:
1. interface ('on igb0')
2. direction ('in', 'out')
3. address family ('inet' or 'inet6')
4. protocol ('proto tcp')
5. source address ('from 10.1.2.3')
6. source port ('from port < 1024')
7. destination address ('to 10.2.3.4')
8. destination port ('to port 80')
Here is a little example how it looks like in the pf.conf with some output omitted:
I let the default option "ruleset-optimization basic" turned on. When I check the "optimized" rule set with
I get something like this:
So at the end are the rules which pass in on igb0 and igb1 with protocol udp and icmp. I expect that these rules should have followed after line 2 like described in the rule evaluation.
Do I something wrong or is there an error in reasoning? Maybe someone have an idea.
I have a question about the correct ordering the rule set. I have an Firewall running in bridged mode with two interfaces. I started to order my old unsorted rules like the following criteria:
1. interface ('on igb0')
2. direction ('in', 'out')
3. address family ('inet' or 'inet6')
4. protocol ('proto tcp')
5. source address ('from 10.1.2.3')
6. source port ('from port < 1024')
7. destination address ('to 10.2.3.4')
8. destination port ('to port 80')
Here is a little example how it looks like in the pf.conf with some output omitted:
Code:
pass in quick on igb0 inet proto tcp
pass in quick on igb0 inet proto tcp
pass in quick on igb0 inet proto tcp
pass in quick on igb0 inet proto udp
pass in quick on igb0 inet proto udp
pass in quick on igb0 inet proto icmp
pass in quick on igb0 inet proto tcp
pass in quick on igb1 inet proto tcp
pass in quick on igb1 inet proto udp
pass in quick on igb1 inet proto udp
pass out quick on bridge0 inet proto tcp
pass out quick on bridge0 inet proto tcp
pass out quick on bridge0 inet proto tcp
pass out quick on bridge0 inet proto udp
pass out quick on bridge0 inet proto udp
pass out quick on bridge0 inet proto icmp
I let the default option "ruleset-optimization basic" turned on. When I check the "optimized" rule set with
Code:
pfctl -vnf
Code:
1 pass in quick on igb0 inet proto tcp
2 pass in quick on igb0 inet proto tcp
3 pass out quick on bridge0 inet proto tcp
4 pass out quick on bridge0 inet proto tcp
[B]5 pass in quick on igb0 inet proto udp
6 pass in quick on igb0 inet proto icmp
7 pass in quick on igb1 inet proto udp
8 pass in quick on igb1 proto icmp[/B]
So at the end are the rules which pass in on igb0 and igb1 with protocol udp and icmp. I expect that these rules should have followed after line 2 like described in the rule evaluation.
Do I something wrong or is there an error in reasoning? Maybe someone have an idea.