# eth0 not recognized

## godcandy

This is my first install of Gentoo and so far except for the fiew minor bumps in the road it has been sucessful.  

Now my problem is that I have no network adapters.  I made sure to select them when I was configuring the Kernel so that I would not have this problem.  I also made sure to emerge dhcpcd.  I have 2 network cards, one is a linksys LNE100tx (eth0) and the other is a Netgear FA311 (eth1).  Both work as of yesterday.

when I run ifconfig I get lo and thats it.  It will not let me start the adapter using 

```

/etc/init.d/net.eth0 start.  

```

This gives me

* Bringing eth0 up via DHCP    [ ! ! ]

I have been through every post I could find on this topic and have had no sucess.  Any help is always appreciated.

Thanks,

GodCandy

----------

## dkaplowitz

Whenever this happens to me I find that some needed module for my NIC hasn't loaded. Can you confirm with lsmod that the needed modules loaded? You can compare the output of lsmod with whatever's in your /etc/modules.autoload/kernel-<yourkernelversion>.

----------

## timseal

 *Quote:*   

>  Both work as of yesterday.

 

So what did you do since yesterday?  

Did you build the drivers as modules?  If so, try modprobing them.  If you built a new kernel, try update-modules and then modprobe them.

----------

## krinn

Try

```

ifconfig eth0 192.168.1.20

```

then check with ifconfig that you have both lo and eth0 setup or ping 192.168.1.20

-> Yes, problem with net.eth0 script (i recently update and the new one was bug for me, glad i have a backup!) they are switching the net instead of net.eth0 but the switching is buggy for me

-> No your cards aren't detect, problem with drivers, kernel, modules not load

ps: could post old (working) net.eth0 if you miss one that work

ps2: hint: the new buggy net.eth0 was only having a ref to load lo inside...

EDIT: i have also a backup copy of the buggy net !

BAD ONE for me

```

##############################################################################

# QUICK-START

#

# The quickest start is if you want to use DHCP.  In that case,

# everything should work out of the box, no configuration necessary,

# though the startup script will warn you that you haven't specified

# anything.

#

.........

```

One that works for me

```

# /etc/conf.d/net:

# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/net,v 1.7 2002/11/18 19:39:22 azarah Exp $

# Global config file for net.* rc-scripts

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

#

iface_eth0="192.168.0.4 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="..."

# For adding aliases to a interface

#

#alias_eth0="192.168.0.3 192.168.0.4"

# NB:  The next is only used for aliases.

#

# To add a custom netmask/broadcast address to created aliases,

# uncomment and change accordingly.  Leave commented to assign

# defaults for that interface.

#

#broadcast_eth0="192.168.0.255 192.168.0.255"

#netmask_eth0="255.255.255.0 255.255.255.0"

# For setting the default gateway

#

gateway="eth0/192.168.0.100"

```

----------

## Stimple

 *Quote:*   

> dkaplowitz  	
> 
> PostPosted: Sat Nov 20, 2004 5:32 pm    Post subject:
> 
> Whenever this happens to me I find that some needed module for my NIC hasn't loaded. Can you confirm with lsmod that the needed modules loaded? You can compare the output of lsmod with whatever's in your /etc/modules.autoload/kernel-<yourkernelversion>.
> ...

 

This is exactly what happened to me yesterday.  The module for my NIC did not load.  I typed lsmod and there were no modules loaded, then I checked with the installation manual and typed 

```
# find /lib/modules/<kernel version>/ -type f -iname '*.o' -or -iname '*.ko'
```

that listed all the modules I had selected when I was configuring my kernel.  I found the one I needed for my network connection, sis900, and added that to /etc/modules.autoload/kernel-<yourkernelversion>.  I rebooted and everything works.

----------

## thepi

I have basically the same problem as Stimple. net.eth0 start gives the same error. I have baselayout-1.11.8 emerged, the error occured first after going up from baselayout-1.10.4 to 1.11.7-r2.

my /etc/conf.d/net (stripped from all comments, otherwise it's the standard-net.example):

```

config_eth0=( "dhcp" )

dhcpcd_eth0="-t 5"

dhcp_eth0=""

preup() {

   if mii-tool ${IFACE} 2> /dev/null | grep -q 'no link'; then

      ewarn "No link on ${IFACE}, aborting configuration"

      return 1

   fi 

   return 0

}

postup() {

   

   return 0

}

```

This config doesn't work with the standard net.eth0 (symlinked net.lo) script. However, I got it to run with the following workaround net.eth0 script:

```

#!/sbin/runscript

start() {

   ebegin "Bringing $IFACE up (Workaround)"

   /sbin/ifconfig ${IFACE} up &> /dev/null

   /sbin/dhcpcd ${IFACE}&

   eend 0

}

stop() {

   ebegin "Bringing $IFACE down"

   /sbin/ifconfig ${IFACE} down &> /dev/null

   #rmmod b44 2> /dev/null

   eend 0

}

```

It does work allright this way, however it should work "the gentoo way(tm)"  :Wink: 

Any suggestions? Maybe my conf.d/net is messed up? Btw, removing the preup & postup functions doesn't do the trick, neither does using a blank conf.d/net which autodefaults to dhcp. "Manual" dhcp with the workaround script does work, however.  :Confused: 

TIA

 pi~

----------

## feffi

Hi folks, got the same errors here since I switched to >=2.6.9. Only thing to resolve it here is to rmmod the b44 module and then insert it again OR bring the device up manually before executing /etc/init.d/net.eth0... strange strange, seems like the module can't handle the device anymore? sometimes I even get a SIGFAULT...

Also strange is the behaviour when switching from win to gentoo, sometimes the networking-card isn't reset and i have to remove the battery (complete power loss) to get it working again...

@thePI: Hi  :Smile: 

----------

## thepi

Well, after a thorough debugging session with the bash scripts (mainly net.lo & /lib/rcscripts/net.modules.d/dhcpcd) I could narrow it down to our local dhcp server which won't give me a lease if the timeout's < 6secs. The strange thing is, I'm quite sure it didn't work only some days ago, even with a timeout as high as 10 secs (which is the default). Only the manual thing would work then.

I haven't tried yet whether it works right from bootup, only while debugging it worked after setting the timeout parameter back up. I'll try that later and tell you whether it works.

Regards,

pi~

p.s.: lo feffi  :Smile: 

----------

## thepi

Okay, reboot worked, but the depends are seriously broken. For example, darkstat (traffic monitor service) is started prior to net.eth0 despite the net dependency. There's an additional config in the new baselayout that's supposed to handle whether lo suffices as net dep, which i set to "no" (i.e., "lo alone's not sufficient"). Seems to be ignored however.  :Confused: 

I'll dig into that when I have time (and find the config file again, duh...)

UPDATE: It seems that adding net.eth0 to runlevel boot solves this problem. When I add it to the default bootlevel though, I do not see a single sign of net.eth0 being started (despite the fact that dhcpcd -d is called). It is up in the end however, as it's supposed to. Propably it was being started after darkstat by some other service, which nevertheless doesn't explain that there's no output whatsoever.

Regards,

 pi~

----------

