1

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 8.8.8.8
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 127.0.0.1/8 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 139.182.255.255 scope global eth0
    valid_lft forevere preferred_lft forever

ip route ls

139.182.0.0/16 dev eth0 proto kernel scope link src 139.182.112.9

etc/network/interface

auto lo

iface lo inet loopback
iface eth0 inet dhcp

address 139.182.112.9

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

ifconfig

bcast: 139.182.255.255
Mask: 255.255.0.0

I try the up route list command nothing happed

16
  • 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

2

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
    address 139.182.112.9
    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.

3
  • 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 .