08-21-2014 04:42 AM
Hi All,
Is it necessary to mention snmp-server trap-source <interface name> while configuring SNMP in a router/switch?. what if we do not configure this command on a device having multiple interfaces?
Regards,
VB
Solved! Go to Solution.
08-21-2014 04:50 AM
Hi ,
If you don't configure this command then devices uses "the closest interface to the destination"
snmp-server trap-source <interface name>
This command specifies the interface (and consequently the IP address) that should be used to send SNMP traps. If you have a separate network for management tasks (a good idea), you can use this command to ensure that traps are sent only over the management network.
Thanks-
Afroz
***Ratings Encourages Contributors ***
08-23-2014 05:37 PM
The original post had a two part question, so I will provide a two part answer.
1) Is it necessary to specify the trap source interface? No it is not necessary to specify the trap source interface. Traps will be sent anyway but it becomes more difficult to predict what source address will be used.
2) What happens if we do not configure it. As Afroz explains the device will use what it considers to be the closest interface at that particular time to send the trap. The result is that as interface status may change or as routing table information changes some traps may be sent with Gig0/1 as the source while other traps are sent with Gig0/2 as the source. The reality is that all these traps are from the same device but it will be difficult to see that as you look at the received traps and see different sources.
So I would say that while it is not necessary it is certainly recommended, especially when the device has more than one interface that could potentially serve as the source.
HTH
Rick
08-21-2014 04:50 AM
Hi ,
If you don't configure this command then devices uses "the closest interface to the destination"
snmp-server trap-source <interface name>
This command specifies the interface (and consequently the IP address) that should be used to send SNMP traps. If you have a separate network for management tasks (a good idea), you can use this command to ensure that traps are sent only over the management network.
Thanks-
Afroz
***Ratings Encourages Contributors ***
08-23-2014 05:37 PM
The original post had a two part question, so I will provide a two part answer.
1) Is it necessary to specify the trap source interface? No it is not necessary to specify the trap source interface. Traps will be sent anyway but it becomes more difficult to predict what source address will be used.
2) What happens if we do not configure it. As Afroz explains the device will use what it considers to be the closest interface at that particular time to send the trap. The result is that as interface status may change or as routing table information changes some traps may be sent with Gig0/1 as the source while other traps are sent with Gig0/2 as the source. The reality is that all these traps are from the same device but it will be difficult to see that as you look at the received traps and see different sources.
So I would say that while it is not necessary it is certainly recommended, especially when the device has more than one interface that could potentially serve as the source.
HTH
Rick
08-24-2014 12:12 AM
Thanks Afroz and Rich for clarifying. It helped me a lot.
Regards,
VB
10-07-2020 08:55 AM
When you specific snmp-server trap-source interface, what will happen if that interface or link is down?
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