in reply to changing localaddr

I think what you are trying to do is to set the agent address for the snmp trap.

Please ensure you have the patch to Net::SNMP described at PATCH 1916840: new config option to set SNMPv1 trap agent address

            "XML is like violence: if it doesn't solve your problem, use more."