[SNMP4J] Multiple UDP transport mappings

Frank Fock fock at agentpp.com
Tue Jul 21 09:42:19 CEST 2009


Hi Corey,

If you use the same target for each send(..)
then you will receive the trap twice at that
target, of course.

I am now a bit confused about what you are trying
to accomplish. What is your goal?

If you send a trap via a TransportMapping it always
gets the from address from that interface (depending
on the OS in some cases). If you have used 0.0.0.0,
then the OS chooses the address. Otherwise, it will
be the address of the physical interface (not an alias).

Does if you want to control the from address, you
have a hard job. I would recommend, not using the
from address on the SNMP (application) level.

Best regards,
Frank

Ellis Corey wrote:
> Hi Frank,
> 
> So if I understand correctly and from looking at the code.  What I have
> done is
> 
> 1. I have added just one transport mapping to the MessageDispatcher (I
> think this is required or can I not add a transport and always supply
> one)
> 2. In my logic where I actually call send() method from SNMP class, I am
> passing using send(PDU, Target, Transport) call.
> 
> My question is (I hope I am right), when I use this send() method, the
> transport that was added in the MessageDispatcher will not be used.  
> So if I call send(PDU, Target, Transport) twice (once for each
> transport), then it will work.  What I am afraid of is duplicate traps
> being sent.
> This won't occur right?
> 
> Thanks again for the quick response.
> 
> Corey
> 
> -----Original Message-----
> From: Frank Fock [mailto:fock at agentpp.com] 
> Sent: Monday, July 20, 2009 7:36 PM
> To: Ellis Corey
> Cc: snmp4j at agentpp.org
> Subject: Re: [SNMP4J] Multiple UDP transport mappings
> 
> Hi Ellis,
> 
> When using several UDP (or TCP) transport mappings
> you should make sure, that you use only the Snmp
> methods that take the transport mapping as parameter.
> Then you can choose the mapping you want to use.
> 
> The default NotificationOriginator however, will not
> distinguish between those mappings. You will have
> to write your own NotificationOriginator to choose
> the transport mapping according to some self defined
> rules.
> 
> Best regards,
> Frank
> 
> 
> Ellis Corey wrote:
>> Hi,
>>
>>  
>>
>> I have setup multiple transport mappings for the purpose of sending
> out
>> traps over multiple interfaces.  Everything is working fine, accept
> that
>> the source ip of my trap that is going out of one interface is using
> the
>> ip address of another interface.
>>
>>  
>>
>> Example of what is occurring.  My machine has two interfaces (admin
> and
>> hsbn)
>>
>>  
>>
>> Admin = 10.1.1.1
>>
>> HSBN = 10.2.2.2
>>
>>  
>>
>> When I send out a trap it goes out on both interfaces, but the trap
>> going out of the admin network has source ip of 10.2.2.2 instead of
>> 10.1.1.1
>>
>>  
>>
>> I am building my UdpAddress(adminIP, port), I was expecting that the
> IP
>> I define in the UdpAddress will be the one that is used as the source
> ip
>> when the trap is sent, but it seems like this is not the case.
>>
>>  
>>
>> Any ideas, how I can control the source IP when sending out the trap
>> over multiple interfaces.
>>
>>  
>>
>> Corey Ellis
>> Engineering Development Manager
>>
>> OA&M and Security, Billing
>> Comverse
>> Office: 856-608-2580
>>
>> Mobile: 609-319-6513
>>
>>  
>>
>> _______________________________________________
>> SNMP4J mailing list
>> SNMP4J at agentpp.org
>> http://lists.agentpp.org/mailman/listinfo/snmp4j
> 

-- 
AGENT++
http://www.agentpp.com
http://www.snmp4j.com
http://www.mibexplorer.com
http://www.mibdesigner.com




More information about the SNMP4J mailing list