When configuring net-snmp DTLSUDP to listen to all IPv4 addresses, it is configured as follows:
agentaddress dtlsudp:10161
How do you configure DTLSUDP to listen on all IPv6 addresses?
As of this writing (net-snmp v5.9 and lower), the DTLSUDP transport supports IPv6, but the following valid syntax does not work - it has the identical behaviour to dtlsudp:10161 causing an unexpected bind to IPv4:
agentaddress dtlsudp6:10161
To work around this problem, configure the agentaddress with an explicit IPv6 address as follows:
agentaddress dtlsudp6:[::]:10161
To get net-snmp DTLSUDP to listen on both IPv4 and IPv6 at the same time, do this:
agentaddress dtlsudp:10161,dtlsudp6:[::]:10161
When using hostnames, net-snmp dtlsudp tries to bind using IPv4 first, and if that fails it tries on IPv6. This can cause unexpected behaviour in dual stack environments.