SNMP exercises AfNOG 11, Kigali Please run all exercises on your assigned router: Row 1: 196.200.218.249 Row 2: 196.200.218.250 Row 3: 196.200.218.251 Row 4: 196.200.218.252 Row 5: 196.200.218.253 1. Make sure that snmp commands work * snmpstatus -v1 -c afnog 196.200.218.254 * What do you see? * Does v2c, v3 also work? Why, why not? * Does it also work to your local machine? Why, why not? 1. Do an SNMP GET request * snmpget -v2c -c afnog 196.200.218.254 sysUpTime.0 * Why do you need the .0? * easier: snmpwalk -v2c -c afnog 196.200.218.254 sysUpTime 2. Browse a MIB file * MIBs are installed under: /usr/share/snmp/mibs * Look at /usr/share/snmp/mibs/RFC1213-MIB.txt * Try to read the hierarchy and find the OID for sysUpTime Hint: mib-2 is .1.3.6.1.2.1 * Verify: snmpwalk -v2c -c afnog 196.200.218.254 «yourOID» * If you want to get the results without name resolution do snmpwalk -v2c -On -c afnog 196.200.218.1 «yourOID» or if you want the full name hierarchy use -Of * Find some information * What is the location of the router in your workgroup (196.200.218.249/250/251/252/253 for row 1/2/3/4/5)? Hint: Check in the system tree * What is the MAC address of FastEthernet0/1 on this router? Hint: Get the whole interface table and try to read it - it’s a table by ifIndex - find the ifIndex for FastEthernet0/1 and find the MAC address for this interface * What’s the IP address for this interface? Get ipAdEntIfIndex from the ip tree * Add a custom MIB * Run the following command: snmpwalk -Of -v2c -c afnog 196.200.218.254 .1.3.6.1.4.1.9.9.13.1.3 * What do you notice? * To insert Cisco-specific MIB information, you need to download a MIB file and put it in your path. scp them from the NOC server As root: cd /usr/share/snmp/mibs wget http://noc/files/CISCO-SMI.my wget http://noc/files/CISCO-ENVMON-MIB.my * Add variables so it can find the mibs export MIBDIRS=/usr/share/snmp/mibs export MIBS=ALL * Try the snmpwalk command again - what is different now? * Note: You can find MIBs on the vendor website or FTP server usually, e.g. Cisco MIBs are in ftp://ftp.cisco.com/pub/mibs/v2/ - to see what information you can get via SNMP in addition to the standard you can read through the MIB files or vendor doc