Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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 am using snmp and trying to get with

snmpwalk -v 2c -c public x.x.x.x ipadd

where x.x.x.x is the ip of the pc with ubuntu 12.04 i get this answer :

IP-MIB::ipAddrTable = No Such Object available on this agent at this OID

so how can I get the ip addres from a ubuntu 12.04 LT pc , there is maybe another comand that I can use?

Thanks for the answer .

share|improve this question
If you have the IP address in the command, why would you need to get it again through SNMP? You already know it to run the command. – hexafraction Nov 28 '12 at 1:09
with snmpwalk -v 2c -c public x.x.x.x ipadd you can get ipaddres from diferent interfaces not only the one you are using in the comand so i need to know this thing but my point is just know how to configure IP-MIB and get this information because it is really diferent from the later ubuntu versions – usermfg Nov 28 '12 at 1:25

After installing SNMP and its daemon(sudo apt-get install snmp snmpd), you will need to edit the file /etc/snmp/snmp.conf and comment out the line containing "mibs:"

Within this file, change the line:

mibs :


#mibs : 

Next, assuming you haven't done this already, you will need to obtain the full set of IETF MIBs. These files do not ship, by default, on Debian/Ubuntu systems due to licensing issues.

From the terminal(Ctrl-Alt-t), enter the following commands:

sudo apt-get install snmp-mibs-downloader

sudo download-mibs

Then, you will need to modify /etc/snmp/snmpd.conf.

  1. To allow SNMP the system to receive queries on interfaces other than its loopback address. The lines for this should look like this:

    #  Listen for connections from the local system only
    #  agentAddress  udp:
    #  Listen for connections on all interfaces (both IPv4 *and* IPv6)
    agentAddress udp:161,udp6:[::1]:161

    Note that this will allow ANY system to query your machine. You will need to adjust this to limit SNMP access to your device.

  2. You will now want to change your Read-only SNMP string from public to a custom string of your choosing, as below:

    #rocommunity public  default    -V systemonly
    rocommunity <My$ecret$tr1nG> (Don't use this example!) 

    Note: Removing -V systemonly from the line will allow access to the entire MIB tree and not restrict it to the system part of the tree.

  3. Restart the SNMP daemon

    sudo service snmpd restart

Finally, your SNMP query should now respond properly.


snmpwalk -v 2c -c <My$ecret$tr1nG> <MachineName> ipadd

IP-MIB::ipAdEntAddr. = IpAddress:
IP-MIB::ipAdEntAddr. = IpAddress:
IP-MIB::ipAdEntIfIndex. = INTEGER: 1
IP-MIB::ipAdEntIfIndex. = INTEGER: 2
IP-MIB::ipAdEntNetMask. = IpAddress:
IP-MIB::ipAdEntNetMask. = IpAddress:
IP-MIB::ipAdEntBcastAddr. = INTEGER: 0
IP-MIB::ipAdEntBcastAddr. = INTEGER: 1

The same query can be run using a GUI based MIB browser, as well. Personally, I prefer using SNMPb for my graphical queries. Once you have SNMPb installed, open SNMPb and navigate to the desired OID in the MIB tree. In your specific case, it would be or iso-> org-> internet-> mgmt-> mib-2 -> ip -> ipAddrTable and perform a Get Bulk to receive the same data.

share|improve this answer

I had the same problem, and I had already done the above, but then I realised that all I needed to do was add the following line to /etc/snmp/snmpd.conf

# For IF-MIB data to show up in snmpwalk
view   systemonly  included   .

and then restart the snmpd:

/etc/init.d/snmpd restart

then I get:

% ~/computer/snmp$ snmpwalk -v 2c -c public -O e mymachinename ipadd
IP-MIB::ipAdEntAddr. = IpAddress:
IP-MIB::ipAdEntAddr. = IpAddress:
IP-MIB::ipAdEntIfIndex. = INTEGER: 2
IP-MIB::ipAdEntIfIndex. = INTEGER: 1
IP-MIB::ipAdEntNetMask. = IpAddress:
IP-MIB::ipAdEntNetMask. = IpAddress:
IP-MIB::ipAdEntBcastAddr. = INTEGER: 1
IP-MIB::ipAdEntBcastAddr. = INTEGER: 0


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.