Pages

network cisco ccna gns3 certification arteq

network cisco ccna gns3 certification arteq
a network runs through it

Search insearchofthecert

Sunday, November 11, 2012

regexp...

everybody out in internetland who counts mentions you gotta get used to regular expressions if you want to get good at bgp...

there is a good article on INE by mcgahan the man...
http://blog.ine.com/2008/01/06/understanding-bgp-regular-expressions/

if you have any nix experience this should come easy... if you don't have nix experience you better start getting some...  junos doesn't try to disguise the fact that it runs on top of unix (freebsd)... in fact when you first boot up a juniper box you get: %

for those keeping track most everything is based on nix... DOS was a direct rip off of nix back when we were still living in caves...

Silk#sh ip bgp

     Network          Next Hop            Metric LocPrf Weight Path
 *>  1.1.1.0/24       1.1.1.1                  0             0 1 i
 *>  2.2.2.0/24       0.0.0.0                  0         32768 i
 *>  3.3.3.0/24       3.3.3.3                  0             0 3 i
 *>  4.4.4.0/24       3.3.3.3                                0 3 4 i
 *>  11.11.11.0/24    1.1.1.1                  0             0 1 i
 *>  22.22.22.0/24    0.0.0.0                  0         32768 i
 *>  33.33.33.0/24    3.3.3.3                  0             0 3 i
 *>  44.44.44.0/24    3.3.3.3                                0 3 4 i

this is going to match null: ^$ (locally originated paths)

Silk#sh ip bgp regexp ^$

     Network          Next Hop            Metric LocPrf Weight Path
 *>  2.2.2.0/24       0.0.0.0                  0         32768 i
 *>  22.22.22.0/24    0.0.0.0                  0         32768 i

this includes the paths that contain AS 3:

Silk#sh ip bgp regexp _3_

     Network          Next Hop            Metric LocPrf Weight Path
 *>  3.3.3.0/24       3.3.3.3                  0             0 3 i
 *>  4.4.4.0/24       3.3.3.3                                0 3 4 i
 *>  33.33.33.0/24    3.3.3.3                  0             0 3 i
 *>  44.44.44.0/24    3.3.3.3                                0 3 4 i

mcgahan explains it well in the link above...  happy regexp'ing...

No comments:

Post a Comment