cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
30760
Views
5
Helpful
4
Replies

no snmp-server does not remove snmp configuration

charlesmanser
Level 1
Level 1

I have run into a situation where typing:

Switch# (config): no snmp-server

does not =actually= remove all the snmp-server configuration.

We are trying to baseline/remove non-v3 SNMP configurations from our LAN. We had a script that started with "no snmp-server" then applied the new SMNP configuration. Unfortunately, while it looks like the snmp config is removed (show run | i snmp-server) with the above command, pasting the new configuration magically brings back parts of the old version 2 config.

What’s the deal?

1 Accepted Solution

Accepted Solutions

Vinod Arya
Cisco Employee
Cisco Employee

No snmp-server is not a command intended to remove the snmp configuration. This command would stop the SNMP ENGINE process in IOS, responsible to process snmp in IOS. When SMP ENGINE stops any snmp related command would be disabled from configuration and if you run any snmp related show command you'll see it will show an error as :

%SNMP agent not enabled

As soon as you enter any snmp related command, it will enable the SNMP ENGINE process which will bring the snmp configuration back.

To remove any configuration, no format of that command should be used. Any user guide will say and recommend this. Using no snmp-server is not a recommended/supported way.

-Thanks Vinod **Rating Encourages contributors, and its really free. **

View solution in original post

4 Replies 4

Marvin Rhoads
Hall of Fame
Hall of Fame

When you enter "no snmp-server" it disables ALL snmp versions - 1, 2c and 3. Subsequently entering the configuration for any of them will re-enable them all.

If you want to disable access for an SNMP community (e.g. snmp v1 community RO and RW strings), set the community string for that community to the null string (do not enter a value for the community string).

This is noted in the IOS Configuration Guide (example for IOS 15.0(1) on the 3750 here).

Sorry for the necro reply.  There is a behavior that doesn't make sense.

no snmp-server or default snmp-server

wr mem

sh run | i snmp-server <<<<nothing shows up

sh start | i snmp-server <<<<nothing shows up

reboot

Post reboot add snmp-server enable traps

every prior line of snmp-server config returns including specific snmp-server hosts and community strings.

Where are these specific lines of configuration being recalled from?

Vinod Arya
Cisco Employee
Cisco Employee

No snmp-server is not a command intended to remove the snmp configuration. This command would stop the SNMP ENGINE process in IOS, responsible to process snmp in IOS. When SMP ENGINE stops any snmp related command would be disabled from configuration and if you run any snmp related show command you'll see it will show an error as :

%SNMP agent not enabled

As soon as you enter any snmp related command, it will enable the SNMP ENGINE process which will bring the snmp configuration back.

To remove any configuration, no format of that command should be used. Any user guide will say and recommend this. Using no snmp-server is not a recommended/supported way.

-Thanks Vinod **Rating Encourages contributors, and its really free. **

"no snmp-server" removed the snmp configurration from the running configuration. Where is the SNMP configuration really stored?

If you type no snmp-server, write, and reload the switch, how does it know the old SNMP configuration.

Review Cisco Networking for a $25 gift card