Adding IPv6 Mgmt with net-snmp

I had meant to post a short blog on this awhile back, but as part of my “Move it to the Cloud” experience I found myself looking for my old notes when the setup didn’t go straight forward enough, so now’s as good a time as any for getting that knocked out.

Most of the daemon configuration, at least in a ubuntu environment, is done with config files in /etc/snmp. I have to keep catching myself that it’s not /etc/snmpd, but just /etc/snmp. The primary config file for the SNMP daemon is snmpd.conf.

When setting up net-snmpd 5.4.3 (which is what I currently have as part of my ubuntu 12 environment), there are options to set the listen ports/protocols within the /etc/snmp/snmpd.conf config file. In my testing, these options seem to be largely ignored. The snmpd.conf file is the correct place to make your SNMPv2c or SNMPv3 configurations, however the protocol (IPv4 vs IPv6) and port settings (udp 161 or something non-standard) seem to be largely overlooked in this file.

To add to the confusion, when I thought I could make the needed changes to the startup script file, I didn’t find what I was looking for in /etc/init.d/snmpd.

What ended up working for me, was to make the needed changes to /etc/default/snmpd.

Config file for net-snmpd command line options

Config file for net-snmpd command line options

Two things:

After the command line switch where you specify the pid file, I add the protocol/port option udp6:161 to get the daemon to listed on IPv6, UDP socket 161. For whatever reason, when I added this switch, I found the daemon was not scanning the default config file for community/user information, so I also had to add the “-c” switch and point it back to /etc/snmp/snmpd.conf for that.

If I’ve missed something simple and actually caused more work here, please respond with a comment. I would definitely appreciate the feedback.

 

This entry was posted in IPv6. Bookmark the permalink.

Leave a Reply