O'Reilly logo

Cisco IOS in a Nutshell, 2nd Edition by James Boney

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

snmp-server view — global

Synopsis

snmp-server view view-name oid-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.

view view-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.

excluded or included

Specifies whether the given oid-tree is 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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required