REGULAR EXPRESSIONS  

Friday, November 14, 2008

and now completely a u turn topic for me .. regular expressions .. not covered extensively ... but the condition is that no routes with as-number 100 must be in router cust routing table .. this is done as below

i know only two things for now

^number$ -- must begin and end with that number

.* -- all of the values just like (permit any as we need to give it as this is based on access-list and implicit deny follows it )

CODE
as#2
[Resuming connection 2 to san ... ]

*Mar 1 02:55:42.083: %BGP-5-ADJCHANGE: neighbor 192.168.1.6 Down Peer closed th
sanjose#
sanjose#sib
BGP table version is 15, local router ID is 201.0.0.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path
*> 201.0.0.0 0.0.0.0 0 32768 i
*> 202.0.0.0 192.168.1.6 0 0 300 i
*> 203.0.0.0 192.168.1.6 0 300 65000 i
sanjose#
as#1
[Resuming connection 1 to isp ... ]

isp(config-router)#emd
^
% Invalid input detected at '^' marker.

isp(config-router)#end
isp#sib
BGP table version is 4, local router ID is 202.0.0.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path
*> 201.0.0.0 192.168.1.5 0 0 100 i
*> 202.0.0.0 0.0.0.0 0 32768 i
*> 203.0.0.0 172.24.1.18 0 0 65000 i
isp#
*Mar 1 03:06:44.479: %SYS-5-CONFIG_I: Configured from console by console
isp#

isp#sib
BGP table version is 4, local router ID is 202.0.0.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path
*> 201.0.0.0 192.168.1.5 0 0 100 i
*> 202.0.0.0 0.0.0.0 0 32768 i
*> 203.0.0.0 172.24.1.18 0 0 65000 i
isp#
as#3
[Resuming connection 3 to cust ... ]

cust#sib
BGP table version is 10, local router ID is 203.0.0.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path
*> 201.0.0.0 172.24.1.17 0 300 100 i
*> 202.0.0.0 172.24.1.17 0 0 300 i
*> 203.0.0.0 0.0.0.0 0 32768 i
cust#

cust#
as#1
[Resuming connection 1 to isp ... ]

isp#config t
Enter configuration commands, one per line. End with CNTL/Z.
isp(config)#ip as-path ?
access-list Specify an access list number

isp(config)#ip as-path access-list ?
<1-500> AS path access list number

isp(config)#ip as-path access-list 7 ?
deny Specify packets to reject
permit Specify packets to forward

isp(config)#ip as-path access-list 7 deny ^100$ ?
LINE

isp(config)#ip as-path access-list 7 deny ^100$
isp(config)#ip as-path access-list 7 permit .*
isp(config)#router bgp 300
isp(config-router)#neig 172.24.1.18 filter-list ?
<1-500> AS path access list

isp(config-router)#neig 172.24.1.18 filter-list 7 ?
in Filter incoming routes
out Filter outgoing routes

isp(config-router)#neig 172.24.1.18 filter-list 7 out
isp(config-router)#do cibs
isp(config-router)#

as#3
[Resuming connection 3 to cust ... ]

cust#cibs
cust#sib
BGP table version is 11, local router ID is 203.0.0.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path
*> 202.0.0.0 172.24.1.17 0 0 300 i -------------> no 100
*> 203.0.0.0 0.0.0.0 0 32768 i
cust#


this is lab bgp 2

catch you with bgp lab3 2mrw morning

Design by Blogger Buster | Distributed by Blogging Tips