# problems with eth0 :[

## asmox

k, first off i'm still a relative newbling to linux in general.. so take time :O

i just recently finished up my gentoo install.. everything loaded perfectly upon boot with the exception of eth0, i recieved the following error -

*Failed to bring eth0 up

*ERROR: Problem starting needed services

              "netmount" was not started.

btw, i'm using a 3com 3c940 Gigabit LOM onboard lan controller

confused as i was (considering eth0 was working perfectly even during the last parts of the installation while i was chrooted), i started looking through the relevant files/mods. the following is what i think is the pertinent information from each -

lsmod contains sk98lin (which is the correct module for my card)

lspci lists the following: 00.0a.0 Ethernet Controller: 3Com Corporation 3c940 10/100/1000Base-T [Marvell] (rev 12)

/conf.d/net has eth0 set to dhcp (everything else commented)

/etc/hosts only contains localhost

/etc/resolv.conf -

```
domain hnet

nameserver 192.168.0.1

search hr.cox.net
```

now, considering that last bit.. i tried going back into /conf.d/net and setting eth0 to a static IP/broadcast/subnet mask configuration, and set the gateway to eth0/192.168.0.1.

after rebooting, eth0 DID initialize.. at this point however, i proceeded to get 100% packet loss to every host i tried to ping. i attempted 'emerge sync' for the hell of it, and got the following - 

Notice (-3, 'Temporary failure in name resolution')

i'm a bit confused.. firstly as to why eth0 refuses to work with DHCP now when it worked fine during the install. as for the name resolution/packet loss, i could have possibly made a typo in one of my ip settings somewhere.. am gonna go check that right now.

any other thoughts would be appreciated

thanks

----------

## grepcomputers

if you ping an IP address, do you still get 100% packet loss?

Your nameserver (DNS server) is set to 192.160.0.1 ... which sounds wierd to me (but I could be wrong)

If you can ping IP addresses (and browse to them) but not to URLs, then it appears that you do not have the correct DNS server set. And if this is the case, your computer will be unable to resolve URLs to IP addresses, hence the "failure in name resolution".

Oh, and FWIW, though I doubt this applies to you, places like, for instance, my college, have disabled pinging outside of their network, so I always get 100% packet loss if I try to ping, say, google...

cheers...

...grep

----------

## asmox

i'm unable to ping hosts via url's or ip addresses.

as for the dns server.. yeah i made a typo in the original post, edited out now - it's actually 192.168.0.1.. and it does reflect in all my relevant gentoo files (just checked)

the dns server is straight from ipconfig (in win), so i'm pretty sure it's set correctly.

am i missing a setting in some obscure file or anything like that? :[

----------

## asmox

actually, there may be something wrong with my DNS server as well.. cause pinging ip's results in 100% packet loss, while pinging url's results in 'unknown host www.urlhere.com'.

i triple-checked all my ip/dns/subnet mask settings though, and they're all set correctly (afaik).

----------

## grepcomputers

well, here's my question...are you running a DNS server on your machine, then? Because 192.168.0.1 is not a public IP address. In fact, my router's IP address is 192.168.0.1. It is not running a DNS server. However, my college is running a DNS server, so my resolv.conf looks something like this:

```

nameserver 134.82.7.253

nameserver 134.82.24.4

nameserver 144.80.128.8

```

The only reason I keep harping on this is because all those errors sound like, well, the inability to resolve IP addresses.

However...

What is your setup? Are you running a router and your computer is behind it? Because your gateway is set to 192.168.0.1...

A little more information about your actual set up might help. IE, are you behind a router, on a cable modem, what ISP (cox?).

I wonder...it would be useful to know the output of ifconifg from during the install (boot the livecd again and see what the output is?)

And you shouldn't need to reboot to restart the network, just do "/etc/init.d/eth0 restart" (as root)

I mean, from what little I know, it sounds like a) DNS is misconfigured and b) DHCP might be required, but I'm not sure what's going on here...

cheers...

...grep

PS - I guess, if it might help, I could try explaining the way my network is set up and what my config files are...

----------

## asmox

i'm running a cable modem (cox) through a netgear router.

it is running a dhcp server.. following are the values in my router config for the DHCP section- 

DHCP Server (Active)

Pool Starting Address 192.168.0.1 

Primary DNS Server 0.0.0.0

Secondary DNS Server 0.0.0.0

Count 32

could the above errors be happening because my dhcpcd isn't configuring eth0? (see https://forums.gentoo.org/viewtopic.php?t=162030 for that problem)

During the install, my network wouldn't work until I ran 'net-setup eth0' and had DHCP configure eth0.

And now, considering dhcpcd just doesn't do anything period, could that be causing eth0 to not initialize? And for that matter, could trying to run a static IP when my router uses a dhcp server cause those problems?

