RE: BGP Reg Exp

From: simon hart (simon@harttel.com)
Date: Sun Sep 18 2005 - 13:16:41 GMT-3


The Reg Exp you are probably looking for is

^123(_[0-9]+)?$

Which transpires as

^ begins with 123

()? anything within the brackets can occur either no times or once

()?$ so now it will end with either 0 occurrence within the bracket or one
occurrence

[0-9)+ match 1 or more sequence of the numbers 0 to 9

Thus ^123(_[0-9]+)?$ will give you the directly attached AS and there
directly attached clients

A tip for when you doing the lab. The Doc CD has a section regular
expressions within the configuration guide, Part 1 Cisco IOS User Guide,
Using the Command-Line Interface

http://www.cisco.com/univercd/cc/td/doc/product/software/ios122/122cgcr/ffun
_c/ffcprt1/fcf001.htm#1002051

HTH Simon

-----Original Message-----
From: nobody@groupstudy.com [mailto:nobody@groupstudy.com]On Behalf Of
Leigh Harrison
Sent: 18 September 2005 08:40
To: Cisco certification
Subject: BGP Reg Exp

All,

If I wanted to allow a neighboring AS(123) and his directly connected
AS's to be seen as routes to me, could this be written as:

ip as-path access-list 1 permit ^123_[0-9]*$
OR
ip as-path access-list 1 permit ^123_.*$
OR
ip as-path access-list 1 permit ^.+_[0-9]*$
OR
ip as-path access-list 1 permit ^.+_.*$
OR
ip as-path access-list 1 permit ^[0-9]+_[0-9]*$
OR
ip as-path access-list 1 permit ^[0-9]+_.*$

Could someone have a quick look and let me know if that would be the
same thing ? I think I'm getting there!! The only niggle in the back
of my mind is ^123_.*$ (for example), would I need a "+" after the 123 ?

Many thanks,
LH



This archive was generated by hypermail 2.1.4 : Sun Oct 02 2005 - 14:40:15 GMT-3