The no snmp-server command disables all versions of SNMP (SNMPv1, SNMPv2C, SNMPv3).
The first snmp-server command that you enter enables all versions of SNMP.
To configure SNMP community strings for the MPLS LDP MIB, use the snmp-server community command on the host network management station (NMS).
In Cisco IOS Release 12.0(3) to 12.2(33)SRD, if a community string was not defined using the snmp-server community command prior to using the snmp-server host command, the default form of the snmp-server community command was automatically inserted into the configuration. The password (community string) used for this automatic configuration of the snmp-server community was same as specified in the snmp-server host command. However, in Cisco IOS Release 12.2(33)SRE and later releases, you have to manually configure the snmp-server community command.
The snmp-server community command can be used to specify only an IPv6 named access list, only an IPv4 access list, or both. For you to configure both IPv4 and IPv6 access lists, the IPv6 access list must appear first in the command statement.
The @ symbol is used as a delimiter between the community string and the context in which it is used. For example, specific VLAN information in BRIDGE-MIB may be polled using community@VLAN_ID (for example, public@100) where 100 is the VLAN number. Avoid using the @ symbol as part of the SNMP community string when configuring this command.
The following example shows how to set the read/write community string to newstring:
Router(config)# snmp-server community newstring rw
The following example shows how to allow read-only access for all objects to members of the standard named access list lmnop that specify the comaccess community string. No other SNMP managers have access to any objects.
Router(config)# snmp-server community comaccess ro lmnop
The following example shows how to assign the string comaccess to SNMP, allow read-only access, and specify that IP access list 4 can use the community string:
Router(config)# snmp-server community comaccess ro 4
The following example shows how to assign the string manager to SNMP and allow read-write access to the objects in the restricted view:
Router(config)# snmp-server community manager view restricted rw
The following example shows how to remove the community comaccess:
Router(config)# no snmp-server community comaccess
The following example shows how to disable all versions of SNMP:
Router(config)# no snmp-server
The following example shows how to configure an IPv6 access list named list1 and links an SNMP community string with this access list:
Router(config)# ipv6 access-list list1
Router(config-ipv6-acl)# permit ipv6 any any
Router(config)# snmp-server community comaccess rw ipv6 list1