BGP Regular Expressions

Been hearing about the command "show ip bgp regexp" but never really put it to use at work. I think its time I use this command to filter out learned bgp routes. I got these tables from the Internetwork Expert Blog I like to read. Time to put this into good use by beginning to use the basics first before proceeding to much advance filtering.

+------------------------------------------------------+
| CHAR | USAGE |
+------------------------------------------------------|
| ^ | Start of string |
|------|-----------------------------------------------|
| $ | End of string |
|------|-----------------------------------------------|
| [] | Range of characters |
|------|-----------------------------------------------|
| - | Used to specify range ( i.e. [0-9] ) |
|------|-----------------------------------------------|
| ( ) | Logical grouping |
|------|-----------------------------------------------|
| . | Any single character |
|------|-----------------------------------------------|
| * | Zero or more instances |
|------|-----------------------------------------------|
| + | One or more instance |
|------|-----------------------------------------------|
| ? | Zero or one instance |
|------|-----------------------------------------------|
| _ | Comma, open or close brace, open or close |
| | parentheses, start or end of string, or space |
+------------------------------------------------------+

+-------------+---------------------------+
| Expression | Meaning |
|-------------+---------------------------|
| .* | Anything |
|-------------+---------------------------|
| ^$ | Locally originated routes |
|-------------+---------------------------|
| ^100_ | Learned from AS 100 |
|-------------+---------------------------|
| _100$ | Originated in AS 100 |
|-------------+---------------------------|
| _100_ | Any instance of AS 100 |
|-------------+---------------------------|
| ^[0-9]+$ | Directly connected ASes |
+-------------+---------------------------+

Comments

0 Responses to "BGP Regular Expressions"

Post a Comment

Certifications

Certifications

The Dreamer

A fun loving person who enjoys learning new things. Currently working as a Network Engineer supporting the global network of a Fortune 500 company. This blog serves as my notes for the labs I created for my CCIE journey. I can guarantee there are errors in my posts. If you spot them, please let me know.

Join my Facebook Page I WANT TO BE A CCIE

Donate to the Cause

My aim is to create materials for free and possibly a free lab. If you wish to help out, please send any amount. Thanks.

Join my Bandwagon

Blogs that I Read