This document describes the Simple Netw ork Management Protocol (SNMP) protocol and the SNMP commands. It includes the following sections:
SNMP Overview
Displaying the SNMP Prompts
SNMP Commands
SNMP Overview
SNMP is a protocol for monitoring router operating characteristics. Use SNMP with software running on a remote host.
SNMP enables network hosts to read and modify some of the settings of the router's operating characteristics. It allows software running on a remote host to contact the router over a network and get up-to-date information about the router on request. Since SNMP software can access most of the configuration data, you do not have to enter commands at a remote terminal.
SNMP's basic functions include the following:
Collecting information and modifying router operating characteristics on behalf of remote SNMP users.
Sending and receiving SNMP packets via the IP protocol.
Figure 31 Protocol Layers of the SNMP Environment
The software that processes SNMP requests runs on the router. The user program that makes SNMP requests runs on the user's machine elsewhere in the network, not on the router. The SNMP agent at the router and the user program both use the UDP/IP protocol to exchange packets.
For more information about SNMP, refer to RFC 1157, A Simple Network Management Protocol. Refer to RFCs 1212 and 1213 for descriptions of SNMP variables. The RFCs explain how to use the protocols and formats of the packets that the protocols employ. RFCs are available from the Network Information Center (NIC) at Government Systems, Inc., Chantilly, Virginia.
SNMP Packet Types
SNMP's packet types reflect SNMP's basic functions and types include the following:
GET REQUEST packet. Travels user-to-router. Contains requests by user software for information. Retrieves the exact variable requested.
GET NEXT REQUEST packet. Travels user-to-router. Contains information requests by user software. Retrieves the next alphabetically higher variable.
SET REQUEST packet. Travels user-to-router. Contains requests by user software to modify router operating characteristics.
GET RESPONSE packet. Travels router-to-user. Contains the target router's response to a GET NEXT REQUEST or SET REQUEST packet, sent by the user software.
TRAP MESSAGE packet. Travels router-to-user. Contains unsolicited information from the router and numerically encoded messages, such as An interface on the router went up/down or The router reloaded its software.
To determine if an incoming message represents a legitimate request by an authorized user or an accidental or malicious request by an unauthorized user, SNMP uses various sets of rules. Each such set of rules is called an authentication scheme. Authentication schemes rely on mathematical or cryptographic techniques to authenticate messages.
For each SNMP community, you select an authentication scheme for users of that session. The current implementation of SNMP offers a single authentication scheme called trivial.
For more information on creating and using authentication schemes with SNMP, refer to RFC 1057, A Simple Network Management Protocol.
Displaying the SNMP Prompts
At the Config> prompt enter protocol snmp to display the SNMP Config> prompt.
At theConfig>protocol snmp
SNMP user configuration
SNMP Config>
Monitor> prompt enter protocol snmp to display the SNMP> prompt.Monitor>protocol snmp
SNMP>
SNMP Config> prompt take effect immediately with the exception of the set trap command. Press SPACE twice after you type a command to display the available options for each command. Enter help for information about using the command line interface.
[C] means the command is available at the SNMP Config> prompt.
[M] means the command is available at the SNMP> prompt.
|
Command
|
Function
|
|---|---|
| Add [C] | Adds a community to the list of SNMP communities, an IP address with mask to a community, or a subtree to a MIB view. |
| Delete [C] | Removes a community from the list of SNMP communities, an IP address with mask from a community, or a subtree from a MIB view. |
| Enable [C]/Disable [C] | Enables/disables SNMP protocol and standard traps associated with named communities. |
| Exit [C] [M] | Returns to the previous prompt. |
| List [C] [M] | Displays the current communities with their associated access modes, enabled traps, IP addresses, and views. Also displays all views and their associated MIB subtrees. |
| Set [C] | Sets a community's access mode or view. A community's access modes is one of the following: Also allows setting of trap UDP port. |
| Statistics [M] | Displays the statistics about the number of defined variables and the size of the MIB. |
Add [C]
Adds a community name to the list of SNMP communities, adds an address to a community, or assigns a portion of the MIB (subtree) to a community.
Note: SNMP requests may arrive for any of the routers' addresses.
You may specify one or more address for a community. You must enter the command each time you want to add another address.If you specify no addresses for a community, requests are handled from any host. The addresses also specify hosts that will receive the traps. If no addresses are specified, no traps are generated.
Community name []? public
IP Address [0.0.0.0]? 190.246.12.1
IP Mask [255.255.255.255]?
Note: Use the set community access command to assign access types to existing SNMP communities.
Example:add community
Community Name []? public
|
Community Name
| Specifies the name of community (up to 32 characters). Characters such as spaces, tabs, or <esc> key sequences are not accepted. |
sub_tree view name MIB Object ID
Adds a portion of the MIB to a view or to create a new view. The default is the entire MIB. Use add sub_tree to manage MIB views. You can add more than one subtree to a view that you define. To create a new MIB view, enter the add sub_tree command with the new view name.
You must assign a view to one or more communities using the set community view command to have it take effect.
View Name [system-only]?
MIB OID name [1.3.6.1.2.1.1]?
Delete [C]
Use the delete command to delete
Community name []? public
IP Address [0.0.0.0]? 190.246.12.1
Community name []? public
View name []?
trap type community name
Disables specified traps or all traps. You must specify the trap type from the options shown below.
Example: disable trap all public
Enable [C]
Enables the SNMP protocol or specified traps on the router.
trap type community
Enables specified traps or all traps. You must specify the trap type from the options shown below.
Example: enable trap cold_start community
Exit [C] [M]
Returns to the previous prompt.
exit
List [C] [M]
Displays the current configuration of SNMP communities, access modes, traps, and network addresses, and views.
SNMP is enabled
Trap UDP port: 162
Community Name Access
public Read Only
oxnard Read, Trap
Community Name IP Address IP Mask
public All N/A
oxnard All N/A
Community Name Enabled Traps
public Link Down
oxnard Link Up
Community Name View
public All
oxnard All
Example: list community access
Community Name Access
public Read Only
oxnard Read, Trap
Example: list community address
Community Name IP Address IP Mask
public All N/A
oxnard All N/A
Community Name Traps
public Link Down
oxnard Link Up
Community Name View
public All
oxnard system-only
View Name Sub-Tree
system-only 1.3.6.1.2.1.1
Example: set community access options comm_name
|
read_trap
| Sets read access and trap generation to the named community. |
|
write_read_trap
| Sets write and read trap access to the community specified. |
|
trap_only
| Sets the trap port to the named community. |
community view community name option
Assigns a MIB view to a community.
Example: set community view comm_name options
|
all
| Assigns all supported MIB views to the named community. All is the default. |
|
view
| Assigns a specified MIB view to the named community. |
trap_port UDP port number
Specifies a User Datagram Protocol (UDP_ port number to send traps to the trap port. The default is the standard port number 162.
Example: set trap_port udpport#
Statistics [M]
Displays the statistics about the number of defined variables and the size of the MIB. The statistics can change only when the load or hardware configuration changes.
statistics
Number of defined variables = 231
Size of MIB = 14320 bytes