# Network question: failed to bring up eth0

## plate

Took me a while to get my dusty old Pentium MMX 166 Mhz 64 MB 1.5 GB desktop to accept the kernel I compiled for it. In the end I had to switch off every single fancy IDE support option to get rid of the kernel panic attacks and DMA timeouts I've experienced since my last post on Friday... But I'm done now, it works, hda is here to stay.

There's only one error at boot left: Failed to bring up eth0. Now, I know this message is triggered by something going wrong during /etc/init.d/net.eth0, but I have no idea why it fails. I compiled support for my 3com card into the kernel, and it gets recognised and loaded and everything, no problem there, dmesg is very clear about that. 

After booting, eth0 is not present when I type ifconfig, only lo is, but it's sufficient to type 'ifconfig eth0' to get it started! And it even gets an IP address from my DHCP server on a different box, so I have a network, just not after bootup. 

The only line in my /etc/conf.d/net that gets executed is:

```
iface_eth0="dhcp"
```

Everything else has a # in front. What is it I am doing wrong? I'd be grateful for every hint.

----------

## pjp

Did you do: 

```
rc-update add net.eth0 default
```

----------

## wildcard

On that other box that you tried this network card on did you have to pass any options to the dhcp server.

----------

## plate

Sorry for the misunderstanding: The DHCP server is on a different box, not the network card. I never removed it from where it is, I'd have six year old dust flying around the room if I did.   :Shocked: 

Thanks for the rc-update tip! I had actually thought of that myself, but I had done it previously, and running 'rc-update add net.eth0 default' again just produced 

```
eth0 is already in default runlevel
```

or somesuch. This will probably remain a mystery to me, because everything is just fine now after a simple reboot. Maybe the fact that I edited /etc/resolv.conf and changed the first nameserver entry to the real DHCP server (oops) has something to do with it? I didn't touch anything else...

----------

## pjp

 *plate wrote:*   

> There's only one error at boot left: Failed to bring up eth0.

 After I had posted, I re-read that line and figured you had.  Strange problem.

----------

## plate

 *kanuslupus wrote:*   

> Strange problem.

 

Ha! I think I know what happened (did again just now). I have two Linux PCs on the LAN and a not very smart DHCP server that I can't configure to MAC addresses or anything fancy like that, so when I fire up both Linux hosts, sometimes they start wrestling about the same IP address. Apparently the last address is kept in a file somewhere and gets preference over what the server actually has on offer...

Any idea how to fix that? Fixed IP addresses aren't an option because I have to change networks too often: My DSL line is so jumpy that I have to switch to ISDN several times a day, and the DHCP servers in the respective routers distribute addresses in two different nets, 192.168.0.x and 192.168.1.x.

----------

## pjp

 *plate wrote:*   

> Apparently the last address is kept in a file somewhere and gets preference over what the server actually has on offer

 The DHCP server keeps it in a file, or the client does?  Sounds like it is a DHCP configuration issue.  Narrowing down the 'file' you refer to is probably the key.  I'm sure there's a way to modify it or remove it.

----------

## plate

Not the server, the client does. man dhcpcd tells me that it restores old leases from the /etc/dhcpc/dhcpcd-eth0.cache file, and there's another file called dhcpcd-eth0.info which actually has the server ID and everything stored.

Are there ways to wake up the client when the former server is suddenly gone, and make it get a new lease from the other server?

----------

## pjp

I'm not entirely positive this is valid, but perhaps a script entered into /etc/conf.d/local.stop could remove the cache files (.cahce & .info).  That of course only solves the problem when shutting down (and thus restarting).  If your network dies in the middle of being used, a similar script (same?) could remove those files and restart dhcpcd?

Ideally you wouldn't have to do this manually, but I'm not sure of how to do it automatically.

----------

