Master CCNA

How to Master CCNA Ebook

 

 

My book will help you Master CCNA

Master CCNP SWITCH

How to master CCNP SWITCH ebook

 

 

My book will help you Master CCNP SWITCH

Master CCNP ROUTE

How to master CCNP ROUTE Ebook

 

 

My book will help you Master CCNP ROUTE

Print

BGP Regular Expressions

Written by Rene Molenaar on . Posted in BGP

{difficulty}3{/difficulty}

Scenario:

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.

Goal:

  • 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.

IOS:

none needed

Topology:

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:

http://www.bgp4.as/looking-glasses

Scroll to the bottom for the 'telnet' access route servers.

GNS3Vault Logo


Video Solution:

You need to a flashplayer enabled browser to view this YouTube video

Related Articles
Only registered users can write comments!

Comments (5)

  • avatar
    luismg

    Nice lab, tons of routes to play with

  • avatar
    aaronm007

    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)+$

  • avatar
    ReneMolenaar

    Hi Aaron,

    Thanks for sharing those 8) A little more complicated then the "default" stuff....excellent!

    Rene

  • avatar
    stemrikar

    here's a good site to be shared with u (which i use often) traceroute.org


    note:-
    looking glass(lg) are html based gui and
    route servers are the one which you can telnet access

  • avatar
    ReneMolenaar

    Thanks for sharing this. "Looking glass" servers are the best way to learn and practice regular expressions.