H12-821_V1.0 · Question #390
An administrator needs to create an AS Path filter (ipas-path-filter) to deny the route that contains 65001 in the AS Path, so which of the following configurations is correct?
The correct answer is D. ip as-path-filter 1 deny _65001_ip as-path-filter 1 permit .*. Option D is correct because _65001_ uses underscores on both sides, which in BGP AS-path regex act as word-boundary delimiters (matching a space, start-of-string, end-of-string, or comma) - this ensures AS 65001 is matched as a complete, standalone AS number anywhere in the…
Question
Options
- Aip as-path-filter 1 deny _65001^ip as-path-filter 1 permit.
- Bip as-path-filter 1 deny 65001_ ip as-path-filter 1 permit S
- Cip as-path-filter 1 deny^65001_ ip as-path-filter 1 permit
- Dip as-path-filter 1 deny _65001_ip as-path-filter 1 permit .*
How the community answered
(40 responses)- A18% (7)
- B8% (3)
- C3% (1)
- D73% (29)
Explanation
Option D is correct because _65001_ uses underscores on both sides, which in BGP AS-path regex act as word-boundary delimiters (matching a space, start-of-string, end-of-string, or comma) - this ensures AS 65001 is matched as a complete, standalone AS number anywhere in the path, and the second line permit .* (match any AS path) allows all other routes through.
Option A (_65001^) is wrong because ^ is the start-of-string anchor and is misplaced after the AS number, producing invalid/unintended regex.
Option B (65001_) is wrong because it lacks a leading underscore, so it would also match AS numbers that merely end in the digits "65001" (e.g., AS 165001), causing over-filtering.
Option C (^65001_) is wrong because ^ anchors the match to the beginning of the AS path, meaning it only denies routes where 65001 is the first AS - routes where 65001 appears in the middle or end of the path would slip through.
Memory tip: Think of _ as "whitespace/boundary" - wrapping an AS number in underscores (_65001_) is the BGP regex equivalent of a "whole word match," just like \b65001\b in standard regex; if you want to catch 65001 anywhere in the path, put a fence on both sides.
Topics
Community Discussion
No community discussion yet for this question.