Putting It All Together: A Complex Example

 

The real power of regular expressions comes into play when the metacharacters are used in combination to match some complex string of literals. Consider the following filter:

  ip as-path access-list 10 permit ^(550)+_[8802304]?_1805_.*  

This filter looks for AS_PATHs in which the last AS before the route was received was 550. The caret preceding that number specifies that 550 is the first number in the list. The plus sign following the number means that there must be at least one instance of 550, but there can be more. By allowing for more than one instance of the number, the filter has allowed for the possibility that AS 550 is practicing path prepending, as discussed in Chapter 3, "Configuring and Troubleshooting Border Gateway Protocol 4."

Following the one or more instances of 550, there may or may not be a single instance of either 880 or 2304. Next, there must be a single instance of 1805. The last part of the expression specifies that after 1805, the AS_PATH can consist of any number of subsequent AS numbers , including none.



Routing TCP[s]IP (Vol. 22001)
Routing TCP[s]IP (Vol. 22001)
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 182

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net