# When I reboot from Windows, my ETH0 refuses to come up

## blasterboy

Ok, it's not a major hassle, but I am wondering how to solve it...

I am on a cable modem with a dhcp address. If I first start my PC up in W2K, get a dhcp address from the network, do some stuff, and then afterwards reboot into Gentoo 1.2 my network card refuses to work. 

I need to shutdown the whole pc, including turning off power to the cable modem, and restart everything before it will work again.

Failed to bring up ETH0 it says. ifconfig only shows lo as active. Trying to run 'dhcpd eth0' gives me an error message.

My idea is that I (or rather Gentoo) needs to check if a dhcp address is already given to the cable modem or not, and if so, take that address. Something goes wrong, obviously. 

I've tried 'dhcdp -k' and 'dhcpd -n' but dhcpd says it is not running.

Any pointers to what I can do to solve this ?

----------

## rac

I'm not a big DHCP guru, but...

 *blasterboy wrote:*   

> Failed to bring up ETH0 it says. ifconfig only shows lo as active. Trying to run 'dhcpd eth0' gives me an error message.

 

"dhcpd" is the server.   I think you want "dhcpcd", unless this is a typo.

Have you uncommented the 'iface_eth0="dhcp"' line in /etc/conf.d/net?  That should take care of calling dhcpcd for you when net.eth0 is brought up.

----------

## amasidlover

I have come across a problem with a linux network driver that causes the network card to appear to have the wrong MAC address. You could check the MAC address under windows, and the MAC address when linux refuses to start eth0.

Unlikely, but its worth a quick check

----------

## blasterboy

 *rac wrote:*   

> 
> 
>  *blasterboy wrote:*   Failed to bring up ETH0 it says. ifconfig only shows lo as active. Trying to run 'dhcpd eth0' gives me an error message. 
> 
> "dhcpd" is the server.   I think you want "dhcpcd", unless this is a typo.

 

It's a typo - I think. I'll try again later on just to be sure though.

 *rac wrote:*   

> Have you uncommented the 'iface_eth0="dhcp"' line in /etc/conf.d/net?  That should take care of calling dhcpcd for you when net.eth0 is brought up.

 

This is what I have in my /etc/conf.d/net : 

```

# Copyright 1999-2002 Gentoo Technologies, Inc.                                 

# Distributed under the terms of the GNU General Public License, v2 or later    

# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/net,v 1.5 2002/09/07 $                                                                                

# Global config file for net.* rc-scripts                                                                                                  

# This is basically the ifconfig argument without the ifconfig $iface           #                                                                               

#iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"         

#iface_eth1="207.170.82.202 broadcast 207.0.255.255 netmask 255.255.0.0"                                                                                        

# For DHCP set iface_eth? to "dhcp"                                             

# For passing options to dhcpcd use dhcpcd_eth?                                 

#                                                                               

iface_eth0="dhcp"                              

#dhcpcd_eth0="..."       

```

Should I also uncomment the second line and add commands to it ? 

Thanks,

Alex

----------

## pilla

I have the same problem with an eepro100 -- but I don't know how, Red Hat does not present the same issue.

----------

## lord_dut

I had this same problem when I was using Windows/FreeBSD.

I think it was the fault of the cable modem, the Toshiba PCX1100U. I don't know why, but it seemed to think the card should already know it's address. So I had to keep refreshing it after every reboot.

You might try changing the dhcp_flags to ="-H -D", which should use the DHCP assigned host and domain names for the address. It didn't work for me otherwise(properly, anyway).

----------

## blasterboy

When rebooting in Linux after using Windows, I did notice that doing only 

ifconfig -> got me only the lo (loopback) adapter.

doing ifconfig /a got me eth0 but with mac address all FF:FF:FF:FF so I guess it is not active.

Should it give the mac address even if not active ?

I tried putting the dhcp_flags '-D -H', this changed my hostname and gave me some other error message! 

Lord_dut : How did you refresh the card/cablemodem manually ? Knowing this would get me out of shutting down everything and waiting a few minutes before trying again....

----------

## lord_dut

I had to turn the cable modem on and off. Then it would need to use the new MAC. Unfortunately it almost always got me a new IP too.

----------

## Don Alfredo

I have the same problem on XP / Debian

but not will ALL DHCP servers

i don't have the problem on corporate network (W2K DHCP server) , don't have it on home LAN (Winroute DHCP server - for now, will change this one into IPCOP + Squid when i have spare time)

DO have the problem directly connected to cable modem ("Telenet")

it has something to do with the fact that dhcp client (be it dhcpcd , or dhclient,...M$ dhcp client does the same thing ! its inherent to the dhcp protocol) first tries to obtain the same address as it had the 'last time', this information is stored somewhere under /etc/dhcpc/

under M$ , it's stored in the registry , would need to check the exact hive, 

check out yr lease time , it can be found in : /etc/dhcpc/dhcpcd-eth0.info

LEASETIME=3600

RENEWALTIME=1800

REBINDTIME=1860

you will notice , that even without resetting yr cable modem you will get an address when  <renewal time> has expired between reboot , for "telenet" the lease time is 1hr , renewal time 1/2 hr , i'm afraid their modems are configured that they only pass ONE ip address, this is why the problem doesn't occur with another dhcp server, it just gives another address from its pool.

workaround ?

1) if you have a 'spare oldie' lying around, install it as a firewall /proxy , so this machine alone will connect to cable modem - an old 486 with IPCOP, Coyote, or any floppy firewall does the trick...

2) buy a BB-router , which is a small box, doing some minimal firewalling, and dhcp server (rather expensive)

3) just an idea , will try this out someday myself : 

when shutting down linux,  first do ifconfig eth0 down, then delete the /etc/dhcpc/blablabla file (the one which saves last obtained address, different name depending on dhcp client ? ), then shutdown, if this works, script it and add it to the shutdown sequence...

grtz,

Fred

----------

## vhkristof

typing this in your command prompt from windows, before you reboot:

```
ipconfig /release

```

It's known that Windows does not release the lease very well ...

----------

## funkymunky

vhkristof wrote

 *Quote:*   

> typing this in your command prompt from windows, before you reboot: 
> 
> Code:	
> 
> ipconfig /release

 

I can confirm this on a freshly installed gentoo system (live CD 1.4)

I was running windows (god knows why:-), then decided to reinstall gentoo. 

Rebooted with the Live CD (without switching off PC) and reinstalled. Finally I was done, but AARRRGGHH, I got the "failed to bring eth0 up....netmount was not started..." error message.

Rebooted back to windows (I guess it has it's uses) , started a MS-DOS shell and typed:

```
ipconfig /release_all
```

Reboot to gentoo, and it worked like a charm!

I guess (as stated earlier in this thread) it has something to do with the ethernet card not willingly relinquishing its current dhchp/IP settings unless explicitly told to do so, or by turning off all power to the PC completely.

The knowledge base in these forums is amazing! Thanks guys!

funky.

----------

