Hello Robert, Thanks you for your reply.
I suspect that I may have uncovered a bug. In version Release 5.2 of the snmpd agent. My problem has arisen as I had a working system, using version 5.1.2 of net-snmp. I had configured a number of Solaris 8 hosts to send traps to a monitoring server. This system worked fine. However, when I test release 5.2 rc3 , the traps stopped arriving at the monitoring servers. On further investigation I notice that the packets were being dropped by the firewall because the source address was given as localhost (127.0.0.1) , hence by earlier email to net-snmp-coders . To investigate the problem further I configured a test environment on a Linux 2.6.8.1 server. Attempting the same operation on the Linux server results in a "sendto" function error from the snmpd agent. The following tests were done on my Linux server. 1) I used a bare minimum configuration snmpd.conf file ====================================================== rocommunity public trapcommunity public trapsink 10.146.69.110 ====================================================== 2) Using the 5.1.2 agent # ./snmpd -Lo -f -c /tmp/snmpd2.conf NET-SNMP version 5.1.2 Gives the following from tcpdump, which is what I would expect. 16:46:26.891050 IP monitor2.1496 > 10.146.69.110.snmp-trap: UDP, length: 44 3) Using the latest v 5.2 agent with that same configation file, results in the following. # ./snmpd -Lo -f -c /tmp/snmpd2.conf snmpd: send_trap: Failure in sendto (Invalid argument) NET-SNMP version 5.2 Although on the Solaris box I get the following, as previously reported. # ./snmpd -Lo -f -c /tmp/snmpd2.conf NET-SNMP version 5.2 snoop gives the following localhost -> 10.146.69.110 UDP D=162 S=49107 LEN=52 4) After some debugging I suspect the following bit of code from agent/agent_trap.c file if (pdutype != SNMP_MSG_INFORM) session.localname = "localhost"; When I commenting out this bit of code and rebuilt net-snmp, the snmpd agent showed the following. # ./snmpd -Lo -f -c /tmp/snmpd2.conf NET-SNMP version 5.2 and the tcpdump output is as expected. 17:16:44.699778 IP monitor2.1503 > 10.146.69.110.snmp-trap: UDP, length: 44 It seems clear that this is the bit of code which resulted in my problem. I would assume the it is contrary to good networking practice to set the source address of a packet which is to be sent an external host to that of the localhost (127.0.0.1) . If the source address is set to 127.0.0.1 then any networtk device or the destination host would not be able to identify the host that send the trap. Please let me know what you think. Regards M. Saghir --- Robert Story <[EMAIL PROTECTED]> wrote: > On Thu, 11 Nov 2004 02:52:59 -0800 (PST) Mohammed > wrote: > MS> I am using net-snmp v5.2 rc3 on a solaris box > with a > MS> number of IP addresses. Using a basic > configuration > MS> the daemon listen on port 161 on all address as > MS> expected. > MS> > MS> However, when the daemon start it sends a > coldstart > MS> trap to the trapsink defined but the source IP > address > MS> is set to localhost and not the IP address of > the > MS> host. > > The agent doesn't set the ip address for packets. It > is left up to the host OS. > There is a snmpd.conf directive, agentaddress, than > can be used to specify th > ip to use for sending packets. I'm not sure it is > supported on all platforms, > but you can give it a shot. > > -- > Robert Story; NET-SNMP Junkie > <http://www.net-snmp.org/> > <irc://irc.freenode.net/#net-snmp> > Archive: > <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-coders> > > You are lost in a twisty maze of little standards, > all different. > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ _______________________________________________ Net-snmp-coders mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders