3

I would like to send trap and specify clientaddress

As I search there is two ways:

  1. edit /etc/snmp/snmp.conf and set: clientaddr [IP_OF_DEVICE]
  2. specify IP as parameter: --clientAddr="[IP_OF_DEVICE]"

When i try to issue command:

snmptrap -v 3 -l noAuthNoPriv -u SomeUser -n "" AGENT_IP .1.3.6.1.4.1.161.5.2 .1.3.6.1.4.1.161.1.2.3.4 5

It gives an error

getaddrinfo(AGENT_IP, NULL, ...): Address family for hostname not supported

When I not specify clientadress it works as expected but it use IP of the machine where I issed a command as a client IP

Jolta
  • 2,620
  • 1
  • 29
  • 42
smolarek999
  • 509
  • 1
  • 5
  • 21

1 Answers1

1

To get rid of this I have to:

  • Define virtual interface for ip of device which you want to simulate
  • Specify protocol of agent ( by default when I set clientaddr in /etc/snmp/snmp.conf it looks like it tried to use IPv6 for agent )

    snmptrap -v 3 -l noAuthNoPriv -u SomeUser -n "" udp:AGENT_IP ...

smolarek999
  • 509
  • 1
  • 5
  • 21