traffic-filter Application and Matching Order
Key Takeaways
- Apply packet filtering on Huawei interfaces with traffic-filter inbound|outbound acl <number|name> under interface view.
- Inbound filters traffic as it enters the interface; outbound filters traffic as it leaves—wrong direction is a top exam failure mode.
- Matching order is top-down by rule ID: first match wins; unmatched packets on a filter ACL are treated as implicitly denied.
- Place ACLs on the correct device and interface relative to the traffic path; a perfect ACL on the wrong interface does nothing useful.
- Verify with display acl and interface configuration checks; hit counts and display current-configuration confirm the filter is active.
traffic-filter Application and Matching Order
Quick Answer: Create the ACL first, then under interface view apply
traffic-filter inbound acl <id>ortraffic-filter outbound acl <id>. Traffic is checked against rules from lowest rule ID upward; first match wins. Packets that match no rule are implicitly denied when the ACL is used as a packet filter. Direction and attachment point matter as much as the rule text.
Writing a correct ACL is only half the job. HCIA-Datacom tests whether you can attach that ACL so it sees the intended packets, whether you understand inbound vs outbound, and whether you can predict outcomes when multiple rules exist. This section is pure operational skill: apply, order, direction, and verify.
The application command family
On Huawei VRP, interface packet filtering commonly uses traffic-filter:
[Huawei] interface GigabitEthernet0/0/1
[Huawei-GigabitEthernet0/0/1] traffic-filter inbound acl 3000
or outbound:
[Huawei-GigabitEthernet0/0/1] traffic-filter outbound acl 2000
| Piece | Meaning |
|---|---|
traffic-filter | Apply an ACL as a packet filter on this interface |
inbound | Inspect packets entering the interface from the wire/VLAN |
outbound | Inspect packets leaving the interface toward the wire/VLAN |
acl <number> | Which ACL object supplies the rules |
Cisco mental models use ip access-group … in/out. On the exam, prefer the Huawei form traffic-filter inbound|outbound acl …. Distractors that look like IOS access-group wording are wrong for VRP.
Remove a filter with the undo pattern in the same view:
[Huawei-GigabitEthernet0/0/1] undo traffic-filter inbound acl 3000
(Exact undo syntax can include the same direction and ACL identity you applied—match what you configured.)
Inbound vs outbound: draw the arrow
Direction is relative to the interface, not relative to “the user” in the abstract.
| Direction | When the ACL evaluates | Typical design use |
|---|---|---|
| Inbound | Packets arrive on the interface and are considered for entry into the device’s forwarding logic | Block unwanted traffic as early as possible at the edge |
| Outbound | Packets are about to leave via the interface | Restrict what the device sends toward a segment |
Worked scenario A — block a bad source entering a WAN edge
Router R1, interface GE0/0/0 faces the untrusted WAN. You want to drop packets from 198.51.100.50 as soon as they hit the WAN interface.
- ACL 2000:
rule 5 deny source 198.51.100.50 0then appropriate permits for the rest of your policy. - Apply
traffic-filter inbound acl 2000on GE0/0/0.
Why inbound? The bad packets are entering GE0/0/0 from the WAN. Outbound on that interface would examine traffic leaving toward the WAN, which is the opposite direction.
Worked scenario B — prevent internal servers from initiating to a guest VLAN
Interface VLANIF40 is the gateway for guest users. You want to stop certain server subnets from sending traffic out toward guests.
Applying a filter outbound on VLANIF40 examines packets the router/switch is emitting into VLAN 40. Applying inbound on VLANIF40 examines traffic coming from guests into the device. Those are different security goals. Always restate: “Am I filtering packets that arrive here, or packets that leave here?”
Worked scenario C — filter on the wrong device
ACL 3001 perfectly describes “users in 10.10.10.0/24 may only reach TCP 443 on 10.20.20.10.” You apply it inbound on a core interface that never carries that flow because users are routed via a different path. Result: zero effect (or you filter unrelated traffic). HCIA items sometimes include a small topology; pick the interface that actually sees the path in the stated direction.
Matching order in depth
When a packet hits an interface with an applied ACL:
- Device selects the ACL bound for that direction.
- Rules are checked in ascending rule-id order (top-down list order).
- First match returns permit or deny and stops.
- No match → implicit deny for traffic-filter style packet filtering (standard HCIA teaching).
Implications for design
| Design rule | Reason |
|---|---|
| Specific denies/permits before broad ones | Broad early match shadows later rules |
Explicit permit for traffic you need | Implicit deny drops the rest |
| Avoid “permit any” at the top for security ACLs | Everything matches and lower denies never run |
| Log/monitor carefully in labs | Hit counters prove which rule fires |
Example ACL 3002 applied inbound:
rule 5 permit tcp destination-port eq 22
rule 10 deny tcp destination-port eq 23
rule 15 permit ip
- SSH (TCP 22) matches rule 5 → permitted.
- Telnet (TCP 23) matches rule 10 → denied.
- HTTPS (TCP 443) skips 5 and 10, matches rule 15 → permitted.
- If rule 15 were missing, HTTPS would hit implicit deny and drop—even though no deny mentioned 443.
That last bullet is an exam favorite: students look for an explicit deny and miss the implicit deny at the end.
Where to place the ACL: source vs destination thinking
Industry lore says “place extended ACLs close to the source” and “standard ACLs close to the destination.” Translate that to Huawei terms:
| ACL type | Prefer placement | Why |
|---|---|---|
| Advanced (rich match) | Closer to source of unwanted traffic when possible | Stops wasteful transit early; you can match dest/port precisely |
| Basic (source only) | Closer to destination you protect | Basic ACL cannot say “only when going to this server,” so applying too near the source may block the source from everywhere |
Example: basic ACL denies source 10.1.1.0/24. If applied inbound on the users’ access gateway toward the whole campus, users lose all destinations. If the goal is only to protect a single data-center segment, apply nearer that segment (or upgrade to an advanced ACL that includes destination).
Interaction with routing and interface state
- An ACL does not replace routing. Packets must still have a valid FIB path; the filter only adds a permit/deny gate on a specific interface direction.
- Admin-down interfaces do not pass traffic; troubleshooting “ACL broken” sometimes is simply
shutdown. - Applying filters on SVI/VLANIF interfaces is common for inter-VLAN controls on Layer 3 switches—same inbound/outbound logic relative to the VLANIF.
- Some platforms support ACL application in other features (NAT, QoS). Those are not always drop filters.
nat outbound 2000means “use ACL 2000 to select interesting traffic for NAT,” not “deny unmatched.” Keep feature context straight on multi-topic questions.
Configuration sequence that avoids self-lockout
When filtering remote management paths:
- Prefer console access while editing.
- Write the ACL offline in a notepad: specific permits for your management source first.
- Create the ACL on the device.
- Apply
traffic-filtercarefully on the correct direction. - Test from the management host immediately.
saveonly after validation.
A common outage pattern: deny ip or implicit deny without permitting the engineer’s SSH source, applied inbound on the only path to the device. Prevention is explicit management permits and out-of-band console.
Verification and troubleshooting checklist
[Huawei] display acl 3000
[Huawei] display current-configuration interface GigabitEthernet0/0/1
[Huawei] display traffic-filter applied-record
(Exact support for applied-record style commands can vary by platform/version; conceptually you must confirm binding, direction, and rule hits.)
Troubleshooting table:
| Symptom | Likely cause |
|---|---|
| No effect | ACL not applied, wrong interface, or traffic takes another path |
| Everything drops | Missing permits; implicit deny; overly broad early deny |
| Specific deny never triggers | Earlier permit matches first |
| Wrong hosts blocked | Wildcard error or basic ACL too close to source |
| Works one way only | Direction inverted (in vs out) |
| Intermittent | Multiple paths; only one path filtered |
Always re-read the topology: which interface, which way is the packet moving, which rule matches first.
Side-by-side: build → apply → match
| Step | Example |
|---|---|
| Create advanced ACL | acl 3000 + rules |
| Enter interface | interface GE0/0/1 |
| Apply | traffic-filter inbound acl 3000 |
| Verify rules | display acl 3000 |
| Verify binding | interface section of display current-configuration |
| Test | generate traffic; observe permit/deny and counters |
Exam traps
- Using Cisco
ip access-groupsyntax instead oftraffic-filter. - Choosing outbound when the stem describes traffic entering the interface (or the reverse).
- Believing unmatched packets are permitted by default on a filter ACL.
- Assuming all rules are evaluated and the “best” match wins—first match wins only.
- Applying a correct ACL on an interface that never sees the flow.
- Confusing NAT ACL interest matching with traffic-filter drop behavior.
Mini lab script (mental)
- Host A 192.168.1.10 must reach Server 192.168.2.10 TCP 80 only.
- ACL 3005: permit tcp from A’s subnet to server port 80; deny other IP from that subnet (or rely on implicit deny after a single permit if policy is that tight).
- Apply inbound on the interface facing Host A or outbound on the interface facing the server—both can work if they see the flow; pick the design that matches the question’s diagram.
- Predict: TCP 80 succeeds; TCP 22 fails; ICMP fails unless permitted.
If you can narrate direction, first match, and implicit deny for that lab without hesitation, you are exam-ready for traffic-filter items.
Which Huawei VRP command applies an ACL to filter inbound traffic on an interface?
If an inbound traffic-filter applies an ACL and no rule matches a packet, what happens by default in standard HCIA packet-filter teaching?
WAN interface GE0/0/0 receives attack traffic from the Internet that should be dropped as it enters the router. Which application is correct?
ACL 3000 has rule 5 permit ip and rule 10 deny tcp destination-port eq 23. Telnet traffic hits the interface with this ACL applied. What is the result?