Hi.

Any traffic originating from snmpd will have src IP of outgoing network
interface.
>From my experience "clientaddr" helps for replies generated by snmpd. For
example,
if you have multiple interfaces and "clientaddr" is set, any snmpd
response, like response to
snmpget, snmpwalk etc. will have desired src IP.

But this won't work for packets initiated by snmpd, like traps.
What I did, was changing the route src settings.
For example, if you have eth0 in 192.168.0.0/24 and eth1 in 192.168.1.0/24
and you want any traffic to
have source of 192.168.0.0/24, then change eth1 subnet route like:

ip route change 192.168.1.0/24 dev eth1 src 192.168.0.1

if 192.168.0.1 is eth0 IP.

Of course this may have other side effects on routing in your system.

RegK

On Thu, May 23, 2019 at 6:30 PM Anders Wallin <walli...@gmail.com> wrote:

> You can use "clientaddr" in snmp.conf or snmpd.conf,
> https://linux.die.net/man/5/snmp.conf
>
> In 5.8 you also have the possibility to use "-s" with trapsess, but I did
> not found any documentation on it.
> but check the test
> code, testing/fulltests/default/T184trapsesssource_simple
>
> Regards
> Anders Wallin
>
>
> On Wed, May 22, 2019 at 5:21 PM ww <ww634539...@163.com> wrote:
>
>> Hello, Thank you for reading my email. Can I specify the source IP when
>> send a V2/V3 trap like V1?
>>
>>
>>
>>
>> _______________________________________________
>> Net-snmp-users mailing list
>> Net-snmp-users@lists.sourceforge.net
>> Please see the following page to unsubscribe or change other options:
>> https://lists.sourceforge.net/lists/listinfo/net-snmp-users
>>
> _______________________________________________
> Net-snmp-users mailing list
> Net-snmp-users@lists.sourceforge.net
> Please see the following page to unsubscribe or change other options:
> https://lists.sourceforge.net/lists/listinfo/net-snmp-users
>
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to