SNMP
Synchronized Transcript
145 cues indexed • Click dialogue or words to jumpWelcome to Jeremy’s IT Lab. This is a free, complete course for the CCNA. If you like these videos, please subscribe to follow along with the series.
Also, please like and leave a comment, and share the video to help spread this free series of videos. Thanks for your help. In this video we will cover SNMP, the Simple Network Management Protocol.
SNMP is mentioned in exam topic 4.4, which says you must be able to explain the function of SNMP in network operations. So, you don’t need to know the detailed workings of SNMP, know how to set up an SNMP server, how to configure SNMP, etc.
Basically, you just need to know its role and purpose in network operations. Here’s what we’ll cover in this video.
First I’ll give an overview of SNMP, its purpose, how it works, etc. Then I’ll introduce the different versions of SNMP. There have actually been many different versions developed over the years, however you only really need to know 3 of them.
I’ll also give an overview of the different messages SNMP uses to fulfill its purpose. And finally, some very basic SNMP configurations.
Although the exam topics don’t list SNMP configuration as a requirement, I think it’s a good idea to learn some very basic commands which we will then try out in the next lab video.
Watch until the end of the video for a bonus practice question from Boson Software’s ExSim for CCNA, the best practice exams for the CCNA.
So let me give you an overview of SNMP. SNMP is an industry-standard framework and protocol that was originally released in 1988.
Most people think of SNMP as a single protocol, but actually it fits into a larger framework of network management, sometimes called the SNMP framework.
The first RFC was RFC 1065, structure and identification of management information for TCP/IP-based internets.
I think I mentioned RFCs, Requests For Comments, at some point earlier in the course. These are how the IETF, Internet Engineering Task Force, defines standards for the Internet.
The next RFC for SNMP was RFC 1066, management information base for network management of TCP/IP-based internets.
And one more, RFC 1067, a simple network management protocol. These three RFCs together make up SNMP version 1.
There have been many more RFCs since then defining other versions of SNMP, a few of which I’ll introduce later in this video.
By the way, you don’t have to memorize these RFCs, I’m just giving a little history. Don’t let the ‘simple’ in the name fool you! Although SNMPv1 was relatively simply compared to the later versions, the current version SNMPv3 is actually fairly complicated.
I know I still have a lot to learn about SNMP. Fortunately, for the CCNA or even the CCNP you don’t need to know all the details, but you do need to understand the purpose and basics of SNMP.
SNMP can be used to monitor the status of devices, make configuration changes, etc. There are two main types of devices in SNMP.
First, there are the managed devices. These are the devices being managed using SNMP. For example, network devices like routers and switches.
We can use SNMP to monitor the status of the routers and switches in our networks. And the second type is the Network Management Station, NMS. You might also hear Network Management System, instead of Station.
It’s the same thing. This is the device, or devices, managing the managed devices I mentioned above. This is the SNMP ‘server’, although typically we use the term NMS instead of SNMP server.
Let’s look more at how SNMP works. In this network, SRV1 is the NMS, Network Management Station or System. We’re using SNMP to manage R1 and SW1, so they are the managed devices.
There are three main operations used in SNMP, three main ways SNMP can be used to help manage a network. The first one is that managed devices can notify the NMS of events.
For example, perhaps SW1’s G0/1 interface had a hardware failure and it’s status changed to DOWN. It can send an SNMP message to the NMS, SRV1, telling it that the G0/1 interface has gone down.
The actual SNMP software on the server, or the NMS, might be configured to notify the network administrator to inform them of this event, for example.
Okay, so managed devices can notify the NMS of events such as interfaces going up and down. The NMS can also ask the managed devices for information about their status.
For example, perhaps the NMS, SRV1, asks R1 what its current CPU usage is. You want to make sure your network devices aren’t being overloaded and working too hard.
R1 will then reply to the NMS, for example telling SRV1 that its CPU usage is at 50%. So, that’s another function of SNMP.
And one more main operation used by SNMP is when the NMS tells the managed devices to change aspects of their configuration. For example, let’s say the IP address of R1’s G0/1 interface is 203.0.113.1/30.
The NMS can tell R1 to change that IP address to 203.0.113.5/30. R1 will change the IP address and tell the NMS that it did so.
So, those are the three main operations used in SNMP. The managed devices can notify the NMS of events, the NMS can ask managed devices for information about their current status, and the NMS can also tell the managed devices to change their configuration.
Now let’s look a little deeper into how this all works. These are the main components of SNMP. Up top there is the NMS from the previous network diagram, SRV1.
On the bottom, the two managed devices, SW1 and R1. Let me break this diagram down step by step. First, the components of the NMS.
Let this green section represent the SNMP software on the NMS. The NMS probably isn’t a machine dedicated to SNMP. It could just be the network admin’s PC which is running SNMP software.
So, what components are there in the NMS’s SNMP software? First, the SNMP Manager is the SNMP software on the NMS that interacts with the managed devices.
It receives notifications, sends requests for information, sends configuration changes, etc. Next there is an SNMP application, this is the application that provides an interface for the network admin to interact with.
It displays alerts, statistics, charts, etc. Here’s what an SNMP Application might look like. There are plenty of free and commercial SNMP applications available.
This screenshot is from SolarWinds. Next, let’s look at the managed devices, SW1 and R1 from our example before.
This blue area represents the SNMP entity on the managed devices. These devices are a router and a switch, so of course SNMP is just a part of what’s running on these devices.
The first component is the SNMP Agent. This is the SNMP software running on the managed devices that interacts with the SNMP Manager on the NMS.
It sends notifications to and receives messages from the NMS. Another important component is the MIB, Management Information Base.
This is the structure that contains the variables that are managed by SNMP. Each of these variables is identified with an Object ID, OID.
Some examples of variables stored in the MIB are the status of each interface on the device, the traffic throughput, CPU usage, device temperature, etc.
Each of these will have their own OID to identify them. So, that’s the basic structure of SNMP. Then, the SNMP messages exchanged between the agent and manager make SNMP work.
Now before moving on to introduce the different SNMP versions, let me briefly introduce those Object IDs, OIDs, that are organized in the Management Information Base, MIB.
SNMP Object IDs are organized in a hierarchical structure. Here’s an example of an OID, and here’s how it breaks down.
iso, identified-organization, dod, internet, mgmt, mib-2, system, and sysName. So, this OID is used to identify the system name, the host name, of the managed device.
For example, here’s that same network again. The NMS asks one of the managed devices, SW1, what value do you have for this OID?
SW1 then replies, telling the NMS its host name. There are countless different OIDs. If you want to explore some different OIDs you can take a look around oid-info.com.
That’s how I got the OID information for the system name OID I used as an example here. Now let me give a brief overview of the major SNMP versions.
Many versions of SNMP have been proposed and developed, however only three major versions have achieved wide-spread use. The first is SNMPv1, this is the original version of SNMP.
The next version is SNMPv2c. There are multiple versions of SNMPv2, but v2c is the most widely used. Version 2 added another message type which allows the NMS to retrieve large amounts of information from a managed device using a single request, making
it much more efficient, there is less unnecessary network traffic. The ‘c’ in the name refers to the ‘community strings’, which are passwords that were used in SNMPv1, removed from SNMPv2, and then added back for this version, SNMPv2c.
When we take a look at SNMP configuration I’ll use version 2c to demonstrate, so you’ll see how these community strings work.
Basically they’re just passwords. Okay, the next major version and the best version so far is SNMPv3. It is a much more secure version of SNMP that supports strong encryption and authentication.
I’ll talk more about those terms in the security section of this course, but basically it means that SNMPv3 makes sure that only the intended devices can read the SNMP messages, they can’t be intercepted and read by an attacker.
Now let’s look at the SNMP message types. In this chart I’ve listed the four message classes: read, write, notification, and response.
I’ve also given a description of each class, and then listed the actual SNMP messages in each class. First let’s take a look at the ‘read’ message class.
These messages are sent by the NMS to read information from the managed devices. I already showed a few examples before, like when SRV1 asked SW1 what its host name is.
There are three messages in this class, Get, GetNext, and GetBulk. I think this is more depth than necessary for the CCNA, so I’ll just give a very quick outline of those messages.
First up is the Get message. It’s a request sent from the manager to the agent, the NMS to the managed device, to retrieve the value of a variable, an OID, or multiple variables.
The agent will send a ‘Response’ message with the current value of each variable. For example, our NMS here might ask SW1, what’s the status of your G0/1 interface?
And SW1 responds with an SNMP ‘response’ message. Another kind of SNMP ‘read’ message is GetNext. It is sent from the manager to the agent to discover the available variables in the MIB.
Basically, it says ‘tell me the next OID’, so it can be used to discover what other OIDs are available. There is also the GetBulk message, which is a more efficient version of GetNext introduced in SNMPv2.
If you know the purpose of the basic Get message, you’ll be fine for the CCNA. So, those are the ‘read’ messages. Next up, the ‘write’ messages, and actually there is only one kind of message, which is ‘Set’.
These are sent by the NMS to change information on the managed devices, to change the value of a specific variable, such as changing an IP address.
Just like with the Get message, I already showed you an example of an SNMP Set message when SRV1 made R1 change the IP address of its G0/1 interface, but I’ll demonstrate again.
So, the Set message is a request from the manager to the agent to change the value of one or more variables. Then the agent will send a Response message with the new values.
For example, SRV1 can send a Set message to SW1, requesting that it change its host name to SW10. SW1 will then change its host name, and send a Response message with its new host name.
So, that’s the write message class, with the Set message. Next the ‘notification’ message class. These are messages sent by the managed devices to alert the NMS of a particular event, for example when an interface goes down.
There are two different messages, Trap and Inform. Let’s check them out. First up, the Trap message. This is a notification sent from the agent to the manager, so the managed device to the NMS.
The manager does not send a Response message to acknowledge that it received the Trap, so these messages are unreliable. Also, SNMP uses UDP, so there are no TCP retransmissions.
Now, unless there’s some problem in the network the Trap will reach the NMS no problem, but since there is no reliability mechanism built-in they are called unreliable messages.
I showed an example before, but here’s another. SW1’s G0/0 interface went down, so it sends a Trap message to the NMS, SRV1. That’s it, no response is sent to SW1.
This Trap will probably appear as an alert in the SNMP application on SRV1, and perhaps it will send an email notification to the network admin, or something like that.
Okay, the next kind of notification message is the Inform message. It’s like a Trap message, but it is acknowledged with a response message. So, even though this message is sent with UDP, not TCP, there is reliability built into the message itself.
If SW1 sends an Inform to SRV1, SRV1 will send a Response to tell SW1 that the Inform was received. This message type was originally used for communications between managers, for networks with multiple SNMP managers.
However later updates to the protocol allow agents to send Inform messages to managers, too. So, those are the SNMP Trap and Inform messages.
Finally, the Response message class, with just one message, Response. These are messages sent in Response to a previous message or request.
For example, Get messages, Set messages, and Inform messages. I just showed you some examples of Response messages, so I think that’s enough for now.
So, those are the SNMP messages. I think the information I just gave you will be more than enough for the CCNA. I mentioned these port numbers in the Day 30 video on TCP and UDP, but SNMP Agents listen for messages on UDP port 161 and SNMP Managers
listen for messages on UDP port 162. Make sure you remember those port numbers. Now let me demonstrate some basic SNMP configuration.
As I said before, SNMP configuration isn’t mentioned in the exam topics list, but I think getting a bit of hands-on practice is always helpful, so let’s try it out.
We won’t cover setting up the NMS, that’s definitely out-of-scope for the CCNA, but let’s see how to set up the SNMP agent on a Cisco router.
In this network, R1 is the managed device, and PC1 is the NMS, running an SNMP application. First I configured some optional information on R1, giving some contact information and the location of the device.
This is optional information, you don’t need to configure this. Then I configured two community strings. As I mentioned before, these are basically SNMP passwords.
Notice that I specified the community string Jeremy1 as RO, this means read only. So, an NMS using this password can only read information from R1, it can’t use Set to make any changes to R1.
On the other hand, I specified Jeremy2 as RW, read/write. An NMS using this password will be able to both read, using Get messages, and write, using Set messages.
Note that there are actually default community strings, ‘public’ for RO and ‘private’ for RW. So, if you don’t specify community strings these will be used.
Of course, it’s best to configure the community strings and not use the defaults, as they are less secure. Then I specified the address of the NMS, PC1 at 192.168.1.1.
In this command I also specified the version and which community string to use with this server. I configured Jeremy1, so PC1 will be able to read information from R1, but it won’t be able to use Set messages to make changes to R1.
So, the read/write community string Jeremy2 isn’t being used in this configuration. Then I configured what kinds of traps to send to the NMS.
I specified LINKDOWN and LINKUP messages, so if an interface goes up or down Traps will be sent. I also specified config traps, so for example if configuration changes are made Traps will be sent.
So, that’s a simple SNMPv2c configuration. Let’s see what happens when R1’s G0/1 interface goes down.
Here’s a Wireshark capture of the Trap that was sent from R1 to the NMS, PC1. If you look at the bottom, you’ll see numerous OIDs included in this Trap.
I looked up this OID using oid-info.com, and as you can see it is a linkDown Trap, notifying the NMS that R1’s interface went down.
Okay, now let’s look at some other fields of this SNMP message. You can see the version of 2c that I configured. And here’s the community, Jeremy1, the RO community string I configured.
Note that this community string, this password, is displayed in plain text. In SNMPv1 and SNMPv2c, there is no encryption.
The community and message contents are sent in plain-text. This is not secure, as the packets can easily be captured and read. So, as I mentioned before SNMPv3 is the preferred option.
However SNMPv3 configuration is also more complicated, so for this simple demonstration I selected version 2c.
So, before moving on to the quiz let me summarize what we covered. SNMP helps manage devices over a network. There are two main components of SNMP.
The managed devices are the devices being managed using SNMP, such as network devices, for example routers, switches, and firewalls.
The network management stations, NMS, are the SNMP servers that manage the devices. The NMS receives notifications from managed devices.
It can change the settings on managed devices. It can also check on the status of managed devices. Variables such as interface status, temperature, traffic load, host name, etc, are stored in the MIB of the managed devices, and each variable is identified using an object
ID, OID. There are three main SNMP versions: version 1, version 2c, and version 3. Version 3 is preferred because it is more secure than the previous versions, providing encryption and authentication of SNMP messages.
And these are the SNMP messages we covered: Get, GetNext, GetBulk, Set, Trap, Inform, and Response. Okay, that should be more than enough information about SNMP for the CCNA.
Remember, the exam topics state you need to know the function of SNMP in network operations. There’s a lot more that can be learned about SNMP, of course, but I’ll leave it here.
As always, make sure to watch until the end of the quiz for a bonus practice question from Boson Software’s ExSim, the best practice exams for the CCNA. Okay, let’s go to question 1 of the quiz.
Which of the following SNMP messages are used by the NMS to ‘read’ information from the managed devices? (select all that apply) Here are the options.
Pause the video to think about the answers. The answers are D, Get, and G, GetNext. In addition to these, there is also the GetBulk message which is used to read information from the managed devices.
By the way, F, SetBulk, is not a real SNMP message type. Okay, let’s go to question 2. Which of the following SNMP messages are sent to UDP port 162?
Select all that apply. Here are the options. Pause the video to think about your answers.
The answers are A, Inform, and B, Trap. The NMS listens on UDP port 162 for SNMP messages.
Informs and Traps are both sent from the managed devices to the NMS, to they are sent to port 162. Set and Get messages are sent from the NMS to the managed devices, which listen on port 161, so they are incorrect.
Okay, let’s go to question 3. Which of the following SNMP message types was introduced in SNMPv2 and allows mass-retrieval of information from managed devices?
Here are the options. Pause the video to think about the answer. The answer is D, GetBulk.
GetBulk is like an optimized version of GetNext, allowing the NMS to discover the variables in the MIB of the managed devices. Okay, let’s go to question 4.
Which of the following pieces of software runs on an SNMP NMS? Here are the options. Pause the video to think about your answer.
The answer is C, the SNMP Manager. This is the software that interacts with the SNMP Agent on the managed devices. It sends SNMP messages to and receives messages from the Agent.
Okay, let’s go to question 5. Which of the following SNMP messages is sent without expecting a Response? Here are the options.
Pause the video to think about your answer. The answer is D, Trap. Traps are messages sent by SNMP managed devices to the NMS.
Trap messages aren’t acknowledged with a Response, so they are considered unreliable. Even if the message is lost in transmit for some reason, the managed device won’t send the Trap again.
Okay, that’s all for the quiz. Next let’s take a look at a bonus question in Boson Software’s ExSim for CCNA.
Okay here's today's Boson ExSim practice question. Which of the following SNMP actions are used by an NMS to extract information from an SNMP agent?
Select 2 choices. So here are the choices, we have Inform, Trap, GetNext, Set, and Get. So pause the video now to think about the answers.
Okay so let's check. So it's asking us which of these SNMP actions, or messages, are used by an NMS, that's the network management station, the server, to extract information from an SNMP agent, a managed device?
So these first two choices, Inform and Trap, are definitely incorrect. These messages are sent from the SNMP agent, the managed device, to the NMS.
So A and B are incorrect. C, D, and E are all sent from the NMS to the managed device. GetNext is used to get the name, or the object ID, of the next object, the next variable, in the MIB.
So, this helps the NMS to discover what objects, what OIDs, are in the management information base of the managed device.
So I think that is one of the correct answers, that is used to extract information from an SNMP agent. Now, Set is used to change a variable on an agent.
So it's not used to extract information, it's used to change information. So I think D is incorrect. And then E is used to get the value of one of the variables, one of the OIDs, in the MIB of the SNMP agent.
So I think E is correct also. So the two correct answers should be C and E. So, you can check the answers in Boson ExSim by clicking on 'show answer'.
And those are the two correct answers. So here is Boson's explanation, including an explanation of all of the SNMP message types I mentioned in this video.
You can pause the video now to read the explanation. And there is more down here, with some output from Cisco IOS.
And here. And there's also a reference to some Cisco documentation about the SNMP Get message type.
Okay so that was a look at Boson Software's ExSim for CCNA. As I have said before, these are by far the best practice exams for the CCNA, and they are the ones I used myself a few years ago to study for my CCNA exam.
If you want to get Boson ExSim, please follow the link in the video description. There are supplementary materials for this video.
There is a flashcard deck to use with the software ‘Anki’. There will also be a packet tracer practice lab so you can get some hands-on practice. That will be in the next video.
Sign up for my mailing list via the link in the description, and I’ll send you all of the flashcards and packet tracer lab files for the course.
Before finishing today’s video I want to thank my JCNP-level channel members. To join, please click the ‘Join’ button under the video. Thank you to H W, Brandon, Samil, Aaron, Tech Alameda, Marcel, Magrathea, Kone, Donald, C Mohd, Gustavo, Anthony, Biraj, Junhong, Benjamin, Tshepiso,
Justin, Prakaash, Nasir, Erlison, Apogee, Marko, Daming, Jhilmar, Ed, Value, John, Funnydart, Velvijaykum, Mark, Yousif, Boson Software, Devin, Lito, Yonatan, and Vance.
Sorry if I pronounced your name incorrectly, but thank you so much for your support. This is the list of JCNP-level members at the time of recording by the way, February 6th 2021.
If you signed up recently and your name isn’t on here don’t worry, you’ll be in future videos. Thank you for watching. Please subscribe to the channel, like the video, leave a comment, and share the video with anyone else studying for the CCNA.
If you want to leave a tip, check the links in the description. I'm also a Brave verified publisher and accept BAT, or Basic Attention Token, tips via the Brave browser.
That's all for now.