Net-snmpd configuration

I’m trying to setup net-snmpd configuration and the service is running properly but I am unable to get any reply; all my requests end in timeouts.

Here is my config:

environment.systemPackages = with pkgs; [

  networking.firewall.allowedUDPPorts = [ 161 ]; = {
    enable           = true;
    wantedBy         = [ "" ];
    description      = "Net-SNMP daemon";
    after            = [ "" ];
    restartIfChanged = true;
    serviceConfig = {
      User         = "root";
      Group        = "root";
      Restart      = "always";
      ExecStart    = "${}/bin/snmpd -Lf /var/log/snmpd.log -f -c /etc/snmp/snmpd.conf";

  environment.etc."snmp/snmpd.conf".text = lib.mkForce ''                                             
    rocommunity <my comm string> <my home IP>/32
    rocommunity <my comm string>
    rocommunity6 <my comm string> ::1/128

    com2sec notConfigUser  default       public
    com2sec6 notConfigUser  default       public

    group   notConfigGroup v1            notConfigUser
    group   notConfigGroup v2c           notConfigUser

    access  notConfigGroup ""      any       noauth    exact  systemview none  none
    view    systemview    included   .
    view    systemview    included   .

    sysLocation AWS, North Virginia, USA
    sysContact <my email>
    sysServices 72
    sysName <my hostname>

    dontLogTCPWrappersConnects yes

My config is exactly copied from a Debian host that has been working for years.

I’m testing it by doing this: snmpget -t 90 -v2c -c <community string> .
After timeout I get this message: Timeout: No Response from

No logs in /var/log/snmpd.log when hitting it. I turned on -Dall but didn’t see any relevant messages.

I tried tcpdump -i any port 161 -vv and I am seeing incoming traffic to the host but I am no expert at looking at that.

User error.

systemctl stop snmpd
lsof -i udp:161

lsof revealed snmpd was running from a terminal that was minimized on my laptop. After killing that and restarting snmpd, it worked.

Sometimes we are our own worst enemies :slight_smile: