Simple Network Management Protocol
Simple Network Management Protocol (SNMP) works on the application layer of the OSI model. SNMP enables network administrators to manage network performance and to find and solve network problems. The SNMP system consists of the following three parts:
The SNMP manager can be part of a Network Management System (NMS) such as CiscoWorks. The agent and the MIB both reside on the router. An SNMP agent contains MIB variables that can be requested or changed by the SNMP manager. A manager can get a value from an agent or can store a value into an agent. The agent can also respond to a manager's request to get or set data. An agent can send unsolicited traps to the manager. Traps are messages to alert the manager to a certain condition on the network, such as improper user authentication, restarts, or link status.
SNMP Notifications
Besides traps, a client can send an inform request to the manager. The difference between a trap and an inform request is that a trap is unreliable and an inform request is reliable. If a manager does not receive an inform request, the manager does not send a response to the agent. The manager sends a response only when an inform request is sent. The advantage of using a trap is that it consumes fewer resources on a router. Figures 15-4 and 15-5 illustrate the difference between traps and inform requests.
Figure 15-4. Trap Sent to SNMP Manager
[View full size image]

Figure 15-5. Inform Request Sent to SNMP Manager
[View full size image]

SNMP Versions
Cisco IOS software supports the following versions of SNMP:
- SNMPv1
This is a full Internet standard protocol defined in RFC 1157. Security is based on community strings, which are discussed later in this chapter. - SNMPv2c
This is an experimental Internet protocol defined in RFC 1901, RFC 1905, and RFC 1906. - SNMPv3
This version of SNMP is an interoperable, standards-based protocol defined in RFCs 2273 to 2275. SNMPv3 provides secure access to devices through a combination of authentication and encryption of the packets over the network.
SNMP Configuration
There is no specific command to enable SNMP. The first snmp-server command that is entered enables the supported versions of SNMP. To configure SNMP, several tasks must be performed:
- Create or modify access control for an SNMP community
- Create or modify an SNMP view record
- Specify an SNMP server engine name
- Specify SNMP server group names
- Configure SNMP server hosts
- Configure SNMP server users
- Monitor and troubleshoot SNMP status
- Configure SNMP notifications
Create or Modify Access Control for an SNMP Community
To define the relationship between an SNMP manager and the agent, you have to use an SNMP community string. The string acts like a password to get access to the agent on the router. You can configure some optional parameters such as the following:
- An access list of the SNMP managers that are permitted to use the community string to gain access
- Read and write or read-only access
- The command to configure all this in global configuration mode is as follows:
Router(config)# snmp-server community string [view view-name ] [ro | rw ] [access-list-number ]
It is possible to configure one or more community strings.
Create or Modify an SNMP View Record
To limit which objects an SNMP manager can access, you can assign a view to community strings. You can use predefined views or create your own views. To create or modify an SNMP view record, the following command is used in global configuration mode:
Router(config)# snmp-server view view-name oid-tree {included | excluded }
Specify an SNMP Server Engine Name
To configure a name for either the local or the remote SNMP engine on the router, use the snmp-server engineID global configuration command.
Router(config)# snmp-server engineID local engineid-string
Specify SNMP Server Group Names
To specify a new SNMP group or a table that maps SNMP users to SNMP views, use the following command in global configuration mode:[View full width]Router(config)# snmp-server group [groupname {v1 | v2c | v3 [auth | noauth | priv ]}][read

Configure SNMP Server Hosts
To configure the recipient of an SNMP trap operation, the following command should be used in global configuration mode:[View full width]Router(config)# snmp-server host host-id [traps | informs ][version {1 | 2c | 3 [auth |

Configure SNMP Server Users
To configure a new user to an SNMP group, use the following command in global configuration mode:[View full width]Router(config)# snmp-server user username groupname [remote ip-address [udp-port port ]]

To configure a remote user, specify the IP address or port number for the remote SNMP agent of the device where the user resides. Also, before you configure remote users for a particular agent, configure the SNMP engine ID using the command snmp-server engineID with the remote option. The remote agent's SNMP engine ID is needed when computing the authentication/privacy digests from the password. If the remote engine ID is not configured first, the configuration command will fail.
Monitor and Troubleshoot SNMP Status
Several commands are available to monitor and troubleshoot SNMP, as described in Table 15-3.
Command | Purpose |
---|---|
show snmp | Monitors SNMP status |
show snmp engineID [local remote ] | Displays information on all local or remote engines that have been configured on the router |
show snmp groups | Displays information about each SNMP group on the network |
show snmp user | Displays information about each SNMP username in the SNMP user table |
Configure SNMP Notifications
To configure a router to send traps or inform requests to a host, the following steps need to be taken:
Step 1. | Specify the engine ID for the remote host.
|
Step 2. | Configure an SNMP user to be associated with the host in step 1.[View full width]Router(config)# snmp-server user username groupname [remote host [udp-port port ] {v1 | v2c |
Step 3. | Configure an SNMP group.[View full width]Router(config)# snmp group groupname {v1 | v2 | v3 {auth | noauth | priv }} [read readview ] |
Step 4. | Specify that you want the SNMP notifications sent as traps or informs, the version you want to use, and the security level of the notifications (for SNMPv3).[View full width]Router(config)# snmp-server host host [traps | informs ] [version {1 | 2c | 3 [auth | |
Step 5. | Enable sending of traps or informs and specify the type of notification to be sent.
|
An example of the use of SNMP is covered in the case study at the end of this chapter.