2

Does the Linux SNMP agent support IPv6? I'm working with net-snmp 5.5. It's working fine with IPv4 address set and get operations, but with an IPv6 address it leads to unknown host.

What's the problem, and how do I resolve it?

alexwlchan
  • 5,699
  • 7
  • 38
  • 49
user412747
  • 21
  • 1
  • 1
  • 3

2 Answers2

4

In addition to listening for udp6 packets, it also seems you must specify an additional, separate community for ipv6 requests. Without both changes to snmpd.conf snmp queries via ipv6 are ignored.

agentAddress udp:161,udp6:161
rocommunity6 public default
Brad Hein
  • 10,997
  • 12
  • 51
  • 74
4

Happened to come across this question while searching for something else and figured I could add my 2 cents.

The IPv6 address in a net-snmp command is a little different from an IPv4 address. You need to use the udp6: prefix and specify the port number.

"udp6:[<ipv6 address here>]:161"

The full command should look something like this:

snmpset -v 1 -c private "udp6:[<ipv6 address here>]:161" 1.3.6.1.4.1.318.1.1.26.4.4.1.4.1 i 7

edit: this works for a Windows environment, but may be the same for Linux

Doug
  • 563
  • 4
  • 10
  • 2
    For Net-SNMP on Linux, you will typically only need to modify /etc/snmp/snmpd.conf to ensure that this line is present: agentAddress udp:161,udp6:[::1]:161,tcp:161,tcp6:[::1]:161 That should make snmpd listen on just about everything. – Douglas Manley Mar 07 '14 at 13:15
  • I added "agentAddress udp:161,udp6:[::1]:161,tcp:161,tcp6:[::1]:161 to snmpd.conf and then launched snmpd. I found no process no for snmpd using 'ps aux | grep snmp'. I then added only "agentAddress udp:161,udp6:[::1]:161, I found it's lanuched successfuly. But I used 'netstat -uln' command and found only udp 161 was listening, no udp6 161 listening. How come? – Stan Huang at Taiwan Mar 20 '23 at 07:30