12-25-2012 06:41 PM
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?
Solved! Go to Solution.
12-26-2012 11:37 PM
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.
12-26-2012 06:26 AM
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).
03-30-2017 04:31 PM
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?
12-26-2012 11:37 PM
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.
01-09-2013 11:05 AM
"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.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide