Changes between Version 6 and Version 7 of netmon2017snmp


Ignore:
Timestamp:
Nov 12, 2017, 5:32:20 PM (7 years ago)
Author:
admin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • netmon2017snmp

    v6 v7  
    118118This might take a few moments if everyone in class is doing this at the same moment.
    119119
     120Install the net-snmp tools:
     121{{{
     122$ sudo apt-get install snmp
     123$ sudo apt-get install snmp-mibs-downloader
     124}}}
     125The second of the two commands downloads the standard IETF and IANA SNMP MIBs which are not included by default.
     126
     127Now, edit the file /etc/snmp/snmp.conf:
     128{{{
     129$ sudo vi /etc/snmp/snmp.conf
     130}}}
     131Note: Here we are using '''vi''' editor. You can use any text editor you are familiar with
     132
     133Change this line:
     134{{{
     135mibs :
     136}}}
     137
     138so that it looks like:
     139{{{
     140# mibs :
     141}}}
     142
     143(You are "commenting out" the empty mibs statement, which was telling the snmp* tools not to automatically load the mibs in the /usr/share/mibs/ directory)
     144
     145Now, in your home directory make a .snmp directory with file snmp.conf inside it, make it readable only be you, and add the credentials to it:
     146{{{
     147$ cd
     148$ mkdir .snmp
     149$ chmod 700 .snmp/
     150$ editor .snmp/snmp.conf
     151}}}
     152
     153Put the following contents in the file:
     154{{{
     155defVersion 3
     156defSecurityLevel authNoPriv
     157defSecurityName admin
     158defAuthPassphrase <class passowrd>
     159defAuthType SHA
     160
     161# Default community when using SNMP v2c
     162defCommunity NetManage
     163}}}
     164Creating this configuration file means you won't have to enter your credentials everytime you use one of the SNMP utilities. Otherwise you would have to add all these values on the command line like this:
     165{{{
     166snmpstatus -v3 -l authNoPriv -a SHA -u admin -A NetManage pcX
     167}}}
     168
     169=== Configure SNMP on Your Router/Switch (Already Done) ===
     170
     171connect to your router and go to configure mode.
     172{{{
     173Router> enable
     174
     175Router# configure terminal
     176}}}
     177Now we need to add an Access Control List rule for SNMP access, turn on SNMP, assign a read-only SNMP community string as well as a SNMPv3 group and user and tell the router to maintain SNMP information across reboots. To do this we do:
     178{{{
     179Router(config)# access-list 99 permit 192.248.6.0 255.255.255.0
     180Router(config)# snmp-server community NetManage ro 99
     181Router(config)# snmp-server group ReadGroup v3 auth access 99
     182Router(config)# snmp-server user admin ReadGroup v3 auth sha <Class Password>
     183Router(config)# snmp-server ifindex persist
     184Now let's exit and save this new configuration to the routers permanent config.
     185
     186Router(config)# exit
     187Router# write memory           
     188Router# exit       
     189}}}             
     190Now to see if your changes are working.
     191
     192=== Testing SNMP ===
     193
     194To check that your SNMP installation works, run the snmpstatus command on each of the following devices
     195{{{
     196$ snmpstatus <IP_ADDRESS>
     197}}}
     198Note that you just used SNMPv3. Not all devices that implement SNMP support v3. Try again, adding "-v2c" as a parameter. Notice that the command automatically uses the community string in the snmp.conf file instead of the v3 user credentials. Try "-v1".
     199
     200=== SNMP Walk and OIDs ===
     201
     202Now, you are going to use the snmpwalk command, part of the SNMP toolkit, to list the tables associated with the OIDs listed below, on each piece of equipment you tried above:
     203
     204OID
     205{{{
     206
     207}}}
     208You will try this with two forms of the snmpwalk command:
     209{{{
     210$ snmpwalk <IP_ADDRESS> <OID>
     211}}}
     212
     213and
     214{{{
     215$ snmpwalk -On <IP_ADDRESS> <OID>
     216}}}
     217
     218example :