4

G'day,

so 2 days ago, I went to bed with my internet working but when I woke up it wasn't. When I had a closer look last night, it seems syslog suggests that DHCP request times out?!

This was not happening just a couple of days ago. I'm not sure if the computer rebooted/updated during the night, but I think it didn't (movie still playing). The ethernet port light does not blink (green is ALWAYS on now, red/orange never blinks).

What could the problem be here?

[Not at my computer right now, might take a while to print responses from terminal]

Edit1: my eth0 lists an IPv6 address but not a IPv4 address, and I've set IPv6 to 'ignore', could that be an issue?

3 Answers 3

6
+50

You can check to see the status of a DCHP update by running this in a terminal:

sudo dhclient eth0 # assuming eth0 is your network adapter

That will try and get the network settings up and going and it will tell you what it's trying to do (so if it does make contact and then fails, you should see the result). If it doesn't make contact, you'll see it going on and on and on.

Before we get too ahead of ourselves though, you should make sure that this isn't a physical issue. That you think the lights are displaying in a strange way should be an indicator that there could be a problem either with the cable or the ports at either end of it. Some tests for you:

  • Try turning it off then on again.
  • If you have another network adapter on this computer, try it.
  • If the router has another port, try it.
  • If you have a spare cable, chuck it in.
  • If you have (or can borrow, buy or steal) another computer, try that on this network connection.
  • Make sure nobody dropped the internet. Okay, that's enough IT Crowd. Sorry, I couldn't resist.

Getting back the woes of DHCP, our DHCP server here sometimes goes flying down in a burst of flames. For the computers that are assigned IPs by it (semi-statically, in that they should always have the same IP), I moved them to fully-static configurations without much hassle.

If it's running Network Manager (as most Ubuntu desktops do) you want a configuration that looks something like the following screenshot. DNS is optional but I find using Google's DNS server lets me troubleshoot one less thing when the router has a hissy-fit. Gateway is probably the most important thing for routing traffic properly.

If it's a server or you've ripped out Network Manager, the manual configuration lives in /etc/network/interfaces so you want to run sudoedit /etc/network/interfaces and paste in a configuration like this one. If you're still running Network Manager, as soon as it starts running, it's going to alter this configuration to whatever it wants to. If you're running Network Manager, use the other config.

auto eth0
iface eth0 inet static
        address 192.168.0.4
        netmask 255.255.255.0
        network 192.168.0.0
        broadcast 192.168.0.255
        gateway 192.168.0.1

Same applies to the gateway. Get it right or you can't contact the outside world. As for the IP you pick. In either of these cases, you need to make sure you're picking something that isn't assigned by DHCP. An IP conflict can very quickly knacker any connectivity.

3
  • Nice, detailed answer :)
    – Lekensteyn
    Jun 9, 2011 at 14:28
  • Thanks Oli! I'm gonna rule out the physical issues completely tonight (getting another machine, and another cable - router seems fine, others in the house can connect). I tried dhclient but it doesn't output anything (and takes a while to stop processing). I removed network-manager reading somewhere that it might be meddling (d'oh!, now I can't install it again without a net connection, or can I?) I tried a static IP, but it wouldn't take. I can't ping anything (cannot resolve host). Any further ideas? Thanks again! (love the IT crowd! :) ) Will keep you updated. Jun 10, 2011 at 3:38
  • which distro did you use in the screenshot? How is it different from the Unity desktop, if it does. Jul 14, 2014 at 21:15
2

Your computer is just a DHCP client, it requests an IP address from a DHCP server (typically your home router). So I suggest you to look in the logs of your router if you've access to it.

The IPv6 addrss you're seeing is possibly a link-local address which is always set if you're connected.

1
  • Unfortunately, I didn't have access to the router, but I'll be asking my landlord tonight. I tried setting a static IP, but it didn't work either. I removed network-manager as well and then set a static IP. No luck. Checking router, cable and card tonight, any other suggestions? :) Jun 3, 2011 at 5:31
0

One of the most useful tools I have found for diagnosing some types of cable faults is mii-tool. mii-tool alows you to reset the cable auto detection setup with out actually pulling the cable in and out. This then triggers all the relevant events on ubuntu and it will re-request you DHCP, and other configuration settings.

To get details about your current set up simply

sudo mii-tool -V #to get details about your current device setup

To reset the network device

sudo mii-tool -R #to reset the device status(check that the cable is in)
sudo mii-tool -r #to restart auto negotiation.(set up the speed used by the cable)

With the cable connected mine outputs, and shows every thing is in working correctly.

  $ sudo mii-tool -v
eth1: negotiated 100baseTx-FD flow-control, link ok
  product info: vendor 00:07:32, model 17 rev 2
  basic mode:   autonegotiation enabled
  basic status: autonegotiation complete, link ok
  capabilities: 1000baseT-HD 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
  advertising:  100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
  link partner: 1000baseT-HD 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control

You must log in to answer this question.

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