Privileged EXEC
Show BGP routes by AS-path regular expression
show ip bgp regexp <regexp>
Lists the BGP routes whose AS path matches the regular expression, for example routes from or through one AS.
You want to see what one AS sends you, or test a regular expression before you use it in an as-path access-list.
Check the best path with show ip bgp <prefix>, and what you send with show bgp ipv4 unicast neighbors <peer> advertised-routes.
Privilege Privileged EXECState impact Read-onlyProduction Unknown
Field glossary
Important fields projected from persisted Command guidance.
Network, Next Hop, Metric, LocPrf, Weight, PathImportant persisted output field; use surrounding guidance for interpretation.
Used in these Topics
Each relation carries both placement role and operational semantic: verifies, configures, troubleshoots, collects evidence, changes state or general.
Evidence boundary
What this output can establish — and where you must not over-claim.
Does not prove those routes are installed in the RIB or advertised to peers, or that an as-path access-list using the same text behaves the same.
Check the best path with show ip bgp <prefix>, and what you send with show bgp ipv4 unicast neighbors <peer> advertised-routes.
Command guidance
Execution context
Privileged EXEC
Use when
You want to see what one AS sends you, or test a regular expression before you use it in an as-path access-list.
Important fields
Network, Next Hop, Metric, LocPrf, Weight, Path
Common problems
regex too broad (65 also matches 6500); forgetting _ for AS boundaries; large table makes the command slow
Operational impact
Read-only.
Technical context
Use _ to match an AS boundary: "_65001_" matches AS 65001 anywhere in the path, "^65001_" routes learned from AS 65001, "_65001$" routes originated by it. The command can take time on a full Internet table.