Regular expressions on IOS

Some play with IOS command line and regular expressions:

1. showing of every line from running-configuration which inculdes IP address:

sh run | inc [0-9].[0-9].[0-9].[0-9]

2.showing of only “one as long” paths from bgp table:

sh ip bgp quote-regexp ^[0-9]*$

3. showing of “one as long” and 4-digit as paths from bgp table

sh ip bgp quote-regexp ^[0-9][0-9][0-9][0-9]$

4. showing of INPUT access-list from running-configuration

sh run | beg ^ip.*INPUT$

Leave a Reply