10.
SNMP Server Configuration
MN700004 Rev 01
84
The MIB definition represents a tree where each node in the tree is identified by a number. To
identify a branch in the tree, the usual convention is to use a series of numbers separated by
dots, where each number represents a node in the tree.
The view name is created if it does not exist. If the view definition exists, the defined subtree
is added to the list of view families. If the Object ID already exists, it is replaced by the new
data (type of rule and mask). The mask is optional and defines wildcard characters for
matching multiple Object IDs. The mask is entered as a hexadecimal value, and is interpreted
as a binary value. A binary ‘1’ in the mask states that the Object ID at the corresponding
position should match, a binary ‘0’ states that the Object ID at the corresponding position is
irrelevant – no match is required.
Command Syntax
device-name
(config)#
snmp-server view
VIEW-NAME OID-TREE
{
included
|
excluded
} [
MASK
]
device-name
(config)#
no snmp-server view
VIEW-NAME
[
OID-TREE
]
Argument Description
VIEWNAME
The name of the View. The view name is limited to 32 characters.
OID-TREE
Starting point inside the MIB tree given in dot-notation.
included
The Object-ID is included in the view.
excluded
The Object-ID is excluded from the view.
MASK
Bit-mask defining OID wildcard.
Example 1
The following commands create the view
MyView
and add two rules to it.
•
The first rule enables access to all Object IDs under the MIB-2 tree (all object
identifiers that start with 1.3.6.1.2.1).
•
The second rule disables access to the sysUpTime Object ID.
Grant or denial of access is determined by the most specific rule (with the longest match)
that matches the object ID. When the agent decides whether to grant access to the Object
ID 1.3.6.1.2.1.1.3 – both entered rules of
MyView
match the object. The second rule has a
longer match to the view family and the result is that access is denied (by the
excluded
keyword).
device-name
(config)#
snmp-server view MyView 1.3.6.1.2.1 included
device-name
(config)#
snmp-server view MyView 1.3.6.1.2.1.1.3 excluded
Example 2
ipCidrRouteEntry destination mask TOS next hop
1 3 6 1 2 1 4 24 4 1 0 0 0 0 0 0 0 0 0 192 168 5 1
OID
F F C 0 1 E
1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 1 1 1 0
Bit-
k