01-21-2025 11:18 PM
Hi i have to router A and B
Router A and B have same Asnumber
Router A is uplink Router B
In router A how used regexp ??
used show ip bgp regexp .
only show me ebgp prefixs doonot show my ibgp prefixs origin is router B
Solved! Go to Solution.
01-22-2025 08:28 AM
Locally originate Vs originate in AS
^$ Vs _ x $
I think this different' I will try both in lab
If I have time
Thanks
MHM
01-21-2025 11:22 PM - edited 01-22-2025 06:37 AM
This link not cover all cases
Thanks
MHM
01-22-2025 06:21 AM
Can I see show ip bgp
MHM
01-22-2025 12:35 AM
Hello @Ramin Malekghasemi
Try this command:
show ip bgp regexp _[0-9]+$
This command will show prefixes where the last AS is an external one (eBGP-learned prefixes).
01-22-2025 05:38 AM
test this only show me ebgp prefix
01-22-2025 01:28 AM
Hello
You could also try the below, this should show all prefixes with a populated as-path seq
sh ip bgp regexp .+
01-22-2025 05:39 AM
Test this too show only ebgp prefixes
01-22-2025 06:09 AM
Hi @Ramin Malekghasemi ,
If you only want to see prefixes originated in the local AS, you need to use the following command:
sh ip bgp regexp ^$
Regards,
01-22-2025 09:50 AM
Hell
that what you wanted wasn’t it-these if you want local routes then as stated by @Harold Ritter reg expression ^$ will show local routes
01-22-2025 06:36 AM
Use
_ x $
Where x is the AS of ibgp
MHM
01-22-2025 08:15 AM
Hi @MHM Cisco World ,
Bear in mind that the AS number is not inserted when the update is being sent to an iBGP neighbour, but rather when it is being sent to an eBGP neighbor. The command you are suggesting will therefore not show the prefixes originated by the local AS, unlike ^$ would.
Regards,
01-22-2025 08:28 AM
Locally originate Vs originate in AS
^$ Vs _ x $
I think this different' I will try both in lab
If I have time
Thanks
MHM
01-22-2025 08:38 AM - edited 01-22-2025 08:47 AM
Hi @MHM Cisco World ,
Whether a prefix is locally originated or by another router in the same AS, the local AS number will not show. The local AS number is only added to the AS path when the update is sent to a neighbor in a remote AS.
Regards,
01-22-2025 02:46 PM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide