Twitter
RSS

How To Configure SNMP Community Strings on a Router

How To Configure SNMP Community Strings on a Router and a Cisco IOS Software−based XL Catalyst Switch
Enable SNMP Community Strings
The procedure listed below is the same for both routers and Cisco IOS software−based XL Catalyst Switches.
Telnet to the router:
prompt# telnet 172.16.99.20

1.Enter the enable mode by entering the enable password at the prompt:
Router>enable
Password:
Router#
2.Display the running configuration and look for the SNMP information:
Router#show running−config
Building configuration...
....
Note: If no SNMP information is present, continue with the steps below. If any SNMP commands are
listed, you can modify or disable them.
3.Go into the configuration mode:
Router#configure terminal
Enter configuration commands, one per line. End
with CNTL/Z.
Router(config)#
4.Use the command below to enable the Read−only (RO) community string:
Router(config)#snmp−server community public RO
where "public" is the Read−only community string.
5.Use the command below to enable the Read−write (RW) community string:
Router(config)#snmp−server community private RW
where "private" is the Read−write community string.
6.Exit out of the configuration mode and return to the main prompt:
Router(config)#exit
Router#
7. Write the modified configuration to nonvolatile RAM (NVRAM) to save the settings:
Router#write memory
Building configuration...
[OK]
Router#

Verify SNMP Community Strings:
Here is how to verify SNMP community strings.
Verify that there is TCP/IP connectivity between the Network Management Server (NMS) server and
the router:
C:\>ping 172.16.99.20
Pinging 172.16.99.20 with 32 bytes of data:
Reply from 172.16.99.20: bytes=32 time<10ms ttl="247" bytes="32" time="10ms" ttl="247" bytes="32" ttl="247" bytes="32" ttl="247" sent =" 4," received =" 4," lost =" 0" minimum =" 0ms," maximum =" 10ms," average =" 2ms">enable
Password:
Router#
3.
Display the running configuration and look for the SNMP information:
Router#show running−config
....

snmp−server community public RO
snmp−server community private RW
....
In the above sample output, "public" is the read−only community string and "private" is the
read−write community string.
Note: If you do not see any "snmp−server" statements, SNMP has not been enabled on the router.
Alternatively, execute the show snmp command in the enable mode. If you see the following
message, it also indicates that SNMP has not been enabled on the router:
Router#show snmp
%SNMP agent not enabled
Router#
4.
Exit out of the enable mode and return to the main prompt:
Router#disable
Router>

Modify SNMP Community Strings:
Follow these steps to modify SNMP community strings.
Telnet to the router:
prompt# telnet 172.16.99.20
1.
Enter the enable mode by entering the enable password at the prompt:
Router>enable
Password:
Router#
2.
Display the running configuration and look for the SNMP information:
Router#show running−config
Building configuration...
...

snmp−server community public RO
snmp−server community private RW
....
3.
Go into the configuration mode:
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#
To modify the current Read−only (RO) community string:
Delete the current Read−only (RO) community string by using the command below:
Router(config)#no snmp−server community public RO (where "public" is
the Read−only community string)
×
a.
Enter the new Read−only (RO) community string by using the command below:
Router(config)#snmp−server community XXXX RO (where "XXXX" is
the Read−only community string)
×
b.
¨
To modify the current Read−write (RW) community string:
Delete the current Read−write (RW) community string by using the command below:
Router(config)#no snmp−server community private RW (where "private"
is the Read−write community string)
×
a.
Enter the new Read−write (RW) community string by using the command below:
Router(config)#snmp−server community YYYY RW (where "YYYY" is
the Read−write community string)
×
b.
¨
4.
Exit out of the configuration mode and return to the main prompt:
Router(config)#exit
Router#
5.
Write the modified configuration to nonvolatile RAM (NVRAM) to save the settings:
Router#write memory
Disable/Remove SNMP Community Strings:
Follow these directions to disable or remove SMMP community strings.
Telnet to the router:
prompt# telnet 172.16.99.20
1.
Enter the enable mode by entering the enable password at the prompt:
Router>enable
Password:
Router#
2.
Display the running configuration and look for the SNMP information:
Router#show running−config
Building configuration...
...
...
snmp−server community public RO
snmp−server community private RW
....
....
3.
Go into the configuration mode:
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#
4.
To disable/remove the current Read−only (RO) community string, use the following command:
Router(config)#no snmp−server community public RO
where "public" is the Read−only community string
5.
To disable/remove the current Read−write (RW) community string, use the following command:
Router(config)#no snmp−server community private RW
where "private" is the Read−write community string
6.
Exit out of the configuration mode and return to the main prompt:
Router(config)#exit
Router#
7.
Write the modified configuration to nonvolatile RAM (NVRAM) to save the settings:
Router#write memory
Building configuration...
[OK]
Router#

Comments (0)

Post a Comment