I'm using a Debian on a RaspberryPi and the problem that I'm having is that I can't connect to the Internet.

Every time I try I see a message that says "cannot resolve hostname". From the terminal, I tried:

$ ping www.google.com 
unknown host google.com

$ ping
network is unreachable

output of 'ip addr list'

1: <LOOPBACK, UP, LOWER_UP> mt 65536 qdisc noqueue state UNKNOWN
   link/loopback 00:00:00:00:00:00 vrd 00:00:00:00:00:00:
   inet scope host lo
      valid_lft forever preferred_lft forever

2: eth0: <BOADCAST, MULTICAST, UP, LOWER_UP> mtu 1500 dis pfifo_fast state UP qlen 100
   link/ether b8:27:eb:18:b9:17 brd ff:ff:ff:ff:ff:ff

This appears after doing the ifdown eth0 and ifup eth0 as drobert suggest

  innet 1393.182.112.9116 brd scope global eth0
    valid_lft forevere preferred_lft forever

ip route ls dev eth0 proto kernel scope link src


auto lo

iface lo inet loopback
iface eth0 inet dhcp


allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.cong
iface default inet dhcp



I try the up route list command nothing happed

  • 2
    please post the contents of the following commands: ip addr list and ip route list. Your problem seems to be the lack of a default route to your gateway.
    – user34720
    May 19, 2014 at 20:51
  • @nwildner I update my question May 19, 2014 at 21:10
  • 1
    Well, it seems that you don´t even have an ip address. Try dhclient eth0 to aquire an address from your lan(if there is a dhcp server somewhere). Cheers :)
    – user34720
    May 19, 2014 at 21:12
  • @nwildner nothing happend with the dhclient eth0 command :/ May 19, 2014 at 21:22
  • 1
    @CarlosPerez I'm going to assume the weird 4-digit octets in the IP address are just a mistake in editing the question. It appears you don't have a default gateway; did you specify one (with the gateway clause) in your /etc/network/interfaces? Also, make sure you have allow-hotplug eth0 or auto eth0 in there somewhere (otherwise, it won't be started on boot).
    – derobert
    May 21, 2014 at 17:29

1 Answer 1


Your /etc/network/interfaces is confused. There are several methods of assigning an IP address to the interface; you've specified dhcp which means to ask the DHCP server for an address. But then you went ahead and specified an address anyway.

I think what you want is something like this

auto lo
iface lo inet loopback

allow-hotplug eth0         # omit this line if using ifplugd
iface eth0 inet static
    netmask a.b.c.d
    gateway 139.182.e.f

allow-hotplug wlan0

iface wlan0 inet manual
    wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

iface default inet dhcp

You hopefully know the right netmask and gateway. If not, you'll need to get them from your network administrator. They should have been provided along with the IP address.

  • wooow you are a genius man, thank you so much :)) May 21, 2014 at 18:00
  • wlan with hotplug?
    – Braiam
    May 21, 2014 at 18:27
  • @Braiam allow-hotplug should bring it up when udev gets the device. I don't think OP is running Network Manager. Also not sure if OP is even using the wlan.
    – derobert
    May 21, 2014 at 18:29

You must log in to answer this question.

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