Name
snmp-server view — global
Synopsis
snmp-server viewview-nameoid-tree{excluded | included} no snmp-server view
Configures
An SNMP view
Default
None
Description
This command defines an SNMP
view that can be used in
the snmp-server
community
command. A view is a list of SNMP object trees. By default, the
entire SNMP object tree is available for access. A view restricts
access to some subset of the entire tree. Different views can be made
available to different SNMP communities.
-
viewview-name A unique name that identifies this SNMP view.
-
oid-tree An SNMP object ID (in either numeric or human-readable form). All nodes underneath the given object belong to the tree. Asterisks can be used as wildcards when specifying the object ID.
-
excludedorincluded Specifies whether the given
oid-treeis included in or excluded from the view.
Example
Say that you want to give some group SNMP access to the
ifEntry table for interface 2. (Perhaps this group
is connected to the router through interface 2. Note that the
interface number here is an index into the SNMP interface table, not
an IOS interface name.) To achieve this, define a view:
snmp-server view subset2 ifEntry.*.2 included
Then set the community string for this view:
snmp-server community sub2in view subset2 RO
Now users can use the community string sub2in to
access the ifEntry table for interface 2, but
aren’t allowed to access other SNMP objects.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access