Make net-snmp listen to IPv6 address

The Zenoss installation added its own server into the devices list as a default.  However, it is having trouble reading snmp values from itself.  Performing snmpwalk via the Zenoss web interface results in a timeout error.

The snmpwalk command used by Zenoss uses the IPv6 loopback address ::1.  I switched this to the IPv4 equivalent and the snmpwalk worked fine.

It turns out, the snmp agent, net-snmp, only listens to IPv4 addresses by default.  Some changes need to be done to the net-snmp config file.

The following lines need to be added to /etc/snmp/snmpd.conf:

agentaddress udp:161
agentaddress udp6:161

#       source          community
com2sec   notConfigUser  default         public
com2sec6  notConfigUser  default         public

Restart snmpd and it should now listen to IPv6 as well.

# service snmpd restart

2 thoughts on “Make net-snmp listen to IPv6 address

  1. Hi,

    There are cases when it will not work your above how to.
    Should be like this:
    agentAddress udp:
    agentAddress udp6:::1:161
    #agentAddress udp:
    #agentAddress udp:

    com2sec local localhost test
    com2sec local test
    com2sec local test
    com2sec6 readonly localhost test
    com2sec6 local localhost test
    com2sec6 local 2001:470:6e:30::2 test

  2. 1. What are the following two lines for?
    com2sec notConfigUser default public
    com2sec6 notConfigUser default public

    2. Is there any document explaining the usage of directives in snmpd.con?

Leave a Reply

Your email address will not be published. Required fields are marked *