Cisco Nexus 3000 System MGMT Config GD 503 U2 2 Chapter11
Cisco Nexus 3000 System MGMT Config GD 503 U2 2 Chapter11
Cisco Nexus 3000 System MGMT Config GD 503 U2 2 Chapter11
Note Cisco NX-OS does not support SNMP sets for Ethernet MIBs.
Cisco Nexus 3000 Series NX-OS System Management Configuration Guide, Release 5.0(3)U2(2)
OL-25768-01 1
Configuring SNMP
SNMP Notifications
The Cisco Nexus 3000 Series switch supports SNMPv1, SNMPv2c and SNMPv3. Both SNMPv1 and SNMPv2c
use a community-based form of security. SNMP is defined in RFC 3410 (http://tools.ietf.org/html/rfc3410),
RFC 3411 (http://tools.ietf.org/html/rfc3411), RFC 3412 (http://tools.ietf.org/html/rfc3412), RFC 3413 (http:/
/tools.ietf.org/html/rfc3413), RFC 3414 (http://tools.ietf.org/html/rfc3414), RFC 3415 (http://tools.ietf.org/
html/rfc3415), RFC 3416 (http://tools.ietf.org/html/rfc3416), RFC 3417 (http://tools.ietf.org/html/rfc3417),
RFC 3418 (http://tools.ietf.org/html/rfc3418), and RFC 3584 (http://tools.ietf.org/html/rfc3584).
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. Notifications can indicate improper user
authentication, restarts, the closing of a connection, loss of connection to a neighbor router, or other significant
events.
Cisco NX-OS generates SNMP notifications as either traps or informs. Traps are less reliable than informs
because the SNMP manager does not send any acknowledgment when it receives a trap. The switch 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 Cisco Nexus 3000 Series switch never
receives a response, it can send the inform request again.
You can configure Cisco NX-OS to send notifications to multiple host receivers.
SNMPv3
SNMPv3 provides secure access to devices by a combination of authenticating and encrypting frames over
the network. The security features provided in SNMPv3 are the following:
• Message integrity—Ensures that a packet has not been tampered with in-transit.
• Authentication—Determines the message is from a valid source.
• Encryption—Scrambles the packet contents to prevent it from being seen by unauthorized sources.
SNMPv3 provides for both security models and security levels. A security model is an authentication strategy
that is set up for a user and the role 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 determines which security
mechanism is employed when handling an SNMP packet.
Three security models are available: SNMPv1, SNMPv2c, and SNMPv3. The security model combined with
the security level determine the security mechanism applied when the SNMP message is processed.
Cisco Nexus 3000 Series NX-OS System Management Configuration Guide, Release 5.0(3)U2(2)
2 OL-25768-01
Configuring SNMP
SNMPv3
SNMPv3 User-Based Security Model (USM) refers to SNMP message-level security and offers the following
services:
• Message integrity—Ensures that messages have not been altered or destroyed in an unauthorized manner
and that data sequences have not been altered to an extent greater than can occur non-maliciously.
Cisco Nexus 3000 Series NX-OS System Management Configuration Guide, Release 5.0(3)U2(2)
OL-25768-01 3
Configuring SNMP
SNMPv3
• Message origin authentication—Ensures that the claimed identity of the user on whose behalf received
data was originated is confirmed.
• Message confidentiality—Ensures that information is not made available or disclosed to unauthorized
individuals, entities, or processes.
SNMPv3 authorizes management operations only by configured users and encrypts SNMP messages.
Cisco NX-OS uses two authentication protocols for SNMPv3:
• HMAC-MD5-96 authentication protocol
• HMAC-SHA-96 authentication protocol
Cisco NX-OS uses Advanced Encryption Standard (AES) as one of the privacy protocols for SNMPv3 message
encryption and conforms with RFC 3826.
The priv option offers a choice of DES or 128-bit AES encryption for SNMP security encryption. The priv
option along with the aes-128 token indicates that this privacy password is for generating a 128-bit AES
key.The AES priv password can have a minimum of eight characters. If the passphrases are specified in clear
text, you can specify a maximum of 64 characters. If you use the localized key, you can specify a maximum
of 130 characters.
Note For an SNMPv3 operation using the external AAA server, you must use AES for the privacy protocol in
user configuration on the external AAA server.
Cisco Nexus 3000 Series NX-OS System Management Configuration Guide, Release 5.0(3)U2(2)
4 OL-25768-01
Configuring SNMP
Configuration Guidelines and Limitations
Note When you configure passphrase/password in localized key/encrypted format, Cisco NX-OS does not
synchronize the password.
Note Because group is a standard SNMP term used industry-wide, roles are referred to as groups in this SNMP
section.
SNMP access rights are organized by groups. Each group in SNMP is similar to a role through the CLI. Each
group is defined with three accesses: read access, write access, and notification access. Each access can be
enabled or disabled within each group.
You can begin communicating with the agent once your user name is created, your roles are set up by your
administrator, and you are added to the roles.
Configuring SNMP
Configuring SNMP Users
To configure a user for SNMP, perform this task:
SUMMARY STEPS
Cisco Nexus 3000 Series NX-OS System Management Configuration Guide, Release 5.0(3)U2(2)
OL-25768-01 5
Configuring SNMP
Enforcing SNMP Message Encryption
DETAILED STEPS
Step 2 switch(config)# snmp-server user name [auth {md5 | Configures an SNMP user with authentication and
sha} passphrase [auto] [priv [aes-128] passphrase] privacy parameters.
[engineID id] [localizedkey]]
Step 3 switch# show snmp user (Optional)
Displays information about one or more SNMP users.
Command Purpose
switch(config)# snmp-server user name enforcePriv Enforces SNMP message encryption for this user.
Command Purpose
switch(config)# snmp-server globalEnforcePriv Enforces SNMP message encryption for all users.
Note Only users belonging to a network-admin role can assign roles to other users.
Command Purpose
switch(config)# snmp-server user name group Associates this SNMP user with the configured user
role.
Cisco Nexus 3000 Series NX-OS System Management Configuration Guide, Release 5.0(3)U2(2)
6 OL-25768-01
Configuring SNMP
Creating SNMP Communities
Command Purpose
switch(config)# snmp-server community name Creates an SNMP community string.
group {ro | rw}
The ACL applies to both IPv4 and IPv6 over UDP and TCP. After creating the ACL, assign the ACL to the
SNMP community.
Use the following command in global configuration mode to assign an ACL to a community to filter SNMP
requests:
Command Purpose
switch(config)# snmp-server community community Assigns an ACL to an SNMP community to filter
name use-acl acl-name SNMP requests.
Example:
switch(config)# snmp-server community public
use-acl my_acl_for_public
Tip For more information on creating ACLs, see the NX-OS Security Configuration Guide for the Cisco Nexus
Series software that you are using. The security configuration guides available for Nexus 3000 can be
found here: http://www.cisco.com/en/US/products/ps11541/products_installation_and_configuration_
guides_list.html.
Cisco Nexus 3000 Series NX-OS System Management Configuration Guide, Release 5.0(3)U2(2)
OL-25768-01 7
Configuring SNMP
Configuring SNMP Notification Receivers
Command Purpose
switch(config)# snmp-server host ip-address traps Configures a host receiver for SNMPv1 traps. The
version 1 community [udp_port number] community can be any alphanumeric string up to 255
characters. The UDP port number range is from 0 to
65535.
You can configure a host receiver for SNMPv2c traps or informs in a global configuration mode.
Command Purpose
switch(config)# snmp-server host ip-address {traps Configures a host receiver for SNMPv2c traps or
| informs} version 2c community [udp_port number] informs. The community can be any alphanumeric
string up to 255 characters. The UDP port number
range is from 0 to 65535.
You can configure a host receiver for SNMPv3 traps or informs in a global configuration mode.
Command Purpose
switch(config)# snmp-server host ip-address {traps Configures a host receiver for SNMPv2c traps or
| informs} version 3 {auth | noauth | priv} username informs. The username can be any alphanumeric
[udp_port number] string up to 255 characters. The UDP port number
range is from 0 to 65535.
Note The SNMP manager must know the user credentials (authKey/PrivKey) based on the SNMP engineID of
the Cisco Nexus 3000 Series switch to authenticate and decrypt the SNMPv3 messages.
The following example shows how to configure a host receiver for an SNMPv1 trap:
switch(config)# snmp-server host 192.0.2.1 traps version 1 public
The following example shows how to configure a host receiver for an SNMPv2 inform:
switch(config)# snmp-server host 192.0.2.1 informs version 2c public
The following example shows how to configure a host receiver for an SNMPv3 inform:
switch(config)# snmp-server host 192.0.2.1 informs version 3 auth NMS
Cisco Nexus 3000 Series NX-OS System Management Configuration Guide, Release 5.0(3)U2(2)
8 OL-25768-01
Configuring SNMP
Enabling SNMP Notifications
The Cisco Nexus 3000 Series switch uses the credentials of the notification target user to encrypt the SNMPv3
inform notification messages to the configured notification host receiver.
Note For authenticating and decrypting the received INFORM PDU, The notification host receiver should have
the same user credentials as configured in the Cisco Nexus 3000 Series switch to authenticate and decrypt
the informs.
Command Purpose
switch(config)# snmp-server user name [auth {md5 Configures the notification target user with the
| sha} passphrase [auto] [priv [aes-128] passphrase] specified engine ID for notification host receiver. The
[engineID id] engineID format is a 12-digit colon-separated
hexadecimal number.
Note The snmp-server enable traps CLI command enables both traps and informs, depending on the configured
notification host receivers.
The following table lists the CLI commands that enable the notifications for Cisco NX-OS MIBs.
Cisco Nexus 3000 Series NX-OS System Management Configuration Guide, Release 5.0(3)U2(2)
OL-25768-01 9
Configuring SNMP
Enabling SNMP Notifications
To enable the specified notification in the global configuration mode, perform one of the following tasks:
Command Purpose
switch(config)# snmp-server enable traps Enables all SNMP notifications.
switch(config)# snmp-server enable traps aaa Enables the AAA SNMP notifications.
[server-state-change]
switch(config)# snmp-server enable traps entity Enables the ENTITY-MIB SNMP notifications.
[fru]
switch(config)# snmp-server enable traps license Enables the license SNMP notification.
Cisco Nexus 3000 Series NX-OS System Management Configuration Guide, Release 5.0(3)U2(2)
10 OL-25768-01
Configuring SNMP
Configuring Link Notifications
Command Purpose
switch(config)# snmp-server enable traps Enables the port security SNMP notifications.
port-security
switch(config)# snmp-server enable traps snmp Enables the SNMP agent notifications.
[authentication]
SUMMARY STEPS
DETAILED STEPS
Step 2 switch(config)# snmp-server enable traps link [cisco] [ietf Enables the link SNMP notifications.
| ietf-extended]
Cisco Nexus 3000 Series NX-OS System Management Configuration Guide, Release 5.0(3)U2(2)
OL-25768-01 11
Configuring SNMP
Disabling Link Notifications on an Interface
SUMMARY STEPS
DETAILED STEPS
Step 3 switch(config -if)# no snmp trap link-status Disables SNMP link-state traps for the interface. Enabled
by default.
Command Purpose
switch(config)# snmp-server tcp-session [auth] Enables a one-time authentication for SNMP over a
TCP session. Default is disabled.
SUMMARY STEPS
Cisco Nexus 3000 Series NX-OS System Management Configuration Guide, Release 5.0(3)U2(2)
12 OL-25768-01
Configuring SNMP
Configuring the Context to Network Entity Mapping
DETAILED STEPS
Step 2 switch(config)# snmp-server contact name Configures sysContact, the SNMP contact name.
Step 3 switch(config)# snmp-server location name Configures sysLocation, the SNMP location.
SUMMARY STEPS
DETAILED STEPS
Step 2 switch(config)# snmp-server context context-name Maps an SNMP context to a protocol instance, VRF, or topology.
[instance instance-name] [vrf vrf-name] [topology The names can be any alphanumeric string up to 32 characters.
topology-name]
Step 3 switch(config)# snmp-server mib community-map Maps an SNMPv2c community to an SNMP context. The names
community-name context context-name can be any alphanumeric string up to 32 characters.
Cisco Nexus 3000 Series NX-OS System Management Configuration Guide, Release 5.0(3)U2(2)
OL-25768-01 13
Configuring SNMP
Configuring SNMP for Inband Access
SUMMARY STEPS
DETAILED STEPS
Step 2 switch(config)# snmp-server context context-name Maps an SNMP context to a VRF. The names can be any
vrf vrf-name alphanumeric string up to 32 characters.
Step 3 switch(config)# snmp-server community Maps an SNMPv2c community to an SNMP context and
community-name group group-name identifies the group that the community belongs. The names
can be any alphanumeric string up to 32 characters.
Step 4 switch(config)# snmp-server mib community-map Maps an SNMPv2c community to an SNMP context. The names
community-name context context-name can be any alphanumeric string up to 32 characters.
The following SNMPv2 example shows how to map a community named snmpdefault to a context:
switch# config t
Enter configuration commands, one per line. End with CNTL/Z.
switch(config)# snmp-server context def vrf default
switch(config)# snmp-server community snmpdefault group network-admin
switch(config)# snmp-server mib community-map snmpdefault context def
switch(config)#
Cisco Nexus 3000 Series NX-OS System Management Configuration Guide, Release 5.0(3)U2(2)
14 OL-25768-01
Configuring SNMP
Verifying SNMP Configuration
The following SNMPv2 example shows how to configure and inband access to the community comm which
is not mapped:
switch# config t
Enter configuration commands, one per line. End with CNTL/Z.
switch(config)# snmp-server context def vrf default
switch(config)# snmp-server community comm group network-admin
switch(config)#
The following SNMPv3 example shows how to use a v3 username and password:
switch# config t
Enter configuration commands, one per line. End with CNTL/Z.
switch(config)# snmp-server context def vrf default
switch(config)#
Command Purpose
switch# show snmp Displays the SNMP status.
switch# show snmp trap Displays the SNMP notifications enabled or disabled.
Parameters Default
license notifications enabled
Cisco Nexus 3000 Series NX-OS System Management Configuration Guide, Release 5.0(3)U2(2)
OL-25768-01 15
Configuring SNMP
Default SNMP Settings
Cisco Nexus 3000 Series NX-OS System Management Configuration Guide, Release 5.0(3)U2(2)
16 OL-25768-01