A rule has conditions and an action
Source and destination zone, source and destination address, service. A packet matches a rule when it meets every condition the rule has; a condition you leave out matches anything. The action, permit or deny, decides what happens. A rule without an action does nothing.
First match wins
Rules are checked from the top. The first one that matches decides, and the rest are not looked at. New rules go to the bottom, just above the default policy, so put specific rules above general ones, or move them with rule move.
Sessions
When a rule permits the first packet of a connection, the firewall records a session. Replies and the rest of that connection match the session and pass without another rule check. That is why you write rules for the direction a connection starts in.
Least privilege
Open the smallest thing that works: these zones, these addresses, these services. Each extra opening is something to defend later.
The lab’s VLANs
- VLAN 10: desks
- VLAN 20: Wi-Fi
- VLAN 30: storage
- VLAN 99: management
- VLAN 100: router to firewall
Commands in this mission
| Huawei VRP | What it does | Cisco IOS |
|---|
rule name desks_library | Create or enter a rule. | class-map type inspect match-all DESKS_LIB |
source-zone trust | Where the traffic comes from. | zone-pair security TRUST-DMZ source trust destination dmz |
source-address 192.168.10.0 24 | Match source addresses. | match access-group (ACL with the source) |
service http | Match a service. | match protocol http |
action permit | What a match does. | inspect (in the policy-map class) |
rule move exam_block before desks_library | Change the order. | reorder class lines in the policy-map |
display security-policy rule all hit-info | Rules in order, with hit counts. | show policy-map type inspect zone-pair |
display firewall session table | Current sessions. | show policy-map type inspect zone-pair sessions |
Coming from Cisco? The right-hand column is the nearest IOS equivalent.