B ncs5000 Sysman Configuration Guide 61x - Chapter - 0111
B ncs5000 Sysman Configuration Guide 61x - Chapter - 0111
Protocol
Simple Network Management Protocol (SNMP) is an application-layer protocol that provides a message
format for communication between SNMP managers and agents. SNMP provides a standardized framework
and a common language used for the monitoring and management of devices in a network.
This module describes the tasks you need to implement SNMP on your Cisco IOS XR network.
• Prerequisites for Implementing SNMP, on page 1
• Restrictions for SNMP use on Cisco IOS XR Software, on page 1
• Information about Implementing SNMP, on page 2
• Session MIB support on subscriber sessions , on page 7
• How to Implement SNMP on Cisco IOS XR Software, on page 8
Note A10 Gigabit interface is greater than 2 32, so if you are trying to display speed information regarding the
interface, you might see concatenated results.
To display correct speed of an interface greater than 10 Gigabit, ifHighSpeed can be used.
SNMP Manager
The SNMP manager is the system used to control and monitor the activities of network hosts using SNMP.
The most common managing system is called a network management system (NMS). The term NMS can be
applied to either a dedicated device used for network management, or the applications used on such a device.
A variety of network management applications are available for use with SNMP. These features range from
simple command-line applications to feature-rich graphical user interfaces (such as the CiscoWorks 2000 line
of products).
SNMP Agent
The SNMP agent is the software component within the managed device that maintains the data for the device
and reports these data, as needed, to managing systems. The agent and MIB reside on the router. To enable
the SNMP agent, you must define the relationship between the manager and the agent.
MIB
The Management Information Base (MIB) is a virtual information storage area for network management
information, which consists of collections of managed objects. Within the MIB there are collections of related
objects, defined in MIB modules. MIB modules are written in the SNMP MIB module language, as defined
in STD 58, RFC 2578, RFC 2579, and RFC 2580. Note that individual MIB modules are also referred to as
MIBs; for example, the Interfaces Group MIB (IF-MIB) is a MIB module within the MIB on your system.
The SNMP agent contains MIB variables whose values the SNMP manager can request or change through
Get or Set operations. A manager can get a value from an agent or store a value into that agent. The agent
gathers data from the MIB, the repository for information about device parameters and network data. The
agent can also respond to manager requests to get or set data.
This figure illustrates the communications relationship between the SNMP manager and agent. A manager
can send the agent requests to get and set MIB values. The agent can respond to these requests. Independent
of this interaction, the agent can send unsolicited notifications (traps) to the manager to notify the manager
of network conditions.
Figure 1: Communication Between an SNMP Agent and Manager
SNMP Versions
Cisco IOS XR software supports the following versions of SNMP:
• Simple Network Management Protocol Version 1 (SNMPv1)
• Simple Network Management Protocol Version 2c (SNMPv2c)
• Simple Network Management Protocol Version 3 (SNMPv3)
Both SNMPv1 and SNMPv2c use a community-based form of security. The community of managers able to
access the agent MIB is defined by an IP address access control list and password.
SNMPv2c support includes a bulk retrieval mechanism and more detailed error message reporting to
management stations. The bulk retrieval mechanism supports the retrieval of tables and large quantities of
information, minimizing the number of round-trips required. The SNMPv2c improved error handling support
includes expanded error codes that distinguish different kinds of error conditions; these conditions are reported
through a single error code in SNMPv1. Error return codes now report the error type. Three kinds of exceptions
are also reported: no such object exceptions, no such instance exceptions, and end of MIB view exceptions.
SNMPv3 is a security model. A security model is an authentication strategy that is set up for a user and the
group in which the user resides. A security level is the permitted level of security within a security model. A
combination of a security model and a security level will determine which security mechanism is employed
when an SNMP packet is handled. See Security Models and Levels for SNMPv1, v2, v3, on page 4 for a
list of security levels available in SNMPv3. The SNMPv3 feature supports RFCs 3411 to 3418.
You must configure the SNMP agent to use the version of SNMP supported by the management station. An
agent can communicate with multiple managers; for this reason, you can configure the Cisco IOS-XR software
to support communications with one management station using the SNMPv1 protocol, one using the SNMPv2c
protocol, and another using SMNPv3.
This table identifies other key SNMP features supported by the SNMP v1, v2c, and v3.
Authentication No No Yes
SNMPv3 Benefits
SNMPv3 provides secure access to devices by providing authentication, encryption and access control. These
added security benefits secure SNMP against the following security threats:
• Masquerade—The threat that an SNMP user may assume the identity of another SNMP user to perform
management operations for which that SNMP user does not have authorization.
• Message stream modification—The threat that messages may be maliciously reordered, delayed, or
replayed (to an extent that is greater than can occur through the natural operation of a subnetwork service)
to cause SNMP to perform unauthorized management operations.
• Disclosure—The threat that exchanges between SNMP engines could be eavesdropped. Protecting against
this threat may be required as a matter of local policy.
In addition, SNMPv3 provides access control over protocol operations on SNMP managed objects.
SNMPv3 Costs
SNMPv3 authentication and encryption contribute to a slight increase in the response time when SNMP
operations on MIB objects are performed. This cost is far outweighed by the security advantages provided
by SNMPv3.
This table shows the order of response time (from least to greatest) for the various security model and security
level combinations.
Security Security
Model Level
SNMPv2c noAuthNoPriv
SNMPv3 noAuthNoPriv
SNMPv3 authNoPriv
SNMPv3 authPriv
MIB Views
For security reasons, it is often valuable to be able to restrict the access rights of some groups to only a subset
of the management information within the management domain. To provide this capability, access to a
management object is controlled through MIB views, which contain the set of managed object types (and,
optionally, the specific instances of object types) that can be viewed.
Access Policy
Access policy determines the access rights of a group. The three types of access rights are as follows:
• read-view access—The set of object instances authorized for the group when objects are read.
• write-view access—The set of object instances authorized for the group when objects are written.
• notify-view access—The set of object instances authorized for the group when objects are sent in a
notification.
The IP Precedence value is the first three bits in the type of service (ToS) byte of an IP header. The IP DSCP
code point value is the first six bits of the differentiate services (DiffServ Field) byte. You can configure up
to eight different IP Precedence markings or 64 different IP DSCP markings.
SNMP Notifications
A key feature of SNMP is the ability to generate notifications from an SNMP agent. These notifications do
not require that requests be sent from the SNMP manager. On Cisco IOS XR software, unsolicited
(asynchronous) notifications can be generated only as traps. Traps are messages alerting the SNMP manager
to a condition on the network. Notifications can indicate improper user authentication, restarts, the closing of
a connection, loss of connection to a neighbor router, or other significant events.
Note Inform requests (inform operations) are supported in Cisco IOS XR software.
Traps are less reliable than informs because the receiver does not send any acknowledgment when it receives
a trap. The sender cannot determine if the trap was received. An SNMP manager that receives an inform
request acknowledges the message with an SNMP response protocol data unit (PDU). If the manager does
not receive an inform request, it does not send a response. If the sender never receives a response, the inform
request can be sent again. Thus, informs are more likely to reach their intended destination.
However, traps are often preferred because informs consume more resources in the router and in the network.
Unlike a trap, which is discarded as soon as it is sent, an inform request must be held in memory until a
response is received or the request times out. Also, traps are sent only once, and an inform may be retried
several times. The retries increase traffic and contribute to a higher overhead on the network. Thus, traps and
inform requests provide a trade-off between reliability and resources.
Figure 2: Trap Received by the SNMP Manager
In this illustration, the agent router sends a trap to the SNMP manager. Although the manager receives the
trap, it does not send any acknowledgment to the agent. The agent has no way of knowing that the trap reached
its destination.
In this illustration, the agent sends a trap to the manager, but the trap does not reach the manager. Because
the agent has no way of knowing that the trap did not reach its destination, the trap is not sent again. The
manager never receives the trap.
Session Types
The supported session types are:
• PPPoE
• IP SUB PKT
• IP SUB DHCP
Configuring SNMPv3
This task explains how to configure SNMPv3 for network management and monitoring.
Note No specific command enables SNMPv3; the first snmp-server global configuration command (config), that
you issue enables SNMPv3. Therefore, the sequence in which you issue the snmp-server commands for
this task does not matter.
SUMMARY STEPS
1. configure
2. (Optional) snmp-server engineid local engine-id
3. snmp-server view view-name oid-tree {included | excluded}
4. snmp-server group name {v1 | v2c | v3 {auth | noauth | priv}} [read view] [write view] [notify view]
[access-list-name]
5. snmp-server user username groupname {v1 | v2c | v3 [auth {md5 | sha} {clear | encrypted}
auth-password [priv des56 {clear | encrypted} priv-password]]} [access-list-name]
6. commit
7. (Optional) show snmp
8. (Optional) show snmp engineid
9. (Optional) show snmp group
10. (Optional) show snmp users
11. (Optional) show snmp view
DETAILED STEPS
Step 3 snmp-server view view-name oid-tree {included | Creates or modifies a view record.
excluded}
Example:
Step 4 snmp-server group name {v1 | v2c | v3 {auth | noauth Configures a new SNMP group or a table that maps SNMP
| priv}} [read view] [write view] [notify view] users to SNMP views.
[access-list-name]
Example:
Step 5 snmp-server user username groupname Configures a new user to an SNMP group.
{v1 | v2c | v3 [auth {md5 | sha} {clear | encrypted}
auth-password [priv des56 {clear | encrypted}
priv-password]]} [access-list-name]
Example:
Step 6 commit
Step 7 (Optional) show snmp Displays information about the status of SNMP.
Example:
Step 8 (Optional) show snmp engineid Displays information about the local SNMP engine.
Example:
Step 9 (Optional) show snmp group Displays information about each SNMP group on the
network.
Example:
Step 10 (Optional) show snmp users Displays information about each SNMP username in the
SNMP users table.
Example:
Step 11 (Optional) show snmp view Displays information about the configured views, including
the associated MIB view family name, storage type, and
Example:
status.
RP/0/RP0/CPU0:router# show snmp view
Setting an Engine ID
This example shows how to set the identification of the local SNMP engine:
Note After the engine ID has been configured, the SNMP agent restarts.
config
show snmp engineid
Creating a View
There are two ways to create a view:
• You can include the object identifier (OID) of an ASN.1 subtree of a MIB family from a view
by using the included keyword of the snmp-server view command.
• You can exclude the OID subtree of the ASN.1 subtree of a MIB family from a view by using
the excluded keyword of the snmp-server view command.
This example shows how to create a view that includes the sysName (1.3.6.1.2.1.1.5) object:
config
snmp-server view SNMP_VIEW1 1.3.6.1.2.1.1.5 included
This example shows how to create a view that includes all the OIDs of a system group:
config
snmp-server view SNMP_VIEW1 1.3.6.1.2.1.1 included
This example shows how to create a view that includes all the OIDs under the system group except
the sysName object (1.3.6.1.2.1.1.5), which has been excluded:
config
snmp-server view SNMP_VIEW1 1.3.6.1.2.1.1 included
snmp-server view SNMP_VIEW1 1.3.6.1.2.1.1.5 excluded
Creating Groups
If you do not explicitly specify a notify, read, or write view, the Cisco IOS XR software uses the v1
default (1.3.6.1). This example shows how to create a group that utilizes the default view:
The following configuration example shows how to create a group that has read access to all the
OIDs in the system except the sysUpTime object (1.3.6.1.2.1.1.3), which has been excluded from
the view applied to the group, but write access only to the sysName object (1.3.6.1.2.1.1.5):
Verifying Groups
This example shows how to verify the attributes of configured groups:
!
snmp-server view view_name 1.3.6.1.2.1.1 included
snmp-server group group_name v3 noauth read view_name write view-name
!
This example shows how to create a noAuthNoPriv user with read and write view access to a system
group:
config
snmp-server user noauthuser group_name v3
Note The user must belong to a noauth group before a noAuthNoPriv user can be created.
This example shows how to verify the attributes that apply to the SNMP user:
!
snmp-server view SNMP_VIEW1 1.3.6.1.2.1.1 included
snmp-server group SNMP_GROUP1 v3 auth notify SNMP_VIEW1 read SNMP_VIEW1 write SNMP_VIEW1
!
This example shows how to create a user with authentication (including encryption), read, and write
view access to a system group:
config
snmp-server user userv3authpriv SNMP_GROUP1 v3 auth md5 password123 priv aes 128 password123
!
snmp-server view view_name 1.3.6.1.2.1.1 included
snmp group group_name v3 priv read view_name write view_name
!
This example shows how to create authNoPriv user with read and write view access to a system
group:
Note Because the group is configured at a security level of Auth, the user must be configured as “auth”
at a minimum to access this group (“priv” users could also access this group). The authNoPriv user
configured in this group, authuser, must supply an authentication password to access the view. In
the example, auth_passwd is set as the authentication password string. Note that clear keyword is
specified before the auth_passwd password string. The clear keyword indicates that the password
string being supplied is unencrypted.
This example shows how to verify the attributes that apply to SNMP user:
!
snmp view view_name 1.3.6.1.2.1.1 included
snmp group group_name v3 priv read view_name write view_name
!
This example shows how to create an authPriv user with read and write view access to a system
group:
config
snmp-server user privuser group_name v3 auth md5 clear auth_passwd priv des56 clear
priv_passwd
Note Because the group has a security level of Priv, the user must be configured as a “priv” user to access
this group. In this example, the user, privuser, must supply both an authentication password and
privacy password to access the OIDs in the view.
This example shows how to verify the attributes that apply to the SNMP user:
Note You can omit Configuring SNMPv3, on page 8 if you have already completed the steps documented under
the Configuring SNMPv3, on page 8 task.
SUMMARY STEPS
1. configure
2. snmp-servergroupname{v1v2v3{auth | noauth | priv}}[readview]writeview] [notifyview]
[access-list-name]
3. snmp-serverusergroupname{v1v2cv3{auth | md5 | sha}{clear | encrypted}auth-password] [priv des56
{clear | access-list-name]
4. snmp-serveruserusernamegroupname{v1v2cv3{auth | md5 | sha}{clear | encrypted}auth-password]
[priv des56 {clear | access-list-name]
5. [ snmp-server host address [traps] [version {1 | 2c | 3 [auth | noauth | priv]}] community-string
[udp-port port] [notification-type]
6. snmp-server traps [notification-type]
7. commit
8. (Optional) show snmp host
DETAILED STEPS
Step 4 snmp-serveruserusernamegroupname{v1v2cv3{auth | Configures a new SNMP group or a table that maps SNMP
md5 | sha}{clear | encrypted}auth-password] [priv des56 users to SNMP views.
{clear | access-list-name]
Example:
RP/0/RP0/CPU0:routerconfig# snmp-server user
noauthuser group_name v3
Step 5 [ snmp-server host address [traps] [version {1 | 2c | 3 Specifies SNMP trap notifications, the version of SNMP
[auth | noauth | priv]}] community-string [udp-port port] to use, the security level of the notifications, and the
[notification-type] recipient (host) of the notifications.
Example:
RP/0/RP0/CPU0:router(config)# snmp-server host
12.26.25.61 traps version 3
noauth userV3noauth
Step 6 snmp-server traps [notification-type] Enables the sending of trap notifications and specifies the
type of trap notifications to be sent.
Example:
RP/0/RP0/CPU0:router(config)# snmp-server traps • If a trap is not specified with the notification-type
bgp argument, all supported trap notifications are enabled
on the router. To display which trap notifications are
available on your router, enter the snmp-server traps
? command.
Step 7 commit
Step 8 (Optional) show snmp host Displays information about the configured SNMP
notification recipient (host), port number, and security
Example:
model.
RP/0/RP0/CPU0:router# show snmp host
Note The default User Datagram Protocol (UDP) port is 161. If you do not a specify a UDP port with the
udp-port keyword and port argument, then the configured SNMP trap notifications are sent to
port 161.
!
snmp-server host 10.50.32.170 version 2c public udp-port 2345
snmp-server host 10.50.32.170 version 3 auth userV3auth udp-port 2345
snmp-server host 10.50.32.170 version 3 priv userV3priv udp-port 2345
snmp-server host 10.50.32.170 version 3 noauth userV3noauth udp-port 2345
snmp-server user userv2c groupv2c v2c
snmp-server user userV3auth groupV3auth v3 auth md5 encrypted 140F0A13
snmp-server user userV3priv groupV3priv v3 auth md5 encrypted 021E1C43 priv des56 encrypted
1110001C
snmp-server user userV3noauth groupV3noauth v3 LROwner
snmp-server view view_name 1.3 included
snmp-server community public RW
snmp-server group groupv2c v2c read view_name
snmp-server group groupV3auth v3 auth read view_name
snmp-server group groupV3priv v3 priv read view_name
snmp-server group groupV3noauth v3 noauth read view_name
!
This example shows how to verify the configuration SNMP trap notification recipients host, the
recipients of SNMP trap notifications. The output displays the following information:
• IP address of the configured notification host
• UDP port where SNMP notification messages are sent
• Type of trap configured
• Security level of the configured user
• Security model configured
config
show snmp host
Setting the Contact, Location, and Serial Number of the SNMP Agent
This task explains how to set the system contact string, system location string, and system serial number of
the SNMP agent.
Note The sequence in which you issue the snmp-server commands for this task does not matter.
SUMMARY STEPS
1. configure
DETAILED STEPS
Step 3 (Optional) snmp-server location system-location Sets the system location string.
Example:
Step 4 (Optional) snmp-server chassis-id serial-number Sets the system serial number.
Example:
RP/0/RP0/CPU0:router(config)# snmp-server
chassis-id 1234456
Step 5 commit
Note The sequence in which you issue the snmp-server commands for this task does not matter.
SUMMARY STEPS
1. configure
2. (Optional) snmp-server packetsize byte-count
3. commit
DETAILED STEPS
RP/0/RP0/CPU0:router(config)# snmp-server
packetsize 1024
Step 3 commit
Note The sequence in which you issue the snmp-server commands for this task does not matter.
SUMMARY STEPS
1. configure
2. (Optional) snmp-server trap-source type interface-path-id
3. (Optional) snmp-server queue-length length
4. (Optional) snmp-server trap-timeout seconds
5. commit
DETAILED STEPS
RP/0/RP0/CPU0:router(config)# snmp-server
trap-source POS 0/0/1/0
Step 3 (Optional) snmp-server queue-length length Establishes the message queue length for each notification.
Example:
RP/0/RP0/CPU0:router(config)# snmp-server
queue-length 20
RP/0/RP0/CPU0:router(config)# snmp-server
trap-timeout 20
Step 5 commit
SUMMARY STEPS
1. configure
2. Use one of the following commands:
• snmp-server ipv4 precedence value
• snmp-server ipv4 dscp value
3. commit
DETAILED STEPS
Step 3 commit
configure
snmp-server ipv4 precedence 7
exit
configure
snmp-server ipv4 dscp 45
exit
SUMMARY STEPS
1. show snmp context-mapping
DETAILED STEPS
Note Entries created in the EVENT-MIB MIB tables using the configuration described in this task cannot be altered
using an SNMP SET.
Entries to the EVENT-MIB MIB tables created using an SNMP SET cannot be altered using the configuration
described in this task.
SUMMARY STEPS
1. snmp-server mibs eventmib packet-loss type interface-path-id falling lower-threshold interval
sampling-interval rising upper-threshold
DETAILED STEPS
SUMMARY STEPS
1. (Optional) snmp-server entityindex persist
2. (Optional) snmp-server mibs cbqosmib persist
DETAILED STEPS
RP/0/RP0/CPU0:router(config)# snmp-server
entityindex persist
Step 2 (Optional) snmp-server mibs cbqosmib persist Enables persistent storage of the
CISCO-CLASS-BASED-QOS-MIB data.
Example:
Step 3 (Optional) snmp-server cbqosmib cache refresh time Enables QoS MIB caching with a specified cache refresh
time time.
Example:
Step 4 (Optional) snmp-server cbqosmib cache service-policy Enables QoS MIB caching with a limited number of service
count count policies to cache.
Example:
Step 5 snmp-server ifindex persist Enables ifIndex persistence globally on all Simple Network
Management Protocol (SNMP) interfaces.
Example:
SUMMARY STEPS
1. configure
2. snmp-server interface subset subset-number regular-expression expression
3. notification linkupdown disable
4. commit
5. (Optional) show snmp interface notification subset subset-number
6. (Optional) show snmp interface notification regular-expression expression
7. (Optional) show snmp interface notification type interface-path-id
DETAILED STEPS
Step 3 notification linkupdown disable Disables linkUp and linkDown traps for all interfaces being
configured. To enable previously disabled interfaces, use
Example:
the no form of this command.
RP/0/RP0/CPU0:router(config-snmp-if-subset)#
notification linkupdown disable
Step 4 commit
Step 5 (Optional) show snmp interface notification subset Displays the linkUp and linkDown notification status for
subset-number all interfaces identified by the subset priority.
Example:
Step 6 (Optional) show snmp interface notification Displays the linkUp and linkDown notification status for
regular-expression expression all interfaces identified by the regular expression.
Example: