As a trainee you are starting your network career at a big service provider. One of your tasks in the future will be to configure BGP connecting multiple AS’es to the service provider network. However you are still studying and BGP holds many secrets for you…one of them is how regular expressions work, time for some lab exercises!
This lab does not use GNS3 because I believe it’s more fun to use a looking glass server, you will find the URL of a public route server at the bottom of this article.
- Check out the URL at the bottom of this article, open it and scroll to the bottom. Find one of the public route servers and telnet into it.
- Use ‘show ip bgp’ just to take a look at some information in the routing table.
- See if you can create the following regular expressions to solve some questions, in this example I’m using AS 3491 but another AS you see with the ‘show ip bgp’ command is fine.
- Use the ‘show ip bgp regexp’ command to enter the regular expressions.
- Create a regular expression that only shows AS 3491.
- Create a regular expression that shows AS 3491 at the beginning, and everything behind it. For example:
3491 5423 5431 5434
- Create a regular expression that shows all networks that originate in AS 3491
- Create a regular expression that only shows the locally originated networks.
- Create a regular expression that shows everything where AS 3491 is in the middle of the AS-PATH.
- Create a regular expression that shows all networks that are originated by your directly connected AS neighbors.
It took me 1000s of hours reading books and doing labs, making mistakes over and over again until I mastered all the routing protocols for CCNP.
Would you like to be a master of routing too? In a short time without having to read 900 page books or google the answers to your questions and browsing through forums?
I collected all my knowledge and created a single ebook for you that has everything you need to know to become a master of routing.
You will learn all the secrets about BGP and more.
Does this sound interesting to you? Take a look here and let me show you how to Master CCNP ROUTE
Check out of the following link for “looking glass” servers, these are routers you can telnet into and use ‘show ip bgp’ commands to practice with:
Scroll to the bottom for the ‘telnet’ access route servers.
Configuration FilesYou need to register to download the GNS3 topology file. (Registration is free!)
Once you are logged in you will find the solution right here.
Nice lab, tons of routes to play with
Here is another couple of really cool tricks with BGP regular expressions I have discovered while scouring the internet for information on them.
The first is the quote-regexp command. This command allows you to take the output of a show ip bgp regexp and further filter it with include/exclude.
For example, if I want to to show all the networks originated by AS 555 (and the selected best next hops) I can use a command like:
show ip bgp quote-regexp “_555$” | inc (*__[0-9])|(*>)
The quoted regular expressions also allow you to use literal spaces instead of underscores. For example, this should give us the same result as above:
show ip bgp quote-regexp ” 555$” | inc (*__[0-9])|(*>)
Another cool trick is using the (1) operator to detect prepended AS paths. (1) matches the previously matched AS. For example, if I want to detect any AS paths that were prepended at least once, I can use:
show ip bgp regexp ([0-9]+)(_1)+$
Thanks for sharing those 8) A little more complicated then the “default” stuff….excellent!
here’s a good site to be shared with u (which i use often) traceroute.org
looking glass(lg) are html based gui and
route servers are the one which you can telnet access
Thanks for sharing this. "Looking glass" servers are the best way to learn and practice regular expressions.
About that regexp that shows everything where AS 3491 is in the middle of the AS-PATH… Your solution _3491_ also gives routes that begin with 3491 and the ones that are originated by 3491. I believe the solution should be [0-9]+_3491_[0-9]+ but I have a feeling there are maybe more elegant solutions.
Comments are closed.