My knowledge of networking is minimal, so I'm just crawling in the dark :/

----------

## grepcomputers

OK, so, here's what I'm thinking so far...

You got the wrong DNS server. 192.168.0.1 points to your netgear router, which I doubt is running a nameserver (aka DNS server). cox should be running at least two of their own DNS servers, get the IP addresses of them from cox, those go in "/etc/resolv.conf" as "nameserver" entries. And, when you know these, you can add the values to the router's dhcp server as well...

Your gateway should indeed be set to 192.168.0.1

Your broadcast should be set to 192.168.0.255

Your netmask should be set to 255.255.255.0

(I use "should" loosely here, it depends somewhat on how your router is set up, but these are the most likely values)

The router address is (probably, it seems to be default for most routers) 192.168.0.1 (hence it being the gateway address) so the starting address of the pool should be 192.168.0.2 at least, otherwise a computer could end up with the IP address of the router...

You don't need to run dhcpcd manually, running the eth0 init script should deal with that all on its own. As I said, all you need to deal with your network connection...:

/etc/init.d/net.eth0 start

/etc/init.d/net.eth0 stop

/etc/init.d/net.eth0 restart

(oops, I forgot the "net." part last post...and, these all need to be run as root.)

I have never manually run dhcpcd and it is currently running due to the net.eth1 script (that's the interface I use, not eth0). if dhcpcd doesn't run successfully, then no, eth0 will not initialize...if it is set to pull values through DHCP. So...

...you *could* try setting everything statically, it should work (how many computers connected to the router?)

Use the values for broadcast, etc, that I suggested above, and set your IP address to something like 192.168.0.10...so, in /etc/conf.d/net

```
iface_eth0="192.168.0.10 broadcast 192.168.0.255 netmask 255.255.255.0"
```

and later on

```
gateway="eth0/192.168.0.1"
```

In /etc/resolv.conf

```

nameserver <some cox dns server>

nameserver <some cox dns server #2>

search hr.cox.net

```

(note: all nameservers should be IP addresses)

do you need the "domain" entry in it? I don't have one...try it without and see what happens...

this is what my "/etc/hosts" file looks like:

```

127.0.0.1       localhost

127.0.0.1       aakaadou

127.0.0.1       localhost.localdomain

127.0.0.1       aakaadou.localdomain

```

aakaadou is my chosen hostname, thus, "/etc/hostname" looks like

```
aakaadou
```

I'm going to go draw pictures of your network now, see if I can get a better idea...   :Wink: 

ugh, I'm tired and not making much sense...

good luck, I'll check back later...

cheers...

...grep

----------

## asmox

does dns work differently between linux/windows then?

i thought that dhcp was supposed to retrieve the DNS address(es) automatically?

----------

## grepcomputers

 *Quote:*   

> following are the values in my router config for the DHCP section-
> 
> DHCP Server (Active)
> 
> Pool Starting Address 192.168.0.1
> ...

 

According to these values, your DHCP server has no DNS servers stored in its configuration. Actually, is your router set to retrieve values from cox via DHCP?

Either way, I highly doubt your resolv.conf file should be pointing your computer to 192.168.0.1 as a nameserver, so that value is wrong.

If you do try setting everything statically, then you will have to set the DNS servers manually as well.

One thing I noticed is that, once my resolv.conf existed and had values, restarting eth1 (configured with DHCP) never seemed to change the values in it, even when I messed around with it. So it might work a bit differently than in windows, in that sense.

cheers...

...grep

----------

## asmox

 *Quote:*   

> Either way, I highly doubt your resolv.conf file should be pointing your computer to 192.168.0.1 as a nameserver, so that value is wrong.

 

I don't know about that..

The following is my eth0 experience from the livecd -

```

livecd root # modprobe sk98lin

sk98lin: Network Device Driver v6.22

eth0: 3Com Gigabit LOM (3C940)

       PrefPort: A      RlmtMode: Check Link State

             eth0: network connection up using port A

       speed: 100

       autonegotiation: yes

       duplex mode: full

       flowctrl: symmetric

       irq moderation: disabled

       scatter-gather: enabled

livecd root # ping -c 3 www.google.com

ping: unknown host www.google.com

livecd root # ping -c 3 216.239.51.104

connect: network is unreachable

livecd root # net-setup eth0

SELECT Use DHCP to autodetect my network settings

livecd root # ping -c 3 www.google.com

(pinging successful, omiting values to save space)

livecd root # ping -c 3 216.239.51.104

(pinging successful, omiting values to save space)

```

ifconfig eth0 from livecd install contained the following values -

inet address: 192.168.0.2 Bcast 192.168.0.255 Mask: 255.255.255.0

(those are the relevant values afaik?)

Now, when I checked /etc/resolv.conf.. the nameserver was set to - you guessed it - 192.168.0.1. And it worked.. during the install. But now, after the fact, it no longer works. Are you sure it can't be something with dhcpcd? Cause during the install, the network only came up after eth0 got configured by dhcp via net-setup.

And like I said in an earlier post, if I try to set everything statically.. pinging IP's gets 100% packet loss and pinging url's gets unresolved dns names. But I shouldn't need to set it statically, DHCP should be working (as per the install).

edit: all the above from the install was after chrooting into the environment.. /etc/resolv.conf was the same as it is now, and /etc/conf.d/net was the same as it is now as well (iface_eth0="dhcp").

basically, same exact settings - works while chrooted from livecd, but doesn't work when actually booting into the gentoo linux system. has to be something with dhcpcd, i think.. but then why does pinging ip's (when i set everything statically) result in 'Destination Host Unreachable' and 100% packet loss? lack of nameservers shouldn't make a difference if you're pinging ip's, right?

doesn't make sense to me.. argh :[

----------

## grepcomputers

You are right, lack of nameservers won't affect pinging IPs - I was thinking that the nameserver thing was wrong as well as there being something wrong with DHCP. I wanted to see if manually setting *everything* would then allow the network to work correctly. Because if it functions at least when it is like that, then we know for a fact that the network card, cable and kernel module are all working properly (and the router as well).

But you set everything manually, and while the interface did come up, you couldn't ping IP addresses, right? So...but the interface did come up. Can you ping the router? Or any other computers on your internal network (if there are any)?

Also, if there is a problem with dhcpcd, you could try unmerging it and reemerging it. -- "emerge unmerge dhcpcd" "emerge dhcpcd"

What are your use flags and CFLAGS?

Also, did you use a Gentoo 2004.0 livecd or a Gentoo r1.4 livecd?

cheers...

...grep

----------

## grepcomputers

OK, I just booted to the Gentoo 2004.0 basic LiveCD. It creates the entire "normal" directory structure in the RAMDISK, where it stores config files in /etc. These are the config files it uses initially. After you have chrooted, you still have not rebooted, so it is *still* using the initial config files. The resolv.conf file in the chrooted /etc does not contain the values the computer is actually using unless you copied the resolv.conf file (or the values contained within) from the ramdisk to the chrooted /etc.

Boot from the livecd. Get the network working. Don't install gentoo or chroot or anything, just boot from the livecd and, once you get the network working, check out the settings in "/etc/conf.d/net" and "/etc/resolv.conf". I'd love to know what they are.

If you want, I'll PM you my AIM screenname, some of this might be easier done in "real-time".

cheers...

...grep

----------

## asmox

Ok.

Booted from livecd.. did modprobe sk98lin and net-setup eth0 to get the network up.. here's /etc/conf.d/net and /etc/resolv.conf - 

/etc/conf.d/net

```

iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"
```

every other line is commented.

/etc/resolv.conf

```
nameserver 192.168.0.1

search hr.cox.net
```

When I set my actual linux system files to the exact same settings.. eth0 DOES come up, but every IP I try to ping comes back with Destination Host Unreachable and 100% packet loss. If I try to set everything to DHCP, then eth0 just fails to come up period.

I did try to ping my router (192.168.0.1) while everything was set statically, and that came back with 100% packet loss as well.

I used the 2004.0 for amd64 livecd. My CFLAGS are -02 -pipe -fomit-frame-pointer. USE flags are dvd, cdr, aim, alsa (in make.conf anyway, tons more in the default use file).

As for unmerging and reemerging DHCPCD, I can't really.. considering I don't have an operational network to emerge with. Can I reload it from the livecd?

----------

## grepcomputers

Well, if manually configuring everything still doesn't get it working - and you are using the same values from when it worked on the livecd - then DHCP not working is the least of your problems - even if it did work I doubt your network would work, as it would get and set the values you are already using (as it does via the livecd).

Hmmm.

I talked to a friend of mine, he wasn't sure what was going on. I mean, if I had my way, I'd throw your computer on my network and use ethereal to see if any packets at all were coming from your computer. See, when you do get the network to come up, that is only because you set the values manually - so it does not need to recieve any info from outside the computer to bring the network up. However, when you try to DHCP it fails...so I am wondering if maybe no packets are leaving your computer, or maybe none are coming in...

Wait...do you have iptables and all installed and running, or any kind of firewall at all? I've never condsidered this, but I suppose a *very* restrictive firewall could actually block all incoming and/or outgoing traffic. I wonder if iptables can block DHCP? (See, the LiveCD doesn't run a firewall, so this is a difference)

