snmp-server community
snmp-server community
community-string
{
ro
|
rw
}
[
acl-name
|
acl-num
|
ipv6
ipv6-acl-name
|
view
[
mib-view
]
]
no snmp-server community
community-string
{
ro
|
rw
}
[
acl-name
|
acl-num
|
ipv6
ipv6-acl-name
|
view
[
mib-view
]
]
The SNMP community string is not configured.
Global configuration mode
The view mib-view parameter allows you to associate a view to the members of this community string. If no view is specified, access to the full MIB is granted. The view that you want must exist before you can associate it to a community string.
You can set just one access type, either read-only (ro) or read/write (rw) for a single SNMP community instead of setting both access types. The read/write access supersedes read-only configuration and if read/write is configured for a specified community after read only, the running configuration file only saves the rw configuration line.
If you issue the
no snmp-server community public ro command and then enter the
write memory command to save the configuration, the read-only "public" community string is removed
and will have no SNMP access. If for some reason the device is brought down and then
brought up, the
no snmp-server community public ro command is restored in the system and the read-only "public" community string has
no SNMP access.
The
no form of the command removes an SNMP community string.
The following example configures an SNMP community string with read-only access.
device# configure terminal device(config)# snmp-server community private ro
The following example configures and applies an ACL to filter SNMP packets.
device# configure terminal device(config)# ip access-list standard 25 device(config-std-ipacl-25)# deny host 10.157.22.98 log device(config-std-ipacl-25)# deny 10.157.23.0 0.0.0.255 log device(config-std-ipacl-25)# deny 10.157.24.0 0.0.0.255 log device(config-std-ipacl-25)# permit any device(config-std-ipacl-25)# exit device(config)# ip access-list standard 30 device(config-std-ipacl-30)# deny 10.157.25.0 0.0.0.255 log device(config-std-ipacl-30)# deny 10.157.26.0/24 log device(config-std-ipacl-30)# permit any device(config-std-ipacl-30)# exit device(config)# snmp-server community public ro 25 device(config)# snmp-server community private rw 30 device(config)# write memory