Pcornel
Browse topics
Options
Recent
Favorites
Command · Cisco IOS / IOS XE

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.

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.

Privilege Privileged EXECState impact Read-onlyProduction Unknown

Operational impact: Read-only.
Command detailsSafety model · family · platform · verification · bundle
PrivilegePrivileged EXEC
Execution contextPrivileged EXEC
State impactRead-only
Safe during productionUnknown
CategoryBGP
Evidence levelmixed
Primary DomainNetworking
Historical technical verificationNeeds verification dateCurrent command content requires review after a Git edit.
Family
PlatformCisco IOS / IOS XE
PrerequisitePrivileged EXEC
Output fields

Field glossary

Important fields projected from persisted Command guidance.

Network, Next Hop, Metric, LocPrf, Weight, Path

Important persisted output field; use surrounding guidance for interpretation.

Command → Topic semantics

Used in these Topics

Each relation carries both placement role and operational semantic: verifies, configures, troubleshoots, collects evidence, changes state or general.

DomainsNetworking

Find another Command

Reference enrichment

Evidence boundary

What this output can establish — and where you must not over-claim.

Proves

Shows which routes in the local BGP table have an AS path that matches the expression.

Does not prove

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.

Next check

Check the best path with show ip bgp <prefix>, and what you send with show bgp ipv4 unicast neighbors <peer> advertised-routes.

Depth when you need it

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.

Confirmation

Confirm action

Continue?