The snmp-server enable traps syslog command is used in conjunction with the snmp-server host command. Use the snmp-server host command to specify which host or hosts receive SNMP notifications. To send SNMP notifications, you must configure at least one snmp-server host command.
Although this seems to be the case based on the descriptions shown here, because of the somewhat complex nature of how these two commands interact, the best way to determine exactly what is being sent is to try it out.
I set it up on two routers with access list in the community, but for some reason on one of the routers there is no input/output packets coming. Itās the same config as the other that works just fine. What would be causing this?
Hmm, without more information, it is difficult to diagnose such behavior.
If one is working and the other is not, it is highly unlikely that the configuration is exactly the same. If it is, then the problem may be hardware related or due to some malfunction in the device. I suggest you take a closer look and try to replicate everything exactly. If you need further help, share with us your progress and let us know a little bit more about your topology and config so that we can help you further.
So if I understand this correctly, the moment I issue the snmp-server community text ro/rw command, Iāll be able to retrieve information from this device and also SET specific configuration parameters on it?
Because I originally thought you also have to issue the snmp-server host x.x.x.x command.
Also, what versions will be enabled if we donāt specify on in the snmp-server host command?
And one last thing. Although Iāve specified version 2c - snmp-server host x.x.x.x version 2c, the SNMP server can still communicate with the managed device using v1. Is this normal?
The snmp-server community text ro/rw command is indeed all thatās necessary to allow an SNMP manager to retrieve information from the network device or agent, and also to set specific configuration parameters. The ability to retrieve and set depends of course on the ro (read only) or rw (read/write) setting in the command.
The snmp-server host x.x.x.x command serves a different purpose. This command tells the SNMP agent where to send unsolicited messages, specifically traps and informs. Unsolicited messages are those messages sent by an SNMP agent to an SNMP manager without the manager first requesting that information. These messages are used to alert the manager about specific events or conditions that have occurred in the agent device.
If the snmp-server host command is not issued, no unsolicited messages are sent. But as long as the snmp-server community command is set, SNMP information can be retrieved by the SNMP monitor.
According to the Cisco command reference links below, the default value for the SNMP version found within the snmp-server host command is version 1, however, this may depend upon the platform and IOS versions. Using the context-sensitive help in the CLI may inform you of the default value for this on your platform.
The version number specified in this command has to do with the types of traps and informs that will be used. Specifically:
SNMP version 1 doesnāt use informs, and has a particular format for traps.
SNMP version 2 introduces informs and changes the format of traps
SNMP version 3 doesnāt change the format of these messages, but adds security features like authentication and encryption.
What version you configure will change these formats and parameters such that the receiving SNMP server will receive the appropriate types of messages.
So the question is, if you use version 2c on the command, is this backward compatible with an SNMP manager that understands version 1 formats? I havenāt found any documentation making this claim. When you say that āthe SNMP server can still communicate with the managed device using v1,ā can you clarify what you mean?
Take a look at these Cisco command references for these commands for more info: