Tuesday, February 8, 2011

What Else Can I Do Besides Take Emer

Obtener la tabla BGP de un router Cisco por SNMP

Objective:
I get the BGP table of a Cisco router via SNMP Procedure:

The following procedure was done from a PC with Mandriva and snmp-utils installed. The router was a Cisco 7200 with IOS 12.3

- Install snmp-utils since it is necessary to apply

# urpmi snmpwalk net-snmp-utils
CISCO-BGP4-MIB , you can compile it on your computer or go directly to
OID.

- Object chosen by me is: which corresponds cbgpRouteBest OID 1.3.6.1.4.1.9.9.187.1.1.1.1.18 - The command for BGP table you can use is:

# snmpwalk - v 1-c MICOMUNIDAD .1.3.6.1.4.1.9.9.187.1.1.1.1.18 MIROUTER

The output is quite extensive and can be cumbersome to read. The output is something similar to:
SNMPv2-SMI:: enterprises.9.9.187.1.1.1.1.18.1.128.1.4.3.4.5.6.12.0.0.30.228.0.0.0.2. 199.60.28.0.24
= INTEGER: 1 BGP prefix is \u200b\u200blocated just before the "="

formats octeto1.octeto2.octeto3.octeto4.mascara


So to get a clean start use the following mini-script:
# snmpwalk-v 1-c MICOMUNIDAD .1.3.6.1.4.1.9.9.187.1.1.1.1.18 MIROUTER


190.124.165.0/24
192.33.14.0/24 192.58.128.0/24 190.196.224.0/20
192.197.157.0/24 193.116.0.0/14 199.60.28.0/24

More info:

http://www.cisco.com/en/US/docs/ios/12_0s/feature/guide/sbgprmib.html
ftp://ftp.cisco.com/pub/mibs/oid/CISCO-BGP4 -MIB.oid


0 comments:

Post a Comment