# How do i configure my eth0?

## aveach

I use dhcp from my router. I think i need to manually make some changes, because i cant emerge any packages and i cant ping yahoo. Both give me host not found errors. What should i do? Thanks

PS i am new to gentoo and i just got it installed last night.

----------

## splooge

make sure that 1) your nic is being recognized:

dmesg | more

and 2) your /etc/resolv.conf file is appropriately configured:

nano -w /etc/resolv.conf

nameserver 192.102.249.3

nameserver 192.102.249.9

and 3) you can ping your router

----------

## handsomepete

Try typing 'dhcpd eth0'.  And please stick to one thread if it's the same problem - it helps keep the noise down and eventually you'll still get all of your questions answered.

----------

## jlg

you could also do the following command to see if eth0 is loaded and if an ipaddress has been assigned to it:

/sbin/ifconfig

----------

## aveach

resolv.conf is configured correctly. And i assume everything is ok with my card because i can ping ip addresses. I just cant resolve names i guess.

I tried dhcpd eth0 and it says command not found.

ifconfig returns an inet addr: 127.0.0.1  Mask: 255.0.0.0  

is this correct?How do i fix? My net mask should be 255.255.255.0 

PS sorry about changing threads i was just trying to post the questions in the appropriate areas since my question changed as i realized more about the problem.

Thanks

----------

## jlg

127.0.0.1?  thats your loopback device! 

to be more presise try: /sbin/ifconfig eth0

The command to get an address via dhcp  is dhcpcd not dhcpd and it must be executed as root.

----------

## aveach

ok, i ran the sbin/ifconfig eth0 and i got an error" error fetching interface information:Device not found"

How do i configure so my card is recognized?

----------

## jlg

did you compile the driver in the kernel or has a module? 

if it is as a module make sure it is specified in /etc/modules.autoload  

You can see if the module is loaded with the command lsmod and you can try to load the module using moprobe. 

If the module is properly loaded or you are sure it is compiled in the kernel than running dhcpcd should assign an ipaddress to it. If it doesn't it could be an issue with the dhcp server.

----------

## aveach

My card was not specifically listed in the kernel options, so i just used the default options in the most recent kernel. The card has always worked with every other linux version that i have used so i assumed whatever the default kernel options were fine.  The card was working fine during the gentoo setup so i didnt figure it was an issue.

Can i just recompile the kernel from /usr/src/linux and build it and replace the existing one?

Also do i use the source from /usr/src/linux or from /usr/src/linux-2.4.20-gentoo-r2? Thanks

----------

## aveach

I just recompiled and added the options for all the cards listed that are made by my cards manufacturer(Broadcom). It is still failing to bring up eth0 the error is "Problem starting needed services. 'netmount ' was not started"

Anyone know anything about this? Thanks

----------

## r0cket-

 *aveach wrote:*   

> I just recompiled and added the options for all the cards listed that are made by my cards manufacturer(Broadcom). It is still failing to bring up eth0 the error is "Problem starting needed services. 'netmount ' was not started"
> 
> Anyone know anything about this? Thanks

 

The netmount error is a result of eth0 failing, but not an error message specifically from eth0.

So, couple things to do:

'dmesg | more' and look for any error messages or anything about eth0.

Post the output of ifconfig -a

Find out exactly what card you have, either by popping the case and getting a model number, or, if it's PCI, doing 'cat /proc/pci | more' and looking for something about ethernet, network, etc. You could also boot up off your install media and 'dmesg | more' and try to find some info in there about it. 

Also, it looks like previously you said you could ping IPs. Please verify this, as I'm not sure how you could ping anything but your loopback without having a functional ethernet interface.

----------

## patrickc

a couple things you might want to look at..

as before, make sure that your card is recognized by the dmesg commands. you will also want to edit the file

```

/etc/conf.d/net

```

and if you decide to use dhcp for it, make sure there is an entry there that reads something along the lines of

```

$iface_eth0="dhcp"

```

if all that is set up, then your card should work. i hope that any of this information helps you to get that stuff working. i know how annoying it can be, i'm struggling with pcmcia and wireless networking in 2.5.68 right now.  :Wink: 

patrickc

----------

## aveach

Ok, thanks. I did the dmesg and there were no errors( at least regarding the eth0) my ifconfig says:

lo Link encap:Local Loopback