It sounds like there is something wrong with your network, but that it is not a configuration or DHCP problem. I still can't figure out what the difference between the LiveCD and your current install is.

The only thing I can think of off the top of my head right now is that maybe the module compiled by the kernel is not working properly. And that could be a difference - different kernel versions and module versions between the LiveCD and your current install.

I'm sorry I cannot be of more help right now. However, do try the arstechnica linux-king-fu forum, as they are quite good, too (although not specific to gentoo). -- http://episteme.arstechnica.com

Keep posting more info, something may trigger a thought in my head.

I might not be terribly responsive right now, I have a lot of work on. I've got theologians, philosophers and psychologists coming out my ears right now (as in reading works by them).

cheers...

...grep

----------

## c0r3dump

Plain and simple.

set /etc/conf.d/net to use dhcp.

remove the netgear router and plug your computer directly into the cablemodem.

If it works then you have a setting problem in your netgear. set it to default and try it again.

If that fails then you have a problem with either your nic card or your config files.

ping 127.0.0.1 if that replies your nic card is fine.

check your /etc/hosts file. remove everything except for 127.0.0.1 localhost.

let us know how it goes.

 :Smile: 

----------

## grepcomputers

I second what c0r3dump says. And his method is simpler than mine.  :Smile: 

----------

## asmox

