CCIE Pursuit Blog

March 27, 2008

Cool Command 2: Verify Your BGP Regular Expressions

Here’s a great command for verifying (or just practicing) your BGP regular expression filters.  In the example below, I want to only see the routes where AS54 is the last AS in the AS path*.  I’m pretty sure that my regular expression is correct, but I want to verify it by running it against my BGP database.

Here’s the full BGP database:

r6(config)#do sh ip bgp | b Netw
   Network          Next Hop            Metric LocPrf Weight Path
*> 28.119.16.0/24   204.12.1.254             0             0 54 i
*> 28.119.17.0/24   204.12.1.254             0             0 54 i
*> 112.0.0.0        54.1.3.254               0             0 54 50 60 i
*> 113.0.0.0        54.1.3.254               0             0 54 50 60 i
*> 114.0.0.0        54.1.3.254               0             0 54 i
*> 115.0.0.0        54.1.3.254               0             0 54 i
*> 116.0.0.0        54.1.3.254               0             0 54 i
*> 117.0.0.0        54.1.3.254               0             0 54 i
*> 118.0.0.0        54.1.3.254               0             0 54 i
*> 119.0.0.0        54.1.3.254               0             0 54 i
*> 205.90.31.0      204.12.1.3                             0 200 254 ?
*> 220.20.3.0       204.12.1.3                             0 200 254 ?
*> 222.22.2.0       204.12.1.3                             0 200 254 ?

Here’s the results of filtering with ^54_ :

r6(config)#do sh ip bgp regex ^54_
BGP table version is 14, local router ID is 150.1.6.6
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
*> 28.119.16.0/24   204.12.1.254             0             0 54 i
*> 28.119.17.0/24   204.12.1.254             0             0 54 i
*> 112.0.0.0        54.1.3.254               0             0 54 50 60 i
*> 113.0.0.0        54.1.3.254               0             0 54 50 60 i
*> 114.0.0.0        54.1.3.254               0             0 54 i
*> 115.0.0.0        54.1.3.254               0             0 54 i
*> 116.0.0.0        54.1.3.254               0             0 54 i
*> 117.0.0.0        54.1.3.254               0             0 54 i
*> 118.0.0.0        54.1.3.254               0             0 54 i
*> 119.0.0.0        54.1.3.254               0             0 54 i

show ip bgp regexp

*Thanks to apep for the correction.  See comment section for details.

Question Of The Day: 27 March, 2008

Topic: Route Redistribution

The network admin on r1 is tasked with redistributing the EIGRP routes into RIP so that they appear in the routing table of the directly connected router r3 (running RIP only).  Here are the EIGRP routes currently in r1’s routing table:

r1#sh ip route eigrp
     2.0.0.0/32 is subnetted, 1 subnets
D       2.2.2.2 [90/2297856] via 10.1.12.2, 00:07:44, Serial1/0.12
     22.0.0.0/32 is subnetted, 1 subnets
D EX    22.2.2.2 [170/2560512256] via 10.1.12.2, 00:07:44, Serial1/0.12

Here is the configuration on r1:

router rip
 version 2
 redistribute eigrp 100 metric 2 route-map EIGRP->RIP
 passive-interface default
 no passive-interface Serial1/0.13
 network 10.0.0.0
 network 13.0.0.0
 default-metric 4
 no auto-summary
!
route-map EIGRP->RIP permit 10
 set metric 6

On r3, what will be the metric of the redistributed EIGRP routes?  What will be the metric of the locally generated RIP routes (i.e. 13.13.13.13/32)?

I’ll post the answer tomorrow.


Yesterday’s Question

 Question Of The Day: 26 March, 2008 

Topic: Route Redistribution 

r1 is running EIGRP and RIP:

r1#sh ip proto sum
Index Process Name
0     connected
1     static
2     eigrp 100
3     rip

r1 has the following EIGRP routes:

r1#sh ip route eigrp
     2.0.0.0/32 is subnetted, 1 subnets
D       2.2.2.2 [90/2297856] via 10.1.12.2, 00:01:06, Serial1/0.12
     22.0.0.0/32 is subnetted, 1 subnets
D EX    22.2.2.2 [170/2560512256] via 10.1.12.2, 00:00:23, Serial1/0.12

r1’s network admin wants to redistribute the EIGRP routes and pass them on to r3 in the RIP domain (directly connected to r1).  Here is his configuration:

r1(config)#route-map EIGRP->RIP perm 10
r1(config-route-map)#match route-type external
r1(config-route-map)#set tag 1170
r1(config-route-map)#route-map EIGRP->RIP perm 20
r1(config-route-map)#set tag 190
r1(config-route-map)#router rip
r1(config-router)#redistribute eigrp 100 route-map EIGRP->RIP

Which EIGRP routes will appear in r3’s (RIP) routing table?

Answer: NONE

RIP routes on r3 do not include the routes redistributed from EIGRP on r1: 

r3#sh ip route rip
     10.0.0.0/24 is subnetted, 2 subnets
R       10.1.12.0 [120/1] via 10.1.13.1, 00:00:22, Serial1/0
     13.0.0.0/32 is subnetted, 1 subnets
R       13.13.13.13 [120/1] via 10.1.13.1, 00:00:22, Serial1/0

When redistributing routes into RIP you must specify a default metric:

r1(config)#router rip
r1(config-router)#redistribute eigrp 100 metric 3route-map EIGRP->RIP

Now we should see the EIGRP routes in r3’s routing table with a metric of 3:

r3#sh ip route rip
     2.0.0.0/32 is subnetted, 1 subnets
R       2.2.2.2 [120/3] via 10.1.13.1, 00:00:19, Serial1/0
     22.0.0.0/32 is subnetted, 1 subnets
R       22.2.2.2 [120/3] via 10.1.13.1, 00:00:19, Serial1/0
     10.0.0.0/24 is subnetted, 2 subnets
R       10.1.12.0 [120/1] via 10.1.13.1, 00:00:19, Serial1/0
     12.0.0.0/32 is subnetted, 1 subnets
R       12.12.12.12 [120/3] via 10.1.13.1, 00:00:19, Serial1/0
     13.0.0.0/32 is subnetted, 1 subnets
R       13.13.13.13 [120/1] via 10.1.13.1, 00:00:19, Serial1/0

It’s pretty easy to forget the metric as the IOS will not throw an error.  You are basically redistributing the EIGRP routes with a metric of zero.  🙂

Create a free website or blog at WordPress.com.