Notas BGP regex

O regex e essencialmente um parser, mas aplicado ao BGP torna-se um utilitário muito útil no parsing de rotas aprendidas pelo router. Existem alguns servidores públicos de rotas onde e possível testar o regex no BGP (consultar lista abaixo).

Exemplos:

!Rotas originadas no AS 21740

ns-route-server> sh ip bg reg _21740$
BGP table version is 934229088, local router ID is 24.137.100.8
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
*>i8.5.0.0/24       77.67.70.141           622    100      0 3257 21740 i
*>i8.5.0.0/23       77.67.70.141           622    100      0 3257 21740 i

!Rotas com origem nos neighbors do AS 3257

ns-route-server>sh ip bg reg ^3257_([0-9]+)?$
BGP table version is 934227310, local router ID is 24.137.100.8
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
* i1.9.0.0/16       77.67.70.77             90    100      0 3257 4788 i
*>i1.9.52.0/24      77.67.70.77            180    100      0 3257 4788 ?
*>i1.9.53.0/24      77.67.70.141           613    100      0 3257 4788 ?

 

Tabela Caracteres no Regex:

Caracter Significado
^ 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
_(underscore) Comma, open or close brace, open or close parentheses, start or end of string, or space
\ Matches the character following the backslash. Also matches (escapes) special characters.
| Concatenates constructs. Matches one of the characters or character patterns on either side of the vertical bar.

Lista servidores públicos de rotas:

Country City

Provider

ASN

Africa/Ghana MTN Ghana 37255
Australia/Chatswood Optus Australia 7474
Brazil/Sao Paulo PTT-Metro Sao Paulo 22548
Brazil/Sao Paulo Terremark Internet Exchange Sao Paulo 1251
Canada/Vancouver GT Group Telecom (West) 6539
Canada GT Group Telecom (East) 6539
Canada/Burnaby Telus – Eastern Canada 852
Canada Telus – Western Canada 852
Canada/Toronto Allstream – Central 15290
Canada/Montreal Allstream – East 15290
Canada/Vancouver Allstream – West 15290
Canada/Halifax Eastlink 11260
Germany/Hamburg Broadnet Mediascape Communications AG 9132
France OpenTransit 5511
Finland Eunet Finland 6667
Germany Tiscali 3257
Germany/Stuttgart BelWue 553
Japan Oregon Route Views Project 2500
Mexico Rio Grande do Sul Internet Exchange 1916
Netherlands Zebra Route Views on  Swift Global 21280
Philippines Bayan Telecom Inc. 6648
Philippines Manila Internet Exchange 9670
Romania Astral Telecom 6746
Switzerland Swisscom IP Plus 3303
South Africa South AfricanInternet Exchange – SAIX 5713
South Africa/Mauritius Internet Solutions 3741
Switzerland Sunrise Switzerland 6730
USA/Denver Time Warner Telecom 4323
USA/Ashburn Nlayer 4436
USA/Boca Raton, FL Host.net 13645
USA/Santa Clara Savvis 3561
USA/Sunnyvale Global Crossing 3549
USA/Oregon University of Oregon Route Views Project 6447
USA/Ashburn, VA Zebra Route Views on Sprint Network 1239
USA/CA Zebra Route Views on ISC.org 3557
USA/Fremont,  CA Hurricane Electric 6939
USA/New York AT&T 7018
USA/Las Vergas Switch Communications 23005
USA/SanDiego CERFnet 1838
USA/Broomfield, CO Wiltel 7911
UK Colt Internet 8220
UK Oregon Route Views with Verizon UK 5459
UK Global Crossing – Europe 3549
UK Energis / Planet Online 5388
UK PIPEX 5413
UK/London MainzKom Telekommunikation GmbH 15837

Leave a Comment

Translate »
Google no longer supports Google Images API and this plugin can't work.

You can try to use other plugins with the same feature:
WP Picasa Box - http://codecanyon.net/item/wp-picasa-box/16099962
WP Pixabay Search And Insert - http://wpclever.net/downloads/wordpress-pixabay-search-and-insert