3

Where in the SNMP OID tree does snmpwalk start if no OID is specified, i.e. snmpwalk is started like snmpwalk -v 2c -c public host? From .1.3.6.1.2.1?

Martin
  • 7,284
  • 40
  • 125
  • 208

1 Answers1

4

Yes, from doing a network capture, it would seem so:

SNMP 84 get-next-request 1.3.6.1.2.1

Which is:

$ MIBS=+all snmptranslate 1.3.6.1.2.1
SNMPv2-SMI::mib-2
$ MIBS=+all snmptranslate -Of 1.3.6.1.2.1
.iso.org.dod.internet.mgmt.mib-2

Confirmed by reading the source:

oid             objid_mib[] = { 1, 3, 6, 1, 2, 1 };
[...]
    if (arg < argc) {
[...]
    } else {
        /*
         * use default value
         */
        memmove(root, objid_mib, sizeof(objid_mib));
        rootlen = sizeof(objid_mib) / sizeof(oid);
    }

And the man page:

If no OID argument is present, snmpwalk will search the subtree rooted at SNMPv2-SMI::mib-2.

Stéphane Chazelas
  • 522,931
  • 91
  • 1,010
  • 1,501