Notes - SNMP Traps
SNMP notifications are unsolicited messages to an NMS. There are two types of SNMP notifications: traps and informs. A trap is not acknowledged, and an inform requires an acknowledge.
Generally, traps are preferred over informs. Traps use less resources, because informs must be held in memory in case they must be retransmitted due to being un-acknowledged.
IOS-XE
On IOS-XE, we enable SNMP notifications using the following command. This is required for both traps and informs. Trap types such as aaa_server, config, cpu, etc. can be used. If you do not specify anything, all traps are enabled.
Next you must configure at least one NMS to receive the traps using the following configuration:
To disable SNMP linkup/linkdown notifications on a per-interface basis we use:
The source interface for traps can be set using:
Example 1
Above, we limit what events can generate SNMP notifications using the “snmp-server enable traps” command. Then we enable traps to be sent to the NMS at 155.1.146.101 using the v2c community CISCO. Note that by default traps are enabled for a host, which is why the “traps” keyword is not used.
We can verify using show snmp host:
Example 2
In this example, we enable all traps but limit the trap types on a per-NMS basis.
Note that this will fill your config with many lines of snmp-server enable trap commands.
IOS-XR
Configuration appears to be extremely similar for IOS-XR. The only difference I see is that you use the syntax “snmp-server traps” instead of “snmp-server enable traps.”
Additionally, to disable SNMP notifications for linkup/linkdown on a per-interface basis, you use:
Example
Last updated