I am trying to configure the IP address of my embedded device. The device should have a static IP address and I attempt to set this using the /etc/network/interfaces file with

iface eth0 inet static

where I have been given these values by our network technician. My system is a minimal embedded system built with buildroot, uClibc and busybox. With this interfaces file, a call to ifconfig eth0 displays that the above settings have been enabled correctly, but I am unable to ping anything on my network. My question really is this: is the above interfaces file sufficient for setting a static IP or is something more necessary? From online tutorials, I see many mention of /etc/hosts and /etc/resolv.conf files. I don't even have a /etc/resolv.conf file on my system. I am having other problems as described here Unable to get embedded device to ping anything on the network so I am asking this question separately to verify that I am setting up the static IP address correctly and rule out an incorrect setup.

EDIT The output of route is

Destination      Gateway     Genmask        Flags   Metric Ref  Use Iface
default        UG       0      0    0   eth0     *   U        0      0    0   eth0

but I am unable to even ping the gateway

  • 1) can you ping ? 2) what is the output of host google.com ? Feb 25, 2013 at 22:11
  • @sputnick Unable to ping and my system does not run host Feb 26, 2013 at 9:10

2 Answers 2


/etc/resolv.conf is part of configuration of the DNS client (which is in its simplest form a part of libc), which tells it what servers to ask when resolving a DNS query. If you can live without DNS, i.e. use IP addresses for everything, which includes hardcoding these into /etc/hosts, you won't need it. Once you'll need to resolve a hostname using DNS, you are going to need it.

To set up the connection you need to:

  • bring the device up
  • assign the IP to the device
  • configure routing - create route to gateway, add default route via the gateway.
  • Thanks for your answer - what IP addresses do I require in /etc/hosts ? My file only contains localhost Feb 25, 2013 at 22:12
  • Only those you'll want to resolve without consulting DNS. On the other hand, if your libc implementation supports it, you can put nameserver IP into /etc/resolv.conf. Just remember you'll get DNS queries when resolving hostnames (which might be unwanted in some embedded situations).
    – peterph
    Feb 26, 2013 at 16:08

/etc/resolv.conf stores DNS server info (nameserver ). Even though You set up static address correctly, Your host my not be properly identified by the network thus all traffic sourcing from Your machine will be lost (unable to route properly).

The above may be a wild guess, but I would check man page for resolv.conf and ask Your IT admin for the DNS info.

  • 2
    resolv.conf and DNS are not related with routing.
    – jlliagre
    Feb 26, 2013 at 0:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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