Adding an SNMP Community String
A community string is encrypted by
default. You can assign an SNMP community string and indicate whether the string
is
encrypted.
- Enter global configuration mode.
- Add an encrypted community
string and save the configuration.In the example, you must enter the community string "private" to gain SNMP access along with the privileges.
- Configure the access privileges for the community string from one of the following options:
- Set the encryption option for
the community string from one of following options:
- 0: Disables encryption for the community string you specify with the command. The community string is shown as clear text in the running-config and the startup-config files. Use this option if you do not want the display of the community string to be encrypted.
- 1: Assumes that the community string you enter is encrypted, and decrypts the value before using it.
In the example, the community string "private" is added in the clear, which means that the string is displayed in the clear. - (Optional) Associate a view to
the members of the community string.The view that you want must exist before you can associate it to a community string. In the example, the "sysview" view is associated to the community string "private" and the community string has read-only access to "sysview". If no view is specified, access to the full MIB is granted.Note: To make configuration changes, including changes involving SNMP community strings, you must first configure a read-write community string using the CLI. As an alternative, you must configure another authentication method and log in to the CLI using a valid password for that method.
The following example shows how to configure an SNMP community string.
device# configure terminal device(config)# snmp-server community private device(config)# snmp-server community private ro device(config)# snmp-server community 0 private ro device(config)# write memory device(config)# snmp-server community myread ro view sysview