# eth0 problem...

## Rede

I don't know what happened but I restarted my computer this morning (all was working fine till I did this) and when it came back online I can no longer connect to the internet.

When booting up it displays the following:

```

eth0: dhcpcd 4.0.1 starting

eth0: waiting for carrier

eth0: carrier acquired

eth0: broadcasting for a lease

eth0: offered 192.168.1.3 from 192.168.1.1 '?'

eth0: checking 192.168.1.3 is available on attached networks

eth0: NAK: (null)

eth0: broadcasting for a lease

eth0: offered 192.168.1.3 from 192.168.1.1 '?'

eth0: checking 192.168.1.3 is available on attached networks

eth0: acknowledged 192.168.1.3 from 192.168.1.1 '?'

eth0: leased 192.168.1.3 for 259200 sceonds

   *       eth0 received address 192.168.1.3/24

```

If anyone has a clue what I may have done please let me know.

----------

## ZeuZ_NG

Well, what's the output of ifconfig -a about it?

Also, is your nameserver located at /etc/resolv.conf ?

have you tried running dhcpd/dhclient again after you finished the boot-up process? Perhaps it's a problem of some daemon/process not behing ready...

EDIT: 

Also, can you ping your router? or any other host on the lan?

----------

## Rede

Output of ifconfig -a

```

eth0    Link encap:Ethernet  HWaddr 00:1f:c6:43:5a:05  

          inet addr:192.168.1.3  Bcast:255.255.255.255  Mask:255.255.255.0

          inet6 addr: fe80::21f:c6ff:fe43:5a05/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:86313 errors:0 dropped:0 overruns:0 frame:0

          TX packets:60869 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:122536252 (116.8 MiB)  TX bytes:5922745 (5.6 MiB)

          Interrupt:18 

lo        Link encap:Local Loopback  

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:31 errors:0 dropped:0 overruns:0 frame:0

          TX packets:31 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:954 (954.0 B)  TX bytes:954 (954.0 B)

```

There is nothing in my /etc/resolve.conf file other then comments.

Well after killing it and rerunning it. I get the same output exactly but now I can connect to the internet  :Confused: 

Beforehand I could connect to the other computers on my network.

----------

## ZeuZ_NG

Well, first of all just to clear it was not a typo: it's /etc/resolv.conf

And then, if you can ping hosts in your network, or even the router, but can't get out to the internet, you're lacking to have your nameserver located in /etc/resolv.conf 

The syntax of resolv.conf is single:

nameserver XXX.XXX.XXX.XXX

One entry per DNS server, and replace XXX.XXX.XXX.XXX with the corresponding data  :Wink: 

----------

## Rede

Sorry was a typo on my behalf. It was not there before but after rerunning dhcpcd eth0 I believe it added it.

I am not sure if I will have to kill it and restart it each time I log in though. I am going to restart now. Hopefully not as that will be quite annoying.

----------

## Rede

Still having this problem. I can do a quick fix by killing it and restarting it. But if any one has found a fix for this please let me know.

----------

## ZeuZ_NG

What about adding a "sleep 5" to the top of the script? this will deay it's execution, and therefore, allow us to check if it's something not ready when the daemon is issued.

----------

## Rede

To what script?

----------

## ZeuZ_NG

to net.eth0 or the one regarding the troublesome part...

----------

## Rede

I added "sleep 5" to net.eth0, restarted and the problem still exists.

Would this have anything to do with running dhcpcd-4.0.1?

----------

## jamapii

As we have seen, the problem is that resolv.conf is empty.

I think it will be overwritten on any restart, so this must be prevented or something useful injected.

It also seems that an older version of dhcpcd does not have the problem.

So your options are:

- revert to dhcpcd-3

- (if your nameserver does not change) have a static /etc/resolv.conf, by inserting this at the top of /etc/resolvconf/update.d/libc if you use openresolv 

```
exit    # keep this line on dispatch-conf, or DNS resolution will fail!
```

- (if your nameserver does not change) put the line in /etc/conf.d/net 

```
dns_servers_eth0=( "probably your router" )
```

----------

## psyic

I am having essentially the exact same problem, except I am running dhcpcd 4.0.2.

I have to kill -9 the pid of dhcpcd running and then renew the lease on eth0 to get it to work at all past a fresh reboot.

Cheers  :Very Happy: 

----------

## logginski

I am having exactly teh same problem.

Its caused by dhcpcd when it tries to get a new lease. It overwrites /etc/resolv.conf even if it gets no DNS info. This kills the DNS I got via pppoe.

I regard this as a bug, or at least as a optional feature, to turn dhcpcd in a state where it will only overwrite (better: append) /etc/resolv.conf if it gets an actual DNS server.

*Please* someone, could you help me? Its a laptop and it travels a lot between home, working app., and different work grounds.

----------

## tylerwylie

Do you have nodns specified in your network configuration file?

----------

