Re: Sending informs from a specific ip address
Glenn McAllister <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Organization | SOMA Networks, Inc. |
| Message-ID | <[email protected]> |
Glenn McAllister wrote: > Version: net-snmp 5.4.2 > > We have the requirement that we need to send informs from a specific > ipv4 address, as we use the source address to do a lot of the routing on > our device. The device can have multiple ipv4 addresses, and in that > situation there is typically a separate address intended for management > traffic. We can get snmpd to bind to that address on port 161 for the > usual GET, SET, etc. processing via the agentaddress token. Where we > are having trouble is getting v3 informs sent off that same interface. > In our setup we use trapsess to configure the targets, and all informs > are going through snmpd (either snmpd is sending its own informs, or > informs are originating from AgentX subagents). > > My apologies in advance if any of the example output or config files > wrap badly. > > A sample configuration file (mildly obfuscated) looks like: > > rwuser userblah > agentaddress localhost:161,192.168.222.5:161 > clientaddr 192.168.222.5 > > trapsess -v 3 -u userblah -l authNoPriv -A somepassword -a MD5 -Ci > 10.11.10.92 > > trapsess -v 3 -u userblah -l authNoPriv -A somepassword -a MD5 -Ci > 192.168.223.10 So I've made some progress on figuring out what the problem is. The udp sockets created for the trapsess directives happens in snmpUDPDomain.c:netsnmp_udp_transport(). If I'm reading things correctly, there is a lookup on the clientaddr value at line 668, which would set the source address correctly. Heres the problem. The snmpd.conf file is being processed before snmp.conf. Since snmp.conf hasn't been read yet, the value for clientaddr is NULL when we are processing the trapsess directives, resulting in the socket binding to INADDR_ANY. The "obvious" solution is to arrange to have snmp.conf to be processed before snmpd.conf. Unfortunately, I'm having a hell of a time figuring out how the config types are registered, and when. I'll keep poking away, but a pointer would be highly appreciated at this point. :-) -- Glenn McAllister <[email protected]> +1 416 348 1594 SOMA Networks, Inc. http://www.somanetworks.com/ +1 416 977 1414 ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Net-snmp-users mailing list [email protected] Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users