2

I am using snmp to query and set some OIDs in IPv6 mode. I use the below snmp command. I have checked and configured it to listen to udp6:161.

snmpget -cpublic -v2c udp6:[2001:db8:3c4d::41a9:8e4e:a094:3840] .1.3.6.1.4.1.1429.5.1.1.2.5.6.0

It gives the result as

Timeout: No Response from udp6:[2001:db8:3c4d::41a9:8e4e:a094:3840]

The given ip address is also alive when checked using ping. Changed conf file to include rwcommunity6 and rocommunity6. What am I doing wrong?

Sathya
  • 525
  • 1
  • 8
  • 15
  • What does wireshark tell you when you sniff the interface on the machine being queried? Are you sure that the SNMP Agent has a listener bound to the aforementioned IPv6 address? – Mike Pennington Nov 14 '11 at 12:26
  • wireshark has a line for get/set-request. The response statement is not found at all.. There are no errors such as port unreachable – Sathya Nov 14 '11 at 13:29
  • 2
    Make sure you don't have firewall blocking this traffic. Also check with lsof or netstat that you really listen your IPv6 socket. You can add 'r?community6' to configuration but if you don't add listening address to snmpd command like (udp6:161 for example) then snmpd will not listen IPv6 socket. – Cougar Nov 14 '11 at 14:07
  • Yes. The problem was listening port. After adding udp:161 and rwcommunity6 and rocommunity6 in conf file it is working fine. – Sathya Dec 01 '11 at 11:45

2 Answers2

2

As Cougar said in the comment, you must tell snmpd to listen to the ipv6 address. By default, snmpd only listens to udp4:. To get it to listen to multiple transports, you should specify each:

snmpd udp: udp6:

for example. Also, because the agent won't respond if the incoming packet is denied authorization, you can always run snmpd with the dump flag (-d) to show what traffic it is receiving. If it's not receiving it, you've found one problem. But if it is but not responding, you've found another. Make sure you run it in the foreground (-f) and with logging to stderr (-Le):

snmpd -f -Le -d udp: udp6:
Wes Hardaker
  • 21,735
  • 2
  • 38
  • 69
0

Is it working for this command?

snmpget -v 2c -c public localhost .1.3.6.1.2.1.1.1.0

It should give system description. If yes then it has been set correctly. Otherwise you need to set it using the command snmpconf -g basic_setup

Shawn Chin
  • 84,080
  • 19
  • 162
  • 191
Coder17
  • 767
  • 4
  • 11
  • 30
  • Yes. The problem was listening port. After adding udp:161 and rwcommunity6 and rocommunity6 in conf file it is working fine. Thanks guys! – Sathya Dec 01 '11 at 11:45