SNMP Exercis1
SNMP Exercis1
For this experiment, we will use the topology illustrated here, with IP addresses as noted on the
diagram and a subnet mask of 255.255.255.0 on each interface:
To set up this topology in the GENI Portal, create a slice, click on "Add Resources", and load the
RSpec from the following URL: https://raw.githubusercontent.com/ffund/tcp-ip-
essentials/master/lab9/lab9-security-rspec.xml
Refer to the monitor website to identify an InstaGENI site that has many "free VMs" available.
Then bind to an InstaGENI site and reserve your resources. Wait for them to become available
for login ("turn green" on your canvas) and then SSH into each, using the details given in the
GENI Portal.
SNMP setup
In this exercise, we will see how SNMP can be used to monitor networked devices.
First, download MIBs on the following nodes: "romeo", "router-int", and "server". Run
Then run
sudo download-mibs
On the "romeo" and "server" nodes, install the SNMP client with:
sudo apt-get update
sudo apt-get -y install snmp
Note that lines not "commented out", i.e. not preceded by a # character, are active.
You'll notice the following rules in the ACCESS CONTROL section of this file:
These rules define a "view" called systemonly with access to two OIDs:
OID 1.3.6.1.2.1.1 includes objects below the system MIB object, which is defined within
SNMPv2-MIB: /usr/share/snmp/mibs/ietf/SNMPv2-MIB
OID 1.3.6.1.2.1.25.1 includes objects below the host MIB object, which is defined within
HOST-RESOURCES-MIB: /usr/share/snmp/mibs/ietf/HOST-RESOURCES-MIB
Then, this rule says that the systemonly view - including those two OIDs - is available on a
read-only basis (ro) to clients using the "public" community string.
agentAddress udp:127.0.0.1:161
and un-comment the line
#agentAddress udp:161,udp6:[::1]:161
2 - Allow read-only access (not only to the two OIDs available to the "public" community - to all
OIDs!) using the "secret" community string for hosts in 10.10.2.0/24. Un-comment the line
Hit Ctrl+O and Enter to save the file, and Ctrl+X to exit nano.
Use
to verify that the SNMP daemon is running. If you made a mistake in editing the configuration
file, then the service may fail at this point, so you'll need to go back and correct your mistake.
Examine the MIBs, which are located in the /usr/share/snmp/mibs directory and its
subdirectories. In particular, study the interface MIB with
less /usr/share/snmp/mibs/ietf/IF-MIB
less /usr/share/snmp/mibs/ietf/SNMPv2-MIB
less /usr/share/snmp/mibs/ietf/HOST-RESOURCES-MIB
We will use the snmpwalk utility to probe the SNMP daemon running on the router.
Open two SSH sessions, one on the "romeo" host and one on the "server" host. In each, run
and in another terminal on the "server" host, run the same command,
Save the output for your lab report. Then, stop both tcpdump instances.
In a terminal on the "romeo" host and another terminal on the "server" host, run
Save the output (or at least, a subset of it) for your lab report. Then, stop both tcpdump instances.
Lab report: What is the difference in the output when running snmpwalk on the "server" host
with "public" as the community string, versus "secret" as the community string, and why? Show
output, and explain. What is the difference in the output when running snmpwalk with "secret" as
the community string on the "server" host, versus with "secret" as the community string on the
"romeo" host, and why? Show output, and explain.
ifconfig
Lab report: Show the output of the snmpget commands. Explain what each of the values you
retrieved using snmpget means. (You can quote directly from the contents of
/usr/share/snmp/mibs/ietf/IF-MIB.) Also, show the relevant section of the ifconfig output
on the router. Annotate your screenshot: circle the interface information you collected using
SNMP.
Once you are done with this part of the lab, proceed to the next part.