4A0-102 · Question #113
Which regular expression will match the AS Path of a route originating in remote AS 65100?
The correct answer is A. ".* 65100". Option A (". 65100") correctly matches a route originating in AS 65100 because, in BGP, the originating AS always appears last (rightmost) in the AS path - transit ASes prepend themselves to the left as the route propagates. The . matches any sequence of preceding transit AS…
Question
Options
- A".* 65100"
- B"65100+"
- C".*65100$"
- D"_65100"
How the community answered
(28 responses)- A79% (22)
- B11% (3)
- C4% (1)
- D7% (2)
Explanation
Option A (".* 65100") correctly matches a route originating in AS 65100 because, in BGP, the originating AS always appears last (rightmost) in the AS path - transit ASes prepend themselves to the left as the route propagates. The .* matches any sequence of preceding transit AS numbers, and 65100 (space + AS number) anchors the match to the final position, confirming AS 65100 as the origin.
B ("_65100_+") is wrong because the trailing _+ requires one or more delimiter characters after 65100, which means 65100 cannot be the last entry - this would only match 65100 as a transit AS, not the originator.
C (".*_65100_$") is wrong because the _ before $ demands an additional delimiter character after 65100, but nothing follows the originating AS at the end of the path, making the pattern either impossible to satisfy or logically redundant.
D ("_65100") is wrong because it lacks an end anchor, so it matches AS 65100 anywhere in the path - including when it's merely a transit AS - without confirming it's the origin.
Memory tip: "The originator is always last - match anything before it with .*, then the space and AS number at the tail."
Topics
Community Discussion
No community discussion yet for this question.