6

I have used ethernet cable to connect to a modem for internet connection to my raspberry pi. I am getting error messages when trying to open a page. when i tried sudo ifup eth0 i got this error message:

listening on LPF/eth0/b8:27:eb:82:78:a9
sending on   LPF/eth0/b8:27:eb:82:78:a9
sending on   Socket/Fallback
DHCP discover on eth0 to 255.255.255.255 port 67 interval 6
DHCP discover on eth0 to 255.255.255.255 port 67 interval 12
DHCP discover on eth0 to 255.255.255.255 port 67 interval 15
DHCP discover on eth0 to 255.255.255.255 port 67 interval 20
DHCP discover on eth0 to 255.255.255.255 port 67 interval 8
No DHCPOFFERS recieved.
Unable to obtain a lease on first try. Exiting.
Failed to bring up eth0

Thank you.

PS: I wanted to play youtube on my old tv.

6 Answers 6

3

If you get the same error as i got, try these steps:

  1. Start your Raspberry pi with the ethernet connected to your laptop.
  2. Then see that your system is sending packets to the pi. It does not matter if the pi is sending some packets or not.
  3. Then remove the ethernet connected to the end on the laptop and connect to the modem while its still running.
  4. Run this command after few seconds( say 5 seconds ). ifconfig , you can see that the pi is sending packets to your modem as well as it is receiving from the modem. (don't worry if its not, you will get it in the next step).
  5. At last set the ip address of your pi as sudo ifconfig eth0 192.168.1.X netmask 255.255.255.0

I think this issue was because other OS(like linux & others) will set the subnet mask as 255.255.255.0 and send the packets whereas raspberry pi was sending it as 255.255.255.255 which would lead the modem to reject the packet for DHCP configuration. Check for the network by pinging to google or somewhere outside your LAN. This worked for me. Please answer if any solutions found. Thank you.

4
  • and also vote. if you found it helpful. Thanks a lot.
    – thanmai
    Commented Jan 10, 2013 at 9:54
  • I tried using your solution, but it didn't work for me. ifup eth0 still pings 255.255.255.255. Is there any other way to change it to 255.255.255.0? Commented Nov 13, 2013 at 15:09
  • Did you try this: sudo ifconfig eth0 192.168.1.x netmask 255.255.255.0
    – thanmai
    Commented Nov 15, 2013 at 5:08
  • you can edit: /etc/network/interfaces change the netmask to 255.255.255.0. This will change netmask permanently.
    – thanmai
    Commented Nov 15, 2013 at 5:11
2

The DHCP server of your LAN doesn't seem to reply.

You have several solutions:

  • Enable a DHCP server on your LAN. It will return an available local IP address to any device who ask for. Typically, it is already implemented inside your modem. Just check if it is enabled.
    With another computer, please have a look in the web interface of your modem/router: http://192.168.0.1 or http://192.168.1.1 are common IP addresses used for modems/routers.

  • Set a unique IP address to your RPi. But I would not recommend if you are not familiar to network configuration.

5
  • I am not able to login to the modem. It requires a username and password which i don remember. I tried using different ip address, changing to static ip address in the /etc/network/interfaces. In the wiki page elinux.org/RPi_Hardware_Basic_Setup under the Internet Connectivity they have said that "raspbian will interpret that as a 255, not as a '0' " that as in the subnet mask
    – thanmai
    Commented Jan 3, 2013 at 16:09
  • @thanmai What IP addresses have you tried? Did you restart the network interface after updating /etc/network/interfaces (sudo ifdown eth0 && sudo ifup eth0)? What is your LAN IP address? Commented Jan 3, 2013 at 16:30
  • 1
    yes i tried restarting it. But that did not work. Now i tried ifconfig eth0 192.168.1.10 subnetmask 255.255.255.0 that also was not working and when i restarting the system. It worked like a charm. I undid the file contents of /etc/network/interfaces one. Thanks for the help.
    – thanmai
    Commented Jan 3, 2013 at 16:35
  • @thanmai Maybe the Ethernet wire was not well plugged during startup, so the DHCP server couldn't be reached. Commented Jan 3, 2013 at 16:58
  • @thanmai By the way, could you please post your comment as an answer, and accept it? It will help people with the same problem to have immediately an answer without looking in the comment :) Commented Jan 8, 2013 at 10:05
2

I have noticed that this problem happens when the wireless router does not use WPA but older protocols like WEP2. When I switched to WPA and setup the password in the router, all started working perfectly.

0

You might have hardware issues here as well. The one I experienced was about some weird interference between my wi-fi dongle and wireless keyboard/mouse. Basically, wi-fi didn't work until I replaced wireless keyboard with a wired one. Probably that's because of power consumption, but it's not very likely because I use powered USB hub. Maybe it's because of something else... Anyway, in your case I think it's worth to try to use other external devices.

0

I had the same problem, after spending a night with all changes to interfaces file etc, I found it is a network cable problem.

Please check if Link led is glowing on your raspberry, if not, please try changing your network cable before attempting configuration changes. In my case it worked - hop it helps some people.

0

I assume you are using as well two LAN interfaces which I did. I have a USB WLAN stick and the build in LAN one. My approach was to set it up correctly, then switch from the LAN to the WLAN connection (as my TV isn´t in the near from my router). During that I had exactly the same issue as you mentioned and I solved that as explained here with adding a lower priority metric (e.g. metric 100) to the 2nd interface. So based on that finding the following configurations is working for me. If that isn´t done it looks like the routing is confused and is trying to do the DHCP via the wrong network interface. So for me the following configuration was working:

Config:

auto lo
iface lo inet loopback

auto wlan0
allow-hotplug wlan0
iface wlan inet dhcp
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf 

auto eth0
iface eth0 inet dhcp
metric 100

You might also try to keep the not needed LAN connection disabled (wlan0 or eth0). To do that simply remove the auto eth0 or auto wlan0from your configuration.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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