OK, so in this task, we need to enable SNMP on the routers here's router 1,
I'll go into global configuration mode and use the command SNMP server community to enable SNMP.
We've been told to use public and private as the community strings, in the real world
you wouldn't want to do that, in the real world
you want to use something a lot more secure than public and private
but because this is the lab and we simply want to get used to using SNMP, I'll configure SNMP with those
two community strings.
So show run shows us
those two SNMP community strings, as configured on router 1, on router 2 we'll do something
very similar.
So on router 2 SNMP server community public read-only,
SNMP server of a community private is going to be read write.
So we've got our two community string's configured on both routers.
That's essentially all we need to do on the routers and now on the PC
we should be able to use the MIB browser to interrogate the routers.
So on the PC, on the desktop MIB browser, I'll put in the IP address of the first router.
The IP addresses have been configured on these devices.
So show IP interface brief on router
1 shows us the IP address of router 1.
So 10.1.1.1,
I'm going to click on advanced
read community is going to be public, write community is going to be private.
We've been told to use SNMP version 3 per these instructions, so I'm going to click, OK, and
then hopefully I should be able to browse through the MIB tree until I find
system
sysname. So we've been told to get the hostname of router 1 and router 2 as the first task we're going
to be using an SNMP get, to do that, click go
should allow us to get the hostname of the router
and as you can see here, the router name is R1.
If I do something similar with router 2, click go and notice the router name is router 2 so it was as simple
as that to get the hostname of the routers, now we need to view the interfaces on router 1.
So under interfaces
and I need to do that in router 1 you could do something similar on router 2 if you wanted to.
Let's have a look at the interface index, there are interface numbers, description,
notice there are the interfaces on the router.
We can confirm that by using show IP interface brief on the router again.
So show IP interface brief,
we've got gigabit 00.01.02 loopback and VLAN 1
and there you go.
It's as simple as that to interrogate a router using SNMP and to get back information about the router.
So what are the interface types? So I have type click go, we can see copper, gigabit, Ethernet,
loopback and VLAN as the interface types.
You could also look at other information, such as the maximum transmission unit, the speed
of the interfaces, physical addresses, so the Mac addresses.
So on the router show, interface Gigabit 00
notice the Mac address of Gigabit 00,
which is this interface over here. So SNMP allows a management station to get a lot of information about
a device such as the status of interfaces.
So that's administrative statuses, here's operational statuses.
Because we shut interfaces down, they're showing as both administratively down and operationally down,
once again, the only interfaces enabled on the router are gigabit 00
and the loopback interfaces, other interfaces are administratively down and we can see that
through this interface.
So let's have a look at the routing table of router 1.
So IP, IP routing table, let's look at the route destination, there are the routes in the routing table.
We can confirm that again
by looking at router 1s CLI, so show IP route.
There's network quadruple one, we can see that here,
quadruple 2 shown here,
10.1.1.0, 10.1.1.1, we can see that here and we can see a default route
which is pointing to router 2, we can see default route information in the routing table through
SNMP.
So, again, it was as simple as that to get routing information via SNMP.
OK, so the next thing we need to get is the OSPF area on router 1, as well as the OSPF router
ID and OSPF neighbors.
So back in the MIB browser, go to OSPF.
We can get the OSPF router ID, there it is, we can get, as an example, the version of OSPF used which
is version 2, we can get the administrative status of OSPF.
Back on the router, show OSPF
we can see that OSPF is enabled.
Here's the router ID, this is using OSPF version 2 because it's OSPF for IP version 4.
We can also get the OSPF area ID, notice its area zero, again on the router
notice the backbone area, area zero has been enabled in OSPF you can represent it this way or you can
represent it this way.
In this example, authentication hasn't been enabled in OSPF.
We could also look at
the links state database see things such as the router IDs in the link state database,
notice we see those too.
So show IP OSPF database, they are LSA type 1 OSPF
entries and here's LSA type 2
and we can see that through SNMP.
What about the neighbor table, so
neighbor IP address on router 1 is router 2. On the router show IP OSPF neighbor
we can see that router 2 is a neighbor.
If we change this to router 2,
we can see that router 1 is a neighbor to router 2 and we can see
the router ID of router 1 requiring router 2 at this point, it has a router ID neighbor of 1
111.
So on router 2
show IP OSPF neighbor, notice there's the neighbor router ID and the IP address of the neighbor as seen on
router 2 again.
There's the IP address as shown here through SNMP router ID is this, as we can see here on router 2.
We can look at the OSPF priority.
So notice the neighbor has a priority of 100, on router 2
we can see that router 1 has that priority configured and on router 1 show run shows us
that the priority was configured on the Gigabit00 interface.
So a lot of information can be gleaned through SNMP.
I've completed all the read-only tasks.
Let's change the name of R1 to router 1, so here's router 1 notice
the router name is R1.
What we want to do now, however, is change the system name at the moment, it's R1 but we want
to change that by using a set
and in this case, it's an octet string.
So let's change the name to R1
click go, we're told that the router name is changed on the router
we can confirm that the router name has changed.
So if I go back to get there's the router name, I could change it back to R1
click OK, click go router name has changed, we can confirm that again through the console of
the router. So I'll change that back to get, then to set
and set it back to router 1 per our instructions and notice on the router we see that the name
is router 1.
So I'm happy with that.
I've completed these tasks and shown you a bit more.
How did you get on, were you able to complete these tasks?
Now, as an extra I'm going to set
packet tracer to simulation mode
and then I'm going to use get to get the router name from router 1 and click go.
So notice an SNMP packet is sent to the router.
SNMP port is port 161
this is a UDP packet, source
IP address is 10.1.1.200, which is the PC destination is the router.
We can see the outbound PDU here so we can see lots of information, such as the source, Mac address,
destination Mac address.
We can see source IP the PC, the destination is the router, but the important information is here.
SNMP uses UDP Port 161 as both the source and destination Port number.
I'll click capture forward packet goes to the switch and then onto the router.
So let's have a look at the packet inbound PDU looks like this.
We're not seeing a lot of SNMP information.
In packet tracer we can see that the version of SNMP is version 3, we can see that the community is set to
public.
On the packet that goes back to the PC notice the source is the router destination is the PC.
We can see version 3 community is public.
Let's capture forward to that.
It's the PC
and on the PC, we've received that
SNMP packet, we're not seeing a lot of detail through packet tracer here, it's not showing us the
actual information that's returned, such as the router hostname
but if you were using a proper Wireshark capture, you'd be able to see more information.
But what I want to point out is notice the source and destination port number is 161,
Protocol used is the UDP.
What I like about packet tracer here is it's shown us clearly how SNMP works.
It's very simple to configure SNMP and then browse the MIBS
on the devices using S&NMP and retrieve information, as well as configure the devices through SNMP.