I got a clarification regarding implied rules. This is the more correct behaviour:
Implied rules are "attached" during install policy, to the relevant context.
The implied rules that are selected to appear "first", are added to the first ordered layer in the policy.
The implied rules that are selected to appear "before last" or "last", are added to all the layers.
Let’s consider examples below:
2 ordered layers:
*Accept icmp defined as ‘before last’
Example 1:
Layer 1:
- 1. Any any any drop
Layer 2:
- 1. Any any any drop
In above example all icmp connection will be matched on ‘accept icmp’ implied rule.
Example 2:
Layer 1:
- 1. Any any any drop
Layer 2:
- 1. src=10.0.0.1, Drop
- 2. Any any any drop
In above example ICMP packets from 10.0.0.1 will match implied rule on layer 1, but match explicit rule 1 on layer 2.
In addition, every layer has the "implicit cleanup rule" in its properties. For Pre-R80.10 Gateways, in every policy, the first layer must have its implicit cleanup rule set to "drop" and for the second ordered layer the implicit cleanup rule must be set to "accept". Usually, these are the defaults when creating policies and layers, so the admin doesn't have to worry about them, unless it is shown as the reason for his policy installation failure.