Simple Network Management Protocol (SNMP) : Feature Overview and Configuration Guide
Simple Network Management Protocol (SNMP) : Feature Overview and Configuration Guide
Introduction
The Simple Network Management Protocol (SNMP) is a network management protocol for
the Internet and IP-based internetworks.
This guide describes the main features of SNMP Version 1(SNMPv1), SNMP Version 2c
(SNMPv2c) and Version 3 (SNMPv3). It also describes support for SNMP on the switch, and
how to configure the switch’s SNMP agent.
Unless a particular version of SNMP is named, “SNMP” in this guide refers to versions
SNMPv1, SNMPv2c and SNMPv3.
Feature support may change in later software versions. For the latest information, see the
following documents:
The product’s Datasheet
The AlliedWare Plus Datasheet
The product’s Command Reference
These documents are available from the above links on our website at alliedtelesis.com.
Content
Introduction.............................................................................................................................................................................1
Products and software version that apply to this guide .......................................................................1
Network Management Framework...........................................................................................................................3
Structure of Management Information....................................................................................................................5
Names...............................................................................................................................................................................6
Instances...........................................................................................................................................................................7
Syntax ................................................................................................................................................................................8
Access................................................................................................................................................................................8
Status..................................................................................................................................................................................8
Description.....................................................................................................................................................................8
The SNMP Protocol...........................................................................................................................................................9
SNMP versions.............................................................................................................................................................9
SNMP messages ....................................................................................................................................................... 10
Polling versus event notification....................................................................................................................... 10
Message Format for SNMPv1 and SNMPv2c ......................................................................................... 11
SNMPv1 and SNMPv2c ................................................................................................................................................ 12
SNMP MIB views for SNMPv1 and SNMPv2c ....................................................................................... 12
SNMP communities................................................................................................................................................ 12
Configuration example (SNMPv1 and v2)................................................................................................ 14
SNMPv3.................................................................................................................................................................................. 17
SNMPv3 entities....................................................................................................................................................... 18
SNMP MIB views for SNMPv3......................................................................................................................... 19
SNMP groups............................................................................................................................................................. 19
SNMP users ................................................................................................................................................................ 19
Configuration example (SNMPv3) ................................................................................................................ 20
Using SNMP to Manage Files and Software ...................................................................................................... 21
Copy a file to or from a TFTP server ........................................................................................................... 21
Upgrade software and configuration files .................................................................................................. 22
Managed Device
Network
Management
Object Protocol
Object Agent
Object
Object
Network Management
Station
SNMP1
RFC 1905, Protocol Operations for Version 2 of the Simple Network Management Protocol
(SNMPv2)
RFC 1906, Transport Mappings for Version 2 of the Simple Network Management Protocol
(SNMPv2)
RFC 1907, Management Information Base for Version 2 of the Simple Network Management
Protocol (SNMPv2)
RFC 2576, Coexistence between Version 1, Version 2, and Version 3 of the Internet-standard
Network Management Framework
RFC 2578, Structure of Management Information Version 2 (SMIv2)
RFC 2579, Textual Conventions for SMIv2
RFC 2580, Conformance Statements for SMIv2
The MIB is organized into a tree-like hierarchy in which nodes are each assigned an identifier
consisting of a non-negative integer and an optional brief textual description.
Each managed object is represented by a leaf node of the tree and is defined by its name,
syntax, access mode, status, and description. It can also be specifically identified by its unique
position within the tree. This position is expressed as a series of dot-delimited sub-identifiers
that start at the root node and end in the sub-identifier at the particular object’s leaf node.
For example, in Figure 2 the object named interfaces would be uniquely identified by the
string of individual sub-identifiers, 1.3.6.1.2.1.2.
root
dod
mib (1)
(6)
internet (1)
system (1) at (3) icmp (5) udp (7) cmot (9) snmp (11) ... host (25)
interfaces (2) ip (4) tcp (6) egp (8) transmission (10) ... dot1dBridge (17)
SNMP2
Objects defined in the Internet-standard MIB (MIB-II) reside in the mib(1) sub-tree.
Names
Names are used to identify managed objects, and are hierarchical in nature. An object
identifier is a globally unique, authoritatively assigned sequence of non-negative integers
which traverse the MIB tree from the root to the node containing the object.
Since there is no effective limit to the magnitude of non-negative integers, and no effective
limit to the depth of the tree, the MIB provides an unlimited name space.
An object is also usually assigned an object descriptor. The object descriptor is a unique,
mnemonic, printable string intended for humans to use when discussing the MIB.
Instances
Objects are just templates for data types. An actual value that can be manipulated by an
NMS is an instance of an object. An instance is named by appending an instance identifier to
the end of the object’s object identifier. The instance identifier depends on the object’s data
type:
If the object is not a column in a table, the instance identifier is 0 (zero). For example, the
instance of the sysDescr object is:
sysDescr.0
or
1.3.6.1.2.1.1.1.0
If the object is a column in a table, the method used to assign an instance identifier varies.
Typically, the value of the index column or columns is used.
The object ifTable in MIB-II contains information about interfaces and is indexed by the
interface number, ifIndex. The instance of the ifDescr object for the first interface is:
ifDescr.1
or
1.3.6.1.2.1.2.2.1.2.1
If the index column is an IP address, the entire IP address is used as the instance identifier.
The object ipRouteTable in MIB-II contains information about IP routes and is indexed by the
destination address, ipRouteDest. The instance of the ipRouteNextHop object for the route
131.203.9.0 is:
ipRouteNextHop.131.203.9.0
or
1.3.6.1.2.1.4.21.1.7.131.203.9.0
If the table has more than one index, the values of all the index columns are combined to
form the instance identifier. The object tcpConnTable in MIB-II contains information about
existing TCP connections and is indexed by the local IP address (tcpConnLocalAddress), the
local port number (tcpConnLocalPort), the remote IP address (tcpConnRemAddress) and
the remote port number (tcpConnRemPort) of the TCP connection. The instance of the
tcpConnState object for the connection between 131.203.8.36,23 and 131.203.9.197,1066
is:
tcpConnState.131.203.8.36.23.131.203.9.197.1066
or
1.3.6.1.2.1.6.13.1.1.131.203.8.36.23.131.203.9.197.1066
Syntax
The syntax of an object describes the abstract data structure corresponding to that object
type. For example, INTEGER or OCTET STRING.
Access
The access mode of an object describes the level of access for the object.
Table 1: Access modes for MIB objects
ACCESS DESCRIPTION
Status
The status of an object describes the implementation requirements for the object.
Table 2: Status values for MIB objects
STATUS DESCRIPTION
Description
The definition of an object may include an optional textual description of the meaning and
use of the object. This description is often essential for successful understanding of the
object.
SNMP can use a number of different protocols as its underlying transport mechanism, but
the most common transport protocol, and the only one supported by the switch, is UDP.
Therefore the IP module must be enabled and properly configured in order to use SNMP.
SNMP trap messages are sent to UDP port 162; all other SNMP messages are sent to UDP
port 161. The switch’s SNMP agent accepts SNMP messages up to the maximum UDP
length the switch can receive.
SNMP versions
The switch supports SNMP version 1 (SNMPv1), SNMP version 2c (SNMPv2c) and SNMP
Version 3 (SNMPv3). The three versions operate similarly.
SNMPv2c updated the original protocol, and offered the following main enhancements:
a new format for trap messages.
the get-bulk-request PDU allows for the retrieval of large amounts of data, including tables,
with one message.
more error codes mean that error responses to set messages have more detail than is
possible with SNMPv1.
three new exceptions to errors can be returned for get, get-next and get-bulk-request
messages. These are: noSuchObject, noSuchInstance, and endOfMibView.
Support for multiple versions of SNMP is achieved by responding to each SNMP request
with a response of the same version. For example, if an SNMPv1 request is sent to the
switch, an SNMPv1 response is returned. If an SNMPv2c request is sent, an SNMPv2c
response is returned. Therefore, authentication and encryption functions are not invoked
when messages are detected as having either an SNMPv1 or SNMPv2c protocol format.
SNMP messages
The SNMP protocol is termed ‘simple’ because it has only six operations, or messages—get,
get-next, get-response, set, and trap, and SNMPv2c also has the get-bulk-request message.
The replies from the managed device are processed by the NMS and generally used to
provide a graphical representation of the state of the network. The two major SNMP
operations available to a management station for interacting with a client are the get and set
operations. The SNMP set operator can lead to security breaches, since SNMP is not
inherently very secure. When forced to operate in either SNMPv1 or v2 mode, when
operating with older management stations for example, care must be taken in the choice and
safe-guarding of community names, which are effectively passwords for SNMP.
The only time that a managed device initiates an exchange of information is in the special
case of a trap PDU. A managed device may generate a limited set of traps to notify the NMS
of critical events that may affect the ability of the NMS to communicate with the managed
device or other managed devices on the network, and therefore to “manage” the network.
Such events include the restarting or re-initialization of a device, a change in the status of a
network link (up or down), or an authentication failure.
FIELD FUNCTION
Version The version of the SNMP protocol.The value is version-1 (0) for the SNMP
protocol as defined in RFC 1157, or version-2c (1) for the SNMP protocol
as defined in RFC 1902.
Community The name of an SNMP community, for authentication purposes
SNMP PDU An SNMP Protocol Data Unit (PDU).
PDU FUNCTION
VALUE MEANING
When the SNMP agent is disabled, the agent does not respond to SNMP request messages.
The agent is disabled by default. The current state and configuration of the SNMP agent can
be displayed.
Pairing an SNMP community with an SNMP community profile determines the level of access
that the agent affords to an NMS that is a member of the specified community. When an
agent receives an SNMP message, it checks the community name encoded in the message. If
the agent knows the community name, the message is deemed to be authentic and the
sending SNMP entity is accepted as a member of the community. The community profile
associated with the community name then determines the sender’s view of the MIB and the
operations that can be performed on objects in the view.
SNMP communities
SNMP communities were introduced into SNMPv1 and retained in version 2c. Although the
switch’s software still supports communities, this is to provide backward compatibility with
legacy management systems. Communities should not be used where a secure network is
required. Instead, use the secure network features offered by SNMPv3.
An SNMP community is a pairing of an SNMP agent with a set of SNMP application entities.
Communities are the main configuration item in the switch’s implementation of
SNMPv1 and v2, and are defined in terms of a list of IP addresses which define the SNMP
application entities (trap hosts and management stations) in the community.
Important community names act as passwords and provide minimal authentication. Any
SNMP application entity that knows a community name can read the value of any instance of
any object in the MIB implemented in the switch. Any SNMP application entity that knows
the name of a community with write access can change the value of any instance of any
object in the MIB implemented in the switch, possibly affecting the operation of the switch.
For this reason, take care with the security of community names.
When a trap is generated by the SNMP agent it is forwarded to all trap hosts in all
communities. The community name and manager addresses are used to provide trivial
authentication. An incoming SNMP message is deemed authentic if it contains a valid
community name and originated from an IP address defined as a management station for that
community.
When a community is disabled, the SNMP agent behaves as if the community does not exist
and generates authentication failure traps for messages directed to the disabled community.
The SNMP agent does not support a default community called “public” with read-only
access, traps disabled and open access as mandated in RFC 1812, as this is a security hole
open for users who wish to use the switch with minimal modification to the default
configuration. The default configuration of the switch has no defined communities.
Communities must be explicitly created.
SNMP authentication (for SNMPv1 and v2) is a mechanism whereby an SNMP message is
declared to be authentic, that is from an SNMP application entity actually in the community
to which the message purports to belong. The mechanism may be trivial or secure. The only
form of SNMP authentication implemented by the switch’s SNMP agent is trivial
authentication. The authentication failure trap may be generated as a result of the failure to
authentication an SNMP message.
Switch interfaces can be enabled or disabled via SNMP by setting the ifAdminStatus object in
the ifTable of MIB-II MIB to ‘Up(1)’ or ‘Down(2)’ for the corresponding ifIndex. If it is not
possible to change the status of a particular interface the switch returns an SNMP error
message.
The switch’s implementation of the ifOperStatus object in the ifTable of MIB-II MIB supports
two additional values—”Unknown(4)” and “Dormant(5)” (e.g. an inactive dial-on-demand
interface).
Caution An unauthorized person with knowledge of the appropriate SNMP
community name could bring an interface up or down. Community names
act as passwords for the SNMP protocol. When creating an SNMP
community with write access, take care to select a secure community name
and to ensure that only authorized personnel know it.
An SNMP MIB view is a subset of objects in the MIB that pertain to a particular network
element. For example, the MIB view of a hub would be the objects relevant to management
of the hub, and would not include IP routing table objects, for example. The switch’s SNMP
agent does not allow the construction of MIB views. The switch supports all relevant objects
from all MIBs that it implements.
Note that the switch’s standard set and show commands can also be used to access objects
in the MIBs supported by the switch.
Defining You can add management stations to a community either individually, by entering just its IP
management address, or you can enter a range of management stations by entering an IP address that
stations within ends with a ‘/’ character followed by a number between 1 and 32.
communities
The number that follows the ‘/’ character operates as an address mask to define a range of
addresses for the management stations. The following example shows how to allocate a
band of three binary addresses to a portion of the subnet 146.15.1.X
Example In this example we make provision for up to 8 possible management stations within a
community called “admin”.
Decide on the number of management stations that you want to assign to a particular
subnet, then decide how many binary digits are required to define this number of addresses.
In this case we need up to 8 management stations, so we will assign 3 binary digits (3 binary
digits can provide 8 different values). To assign the last 3 binary digits for management
stations, we assign a prefix that is a count of all binary digits in the address minus those to be
assigned as management stations. In this case the prefix is 29; this being the number of binary
digits in an IP address (32) minus the number of digits assigned to the management stations
(3).
The method used in this step depends on whether or not the community already exists.
If the community called “admin” does not exist, create a new community called “admin”
and allocate a three binary digit block of addresses to the address subnet 146.15.1.X.
If the community called “admin” already exists, allocate a three binary digit block of
addresses to an existing community called “admin” with the address subnet 146.15.1.X.
For security reasons, the common management prefix should be larger than the IP subnet.
This prevents stations on one subnet from being considered valid management stations on a
different subnet.
IP and VLANs must be correctly configured in order to access the SNMP agent in the switch.
This is because the IP module handles both the TCP transport functions, and the UDP
functions that enable datagrams to transport SNMP messages.
Step 2: Create a community with write access for the central NMS.
Create a write access community called “example1rw” for use by the central network
management station at 192.168.11.5 Use an ACL to give the central NMS SNMP access to
the switch using that community name.
awplus(config)# access-list 66 permit 192.168.11.5
awplus(config)# snmp-server community example1rw rw 66
Care must be taken with the security of community names. Do not use the names “private”
or “public” in your network because they are too obvious. Community names act as
passwords and provide only trivial authentication. Any SNMP application entity that knows a
community name can read the value of any instance of any object in the MIB implemented in
the switch. Any SNMP application entity that knows the name of a community with write
access can change the value of any instance of any object in the MIB implemented in the
switch, possibly affecting the operation of the switch.
SNMP V1 or V2c provide very minimal security. If security is a concern, you should use
SNMPv3.
Step 3: Create a community with read-only access for the regional NMS.
Create a read-only access community called “example2ro” for use by the regional network
management station at 192.168.16.1. Use an ACL to give the regional NMS SNMP access to
the switch using that community name.
awplus(config)# access-list 67 permit 192.168.16.1
awplus(config)# snmp-server community example2ro ro 67
Note that link traps on VLANs are sent when the last port in the VLAN goes down. You will
only see a trap for a VLAN if the trap host is in a different VLAN.
You can also enable link traps on channel groups and switch ports. For example, to enable
traps on a range of switch ports:
awplus(config)# int port1.0.4-1.0.6
awplus(config)# int port1.1.5-1.1.7
awplus(config-if)# snmp trap link-status
You can also enable link traps on channel groups and switch ports. For example, to enable
traps on a range of switch ports:
This is the output of the show snmp-server community command for this example:
SNMP community information:
Community Name ........... example1rw
Access ................. Read-write
View ................... none
Community Name ........... example2ro
Access ................. Read-only
View ................... none
This is the output of the show run snmp command for this example:
no snmp-server ip
snmp-server enable trap auth
snmp-server community example1rw rw 66
snmp-server community example2ro 67
snmp-server host 192.168.1.2 version 2c example1rw
snmp-server host 192.168.2.2 version 2c example2ro
!
Check that the interface link up/down traps have been correctly configured:
awplus# show interface vlan1-3
This is the output of the show interface command for this example:
Interface vlan1
Scope: both
Link is UP, administrative state is UP
Hardware is VLAN, address is 0009.41fd.c029
index 201 metric 1 mtu 1500
arp ageing timeout 300
<UP,BROADCAST,RUNNING,MULTICAST>
VRF Binding: Not bound
SNMP link-status traps: Sending (suppressed after 20 traps in 60 sec)
Bandwidth 1g
input packets 4061, bytes 277043, dropped 0, multicast packets 3690
output packets 190, bytes 18123, multicast packets 0 broadcast packets 0
Interface vlan2
Scope: both
Link is DOWN, administrative state is UP
Hardware is VLAN, address is 0009.41fd.c029
IPv4 address 192.168.11.50/24 broadcast 192.168.11.255
index 202 metric 1 mtu 1500
arp ageing timeout 300
<UP,BROADCAST,MULTICAST>
VRF Binding: Not bound
SNMP link-status traps: Sending (suppressed after 20 traps in 60 sec)
Bandwidth 1g
input packets 568, bytes 42309, dropped 0, multicast packets 0
output packets 183, bytes 18078, multicast packets 0 broadcast packets 0
Interface vlan3
Scope: both
Link is DOWN, administrative state is UP
Hardware is VLAN, address is 0009.41fd.c029
IPv4 address 192.168.16.50/24 broadcast 192.168.16.255
index 203 metric 1 mtu 1500
arp ageing timeout 300
<UP,BROADCAST,MULTICAST>
VRF Binding: Not bound
SNMP link-status traps: Sending (suppressed after 20 traps in 60 sec)
input packets 0, bytes 0, dropped 0, multicast packets 0
output packets 0, bytes 0, multicast packets 0 broadcast packets 0
SNMPv3
SNMPv3 is the third version of the Simple Network Management Protocol. The architecture
comprises the following:
entities that may be either managers, agents, or both
a management information base (MIB)
a transport protocol
At least one manager node runs the SNMP management software in every configuration.
Managed devices such as routers, servers, and workstations are equipped with an agent
software module. The agent provides access to local objects in the MIB that reflect activity
and resources at the node. The agent also responds to manager commands to retrieve
values from, and set values in the MIB.
SNMPv3 entities
Entities comprise one of the basic components of the SNMPv3 enhanced architecture. They
define the functionality and internal structure of the SNMP managers and agents. An in-depth
description of entities can be found in RFC 3411, on which the following text is based.
SNMPv3 defines two entity types, a manager and an agent. Both entity types contain two
basic components: an SNMP engine and a set of applications.
SNMP engine
The engine provides the basic services to support the agents component applications, in this
respect it performs much of the functionality expected of the ISO Session and Presentation
layers. These functions include message transmission and reception, authentication and
encryption, and access control to its managed objects database (MIB). The SNMP engine
comprises the following components:
Dispatcher
Message processing Subsystem
Security Subsystem
Access Control Subsystem
The only security subsystem presently supported is the user based security model (USM).
Each SNMP engine is identified by an snmpEngineID that must be unique within the
management system. A one to one association exists between an engine and the entity that
contains it.
Entity applications
The following applications are defined within the agent applications:
Command Generator
Notification Receiver
Proxy Forwarder
Command Responder
Notification Originator
Other
SNMP groups
Groups were introduced as part of SNMPv3. They are the means by which users are
assigned their views and access control policy. Once a group has been created, users can be
added to them. In practice a number of groups would be created, each with varying views
and access security requirements. Users would then be added to their most appropriate
groups. Each Group name and Security Level pair must be unique within a switch.
SNMP users
Users were introduced as part of SNMPv3. From a system perspective a user is represented
as an entity stored in a table that defines the access and authentication criteria to be applied
to access or modify the SNMP MIB data.
Note: SNMP Target Addresses and Target Params in SNMPv3 are not currently supported
in Alliedware Plus software
VALUE MEANING
VALUE MEANING
msgUserName The name of the user (principal) on whose behalf the message is
being exchanged.
msgAuthenticationParameters If the message has been authenticated, this field contains a
serialized OCTET STRING representing the first 12 octets of the
HMAC-MD5-96 output done over the whole message.
msgPrivacyParameters For encrypted data, this field contains the “salt” used to create the
DES encryption Initialization Vector (IV).
ContextEngineID Within a particular administrative domain, this field uniquely
identifies an SNMP entity that may realize an instance of a context
with a particular ContextName
ContextName A unique name given to a context within a particular SNMP entity.
The IP module must be enabled and correctly configured in order to access the SNMP agent
in the switch, since the IP module handles the UDP datagrams used to transport SNMP
messages.
DO THIS ... BY SETTING OR READING THIS WHOSE OBJECT ID IS ... TO THIS VALUE ...
MIB OBJECT ...
1. If the source device is part of a atFilev2SourceStackId { atFilev2Operation 1 } <stack-id>
stack, set the stack ID.
For a standalone switch, keep
the default value, 1.
2. If the destination device is part atFilev2DestinationStackId { atFilev2Operation 4 } <stack-id>
of a stack, set the stack ID.
3. Set the source device. atFilev2SourceDevice { atFilev2Operation 2 } 4 (TFTP) or
1 (Flash)
4. Set the destination device. atFilev2DestinationDevice { atFilev2Operation 5 } 4 (TFTP) or
1 (Flash)
5. Set the source filename. Include atFilev2SourceFileName { atFilev2Operation 3 } <source-filename>
the path (if any) but not the e.g. /awp/config/
device. admin.cfg
6. Set the destination filename. atFilev2DestinationFileName { atFilev2Operation 6 } <dest-filename>
Include the path (if any) but not e.g. /config/admin.cfg
the device.
7. Set the IP address of the TFTP atFilev2TftpIPAddr { atFilev2Tftp_4 1 } <ip-addr>
server.
8. Check that no other transfer is atFilev2CopyBegin { atFilev2Operation 7 } Read: idle
in progress, and that the
required parameters have been
set.
9. Start the file transfer. atFilev2CopyBegin { atFilev2Operation 7 } Set: 1
Table 7: Procedure for copying a file to or from a device using a TFTP server (Continued)
DO THIS ... BY SETTING OR READING THIS WHOSE OBJECT ID IS ... TO THIS VALUE ...
MIB OBJECT ...
10. Monitor file transfer progress. atFilev2CopyBegin { atFilev2Operation 7 } Read:
In progress:
copying <src> --> <dst>
or
Success:
copy <src> --> <dst>
success
or
Failure:
copy <src> --> <dst>
failure: <err-msg>
Table 8: Procedure for upgrading to a new software version and boot configuration (Continued)
C613-22052-00 REV A
North America Headquarters | 19800 North Creek Parkway | Suite 100 | Bothell | WA 98011 | USA | T: +1 800 424 4284 | F: +1 425 481 3895
Asia-Pacific Headquarters | 11 Tai Seng Link | Singapore | 534182 | T: +65 6383 3832 | F: +65 6383 3830
EMEA & CSA Operations | Incheonweg 7 | 1437 EK Rozenburg | The Netherlands | T: +31 20 7950020 | F: +31 20 7950021
alliedtelesis.com
© 2015 Allied Telesis Inc. All rights reserved. Information in this document is subject to change without notice. All company names, logos, and product designs that are trademarks or registered trademarks are the property of their respective owners.