H3C S5120-SI Series Command Reference Manual page 653

Hide thumbs Also See for S5120-SI Series:
Table of Contents

Advertisement

mib-view view-name: S Specifies MIB objects that the NMS can access, view-name represents the
MIB view name, a string of 1 to 32 characters. If no keyword is specified, the default view is ViewDefault
(The view created by the system after SNMP agent is enabled).
Description
Use the snmp-agent community command to create a new SNMP community. Parameters to be
configured include access right, community name, ACL, and accessible MIB views.
Use the undo snmp-agent community command to delete a specified community.
This command can be applied in SNMPv1 and v2c networking environments.
A community is composed of NMSs and SNMP agents, and is identified by the community name, which
functions as a password. In a community, when devices communicate with each other, they use
community name for authentication. The NMS and the SNMP agent can access each other only when
they are configured with the same community name. Typically, public is used as the read-only
community name, and private is used as the read and write community name. For security purposes,
you are recommended to configure a community name other than public and private.
The keyword acl specifies that only the NMS with a qualified IP address can access the agent.
The argument community-name specifies the community name used by the NMS when it accesses
the agent.
The keyword mib-view specifies the MIB objects which the NMS can access.
The keywords read and write specify the access type.
Related commands: snmp-agent mib-view.
Examples
# Create a community with the name of readaccess, allowing read-only access right using this
community name.
<Sysname> system-view
[Sysname] snmp-agent sys-info version v1 v2c
[Sysname] snmp-agent community read readaccess
Set the SNMP version on the NMS to SNMPv1 or SNMPv2c
Fill in the read-only community name readaccess
Establish a connection, and the NMS can perform read-only operations to the MIB objects in the
ViewDefault view on the device
# Create a community with the name of writeaccess, allowing only the NMS with the IP address of
1.1.1.1 to configure the values of the agent MIB objects by using this community name; other NMSs are
not allowed to perform the write operations by using this community name.
<Sysname> system-view
[Sysname] acl number 2001
[Sysname-acl-basic-2001] rule permit source 1.1.1.1 0.0.0.0
[Sysname-acl-basic-2001] rule deny source any
[Sysname-acl-basic-2001] quit
[Sysname] snmp-agent sys-info version v2c
[Sysname] snmp-agent community write writeaccess acl 2001
Set the IP address of the NMS to 1.1.1.1
Set the SNMP version on the NMS to SNMPv2c
1-14

Advertisement

Table of Contents
loading

Table of Contents