Forward SNMP traps using snmptrapd without changing the source IP?
Posted by Raggou@reddit | linuxadmin | View on Reddit | 3 comments
I am trying to use snmptrapd to receive and then forward traps and forwarding is working however when I forward the trap takes the IP address of the box that snmpd is running on when I want the source IP address to stay as the original box that originated the trap
Alexander23_1@reddit
At PRTG we use the SNMP Trap Receiver sensor we can see the source IP of incoming traps in the sensor report and monitoring events from devices from a single console is a great advantage.
However it's important to configure the device settings and sensor filter correctly it requires some configuration rather than automatic output. What kind of adjustments have you found when monitoring directly using the trap source IP?
HRRMute@reddit
Necroing this thread to add the solution for snmptrapd for anyone else that comes looking. As long as your version of net-snmp is 5.8 or later, this will work.
Add addForwarderInfo yes to your snmptrapd.conf and it'll preserve the original IP when forwarding the traps.
A super basic snmptrapd.conf with this would look like: disableAuthorization yes
traphandle default /usr/sbin/snmptthandler
addForwarderInfo yes
forward default X.X.X.X
Jerezon@reddit
Doesn’t work with net-snmp 5.8.27. But after reading some documentation, the source ip is stored in another oid