inet addr:127.0.0.1 Mask:255.0.0.0

UP LOOPBACK RUNNING MTU:16436 Metric:1

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

collisions:0 txqueuelen:0

RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

It can not ping ip i was wrong.

----------

## aveach

i have also edited the conf.d/net file like the above suggestion. Thanks

i enabled the lines :

iface_eth0="dhcp"

gateway="eth0/192.168.254.254"(which is the address of my router)

Thanks

----------

## adumare

if that was the ouput from ifconfig -a  then your driver for you network card is not loaded (you need to either compile it into the kernel or build it as a module and load it).  Also if your dhcp server is setup properly  having 

face_eth0="dhcp"

gateway="eth0/192.168.254.254"(which is the address of my router) 

is redudent because the dhcp server will likely have hte gateway in it already.  The only line you need is 

face_eth="dhcp"

----------

## aveach

I have recompiled the kernel and compiled in all the broadcom drivers. My card is a broadcom 570x gigabit also known as "netextreme". I compiled in the two broadcom drivers that were available in the kernel(Tigon3 and 5700).  The card works fine when i install redhat9 or when i boot from knoppix  so i assume that one of those drivers is the appropriate one since these all use the most recent base kernel. I thought that gentoo's would be even more recent as it is the only one that has the new acpi support built into it.

Maybe i am doing something wrong in the compilation. All i am doing is using the source from /usr/src/llinux-2.4.20-gentoo-r2 then i make menuconfig, make dep && make clean bzImage modules modules_install, then i cp /usr/src/linux-2.4.20-gentoo-r2/arch/i386/boot/bzImage /boot.

I assume this just copies the new image over my old one. Is this OK? Obviously i am new to gentoo. SHould i be using the source in /usr/src/linux? Does this make a difference? Thanks

----------

## splooge

We coulda had your problem solved by now if you just listened to me.  =(

Please don't waste our time telling us what the problem ISN'T.  We'll figure that out for you; you obviously can't do it yourself, otherwise you wouldn't have posted.

We all knew your nic wasn't being found, but you insisted it was because "other versions of linux find it!"

Check the sig.  Learn how to ask appropriate questions, and don't tell us what the problem isn't when you don't know what the problem _is_.  Don't consider this a flame, consider it a learning experience.

Lastly, don't forget to mount /boot before you copy your new kernel image over the old one.  It's better if you just copied it to /boot as a new name, and make a new entry in your grub.conf file, so you can always have a 'good' kernel to boot up to in case you bork your new one somehow.

----------

## aveach

sploooge,

In none of the above posts do i ever attempt to pretend like i know what the problem here is or isnt! When i state my assumptions i am stating them so anyone who wants to try and help has a reference for the assumptions i have made in trying to resolve the problem.  Obviously, i dont know anything. But, i have noticed that alot of times on various boards that when trying to resolve problems, basic assumptions that are made are sometimes overlooked. When i stated that the card worked in other versions i was merely stating a fact. I was just trying to give as much info as possible. I hope no one else interpreted this in the same way. 

Thanks to erveryone who has provided help.

----------

## splooge

True, you said 'assume,' I overlooked that.  However the fact that you said you can ping IP addresses is rather misleading, because, if your eth0 isn't configured, you _can't_ ping IP addresses (other than 127.0.0.1)

That being said:

It sounds like you have found the appropriate driver for your network card.  Good step in the right direction.  However your kernel doesn't appear to be seeing it still.

Run these:

dmesg | grep eth0

dmesg | grep broadcom

dmesg | grep 570x

You will see one of 3 things:

1) Nothing.  This means your kernel probably hasn't been configured/copied correctly.  Make sure your kernel is newly compiled, and _make sure you mount /boot before you copy the kernel!!_

2) You will see the line loading the driver, but it fails to find the nic.  If this is the case you have either a wrong driver or ... well, we can get into that later.

3) You will see it loading with a favorable message (perhaps it found the base address and irq it runs on)  You should then be able to run ifconfig eth0 to configure it appropriately (or put it in the /etc/conf.d/net file, as appropriate)

Good luck.

----------

## aveach

Ohhh Yea! We got it. I recompiled the kernel and mounted boot like u said. I didnt realize i had to mount /boot.  The eth0 is now up and running. Thanks very much to all.

----------