k, i'll try that tomorrow, c0r3dump, and let you know what happens.

----------

## farrioth

I'm having the exact same problems.

My network card works fine when booted off the livecd.

I can't ping anything except 127.0.0.1

I'm not using DHCP.

Thanks in advance for any help.

----------

## ricadelic

asmox: Have you fixed your prob already?

I've got the same problem.

Only i created it by accident. I did a rm -R /usr instead of rm -r ./usr   :Confused: 

I broke out of the rm -R as soon as i discovered but /usr/bin shrank to a very small size. 

The result was an half broken system. I did a reiserfck --rebuild-tree --scan-whole-partition /dev/hdb1 and voilla... half of the files were back. 

Then i did some qpkg -c checks and restored almost all of the essential files.

But... my network isn't working anymore :S:S:S:S

Same thing. Cannot ping outside... No dhcp request can be made. No ping from another workstation. But a ping to the interface eth0 works    :Cool: 

netstat -r 

route -n 

and ifconfig -a seem ok. After all, i didn't change my config... 

I got some questions:

1 What packages are needed for network connectivity, for the actual transer of data?

It looks like the cable is damaged, but its okay.  I checked it.

Hey grepcomputers: a home-router usually forwards the DNS-requests, so his config should be right.

I found some related threads:

https://forums.gentoo.org/viewtopic.php?t=40926&start=0&postdays=0&postorder=asc&highlight=net+work+traffic

https://forums.gentoo.org/viewtopic.php?t=32978

I hope we can fix this straaaaange problem. (although i probably know that a reinstall will help. I just don't want to give up looking  :Razz: )

Greetings Gentoo-lingz

----------

## farrioth

I eventually solved my problem.  When booted into my new system, the eth1394 module was loaded.  My 1394 card was then eth0, and my 3c940 was eth1.

----------

## ricadelic

Ah lol, something simple at last  :Razz: 

I'm doing a emerge -eD system to see if that works..

It would be great if i could filter out which packs have missing files and build these ones first...

Greets

----------

## ricadelic

It worked, i'm reinstalling and just before merging the xfree pack, my netconnectivity was there again... Woooohoooo   :Cool: 

----------

## DiddyWolf

The thing is, this is my 3rd install of gentoo, and the first one to ever have this problem. The only differeance that i can figure out is that I 1) used the 2004.1 release instead of the 2004.0, and 2) I installed from stage 3 this time instead of stage 1 (just to be quicker,  didn't feel like spending 3 days installing it). could this have any affect maybe? perhaps one of those precompiled files in the stage 3 install is screwing it all up? just a thought. either way, i'm gonna attepmt to rebuild my kernel, play with the config. If all else fails, i'll try a stage 2 install...

--DiddyWolf

PS: What release and stage tarball were ya'll using that it's messing up with? i have a good feeling it's something with the 2004.1 release... I never had this problem when i used 2004.0.

----------

## crazyweber

I am having this problem with 2004.0 and stage 3.  Also I installed Gentoo connected directly from the wall instead of on my router because the firewall wouldn't allow me to emerge the packages i needed.  After the install I tried to use my router and no success   :Sad: 

Any help would be great.

----------

## Captin

I'm having this same problem. I'm using 2004.1 with stage3. I didn't have this problem when I installed earlier with gentoo 1.4 livecd. 

how can you determine what network card you have and what driver corresponds to that NIC?

Thanks for any help

----------

## ricadelic

 *Quote:*   

> how can you determine what network card you have a? 

 

Do  

```
lspci 
```

----------

## Captin

Has anyone determined a how to fix this problem yet? I still can't get it to work.

----------

