I sent this once before, but it seems no one believed it ...

According to the documentation of snmp.conf (not snmpd.conf), it should be 
possible
to specify the source address used when sending traps:
       clientaddr [<transport-specifier>:]<transport-address>
              specifies the source address to be used by command-line applica‐
              tions when sending SNMP requests. See snmpcmd(1) for more infor‐
              mation about the format of addresses.

              This value is also used by snmpd when generating notifications.

This is useful for the case of routing server where official source address is
assigned to one interface (typically loopback device), and we want all traps to
be sent with that source address.

The problem is that setting the clientaddr in snmp.conf has no effect because
it is not being read by the agent. The following 2 line patch against current
net-snmp svn trunk fixes the problem.

--- a/agent/agent_read_config.c 2010-12-14 10:44:20.744120879 -0800
+++ b/agent/agent_read_config.c 2010-12-14 10:44:53.200847830 -0800
@@ -261,6 +261,8 @@ init_agent_read_config(const char *app)
     netsnmp_ds_register_config(ASN_INTEGER, app, "maxGetbulkResponses",
                                NETSNMP_DS_APPLICATION_ID,
                                NETSNMP_DS_AGENT_MAX_GETBULKRESPONSES);
+    netsnmp_ds_register_config(ASN_OCTET_STR, app, "clientaddr",
+                               NETSNMP_DS_LIBRARY_ID, 
NETSNMP_DS_LIB_CLIENT_ADDR);
     netsnmp_init_handler_conf();
 
 #include "agent_module_dot_conf.h"


------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to