Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to query the MAC address of Ubuntu terminals. I remember that a few years ago I've used the OID . (IF-MIB::ifPhysAddress.2) to query OpenSUSE terminals.

This OID doesn't work with Ubuntu:

$ snmpget -v 2c -c public localhost .
IF-MIB::ifPhysAddress.2 = No Such Object available on this agent at this OID


$ snmpget -v 2c -c public localhost .
IF-MIB::ifPhysAddress = No Such Object available on this agent at this OID

It seems that all network interfaces are not available at all:

$ snmpwalk -v 2c -c public localhost .
IF-MIB::interfaces = No more variables left in this MIB View (It is past the end of the MIB tree)

while if I do an snmpwalk starting from . (SNMPv2-SMI::mib-2) I get a few results.

Why? Is there something that I need to enable to get the MAC address?

I've checked and ifPhysAddress is defined in /usr/share/mibs/ietf/IF-MIB and MIBS seems correctly configured:

$ net-snmp-config --default-mibs | grep IF-MIB

The packages I've installed are:

ii  libsnmp-base          4.4.1~dfsg-12ubuntu7               SNMP (Simple Network Management Protocol) MIBs and documen
ii  libsnmp15             5.4.1~dfsg-12ubuntu7               SNMP (Simple Network Management Protocol) library
ii  snmp                  5.4.1~dfsg-12ubuntu7               SNMP (Simple Network Management Protocol) applications
ii  snmpd                 5.4.1~dfsg-12ubuntu7               SNMP (Simple Network Management Protocol) agents


Below there's the snmpd.conf of the target machines:

com2sec paranoid  default         public
group MyROSystem v1        paranoid
group MyROSystem v2c       paranoid
group MyROSystem usm       paranoid
group MyROGroup v1         readonly
group MyROGroup v2c        readonly
group MyROGroup usm        readonly
group MyRWGroup v1         readwrite
group MyRWGroup v2c        readwrite
group MyRWGroup usm        readwrite
view all    included  .1                               80
view system included
access MyROSystem ""     any       noauth    exact  system none   none
access MyROGroup ""      any       noauth    exact  all    none   none
access MyRWGroup ""      any       noauth    exact  all    all    none
syslocation Unknown (configure /etc/snmp/snmpd.local.conf)
syscontact Root <root@localhost> (configure /etc/snmp/snmpd.local.conf)
share|improve this question
Do you have access to this part of the tree on the receiving side? Can you post the snmpd.conf from one of the servers (minus comments and blank lines) – Paul May 22 '12 at 5:30
@Paul I've just updated the question with the config file – alexyz78 May 23 '12 at 5:33
up vote 1 down vote accepted

The public community string maps to the paranoid group, which maps to the MyROSystem access, which allows visibility of the system view. Can you change:

com2sec paranoid  default         public

to read

com2sec readonly  default         public

This will map it to readonly and give it the whole tree.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .