Re: need clarrification on BGP Regular expressions

From: Jason Madsen (madsen.jason@gmail.com)
Date: Mon Dec 29 2008 - 20:56:20 ARST


yep, as Shiran stated it represents a space. the underscore can mean a lot
of different things though in some circumstances. take a look in the doc
cd at the locations I mentioned earlier. it can mean the beginning of an
AS path, the end of one, a space in between AS numbers etc.

in your example below your regex would match routes originated in AS 4 or
routes originated in 1 AS away (with any AS number) from AS 4 also. AS 4 is
required to be directly connected to your AS in both cases though.

it would match the following:

show ip bgp

x.x.x.x x.x.x.x 4
x.x.x.x x.x.x.x 4 5
x.x.x.x x.x.x.x 4 55
x.x.x.x x.x.x.x 4 555
x.x.x.x x.x.x.x 4 1534
etc etc.

Jason

On Mon, Dec 29, 2008 at 2:49 PM, ccie preparation <ccie22@gmail.com> wrote:

> Jason,
> Many thanks! you are awesome!
> More more clarrification.
>
> ^4_[0-9]*$
>
> In this what does the "_" mean?
>
> Thanks,
> Atul
>
> On Mon, Dec 29, 2008 at 12:44 PM, Jason Madsen <madsen.jason@gmail.com>
> wrote:
> > Hi Atul,
> >
> > It appears you answered your own question...or at least the answer to
> your
> > question was in your email. _100$ defines / matches any routes that were
> > orginated / advertised in AS 100 (e.g. 300 200 100). ^100.* defines /
> > matches routes that passed through AS 100 to yours (e.g. 100 200 300); AS
> > 100 is directly connected to yours. Actually, because of the .* It
> would
> > be any directly connected AS that begins with the number 100 e.g. 1000,
> > 1001, 1002, 100.
> >
> > show ip bgp will show you what routes, if any, you're learning via BGP.
> It
> > will also show you what AS the routes were originated in and traversed
> > through to get to your AS. The AS number listed all the way to the right
> is
> > the originating AS (xxx$). The AS all the way to the left is the
> neighbor
> > AS that your AS is connected to and is receiving routes from (^xxx).
> >
> > Try setting up a BGP scenario in which you have multiple AS's, advertise
> > routes in each of them, and then do a show ip bgp and also play around
> with
> > various show ip bgp regex xxx commands, where "xxx" is replaced with a
> > regular expression. There are at least a couple of places in the Doc CD
> > that discuss regex. Here are a couple:
> >
> > IOS --> 12.4 --> Terminal Services --> Appendixes --> Regular Expressions
> > IOS --> 12.4 --> Config Fundamentals --> Understanding the CLI -->
> Regular
> > Expressions
> >
> > Jason
> >
> > On Mon, Dec 29, 2008 at 1:09 PM, ccie preparation <ccie22@gmail.com>
> wrote:
> >>
> >> Folks,
> >> Can someone tell me the difference between the two.
> >>
> >> _100$This expression indicates an origin of AS100.
> >>
> >> ^100 .*This expression indicates transmission from AS100.
> >>
> >> Thanks,
> >> Atul
> >>
> >>
> >> Blogs and organic groups at http://www.ccie.net
> >>
> >> _______________________________________________________________________
> >> Subscription information may be found at:
> >> http://www.groupstudy.com/list/CCIELab.html

Blogs and organic groups at http://www.ccie.net



This archive was generated by hypermail 2.1.4 : Thu Jan 01 2009 - 12:53:10 ARST