# setup dhcp network?

## andcon

Hi, I have managed to install Gentoo Linux, for my first time   :Cool:   the only problem that I have is that I can't get my NIC to access the Internet via my D-Link DSL-504 router. I ran the net-detect eth0 command on the install and that picked up my network fine. The problem is after i've installed Gentoo and rebooted my network is no longer active... I connect to the internet via eth0 and DHCP and wonder if you could help me get my system back on the internet so that I can install the rest of my Gentoo system.

I think the trouble is when I nano -w /etc/conf.d/net when I did the installation?? Do I leave the default values that are in the file or change them?

----------

## rtn

Is your NIC detected by your custom kernel?

--rtn

----------

## andcon

im not sure how to check that... but the network was detected alright on the install... i.e net-detect eth0

Is there a way to check that it is detected by the kernel?

----------

## rtn

 *andcon wrote:*   

> im not sure how to check that... but the network was detected alright on the install... i.e net-detect eth0
> 
> Is there a way to check that it is detected by the kernel?

 

The kernel that you used for the install supports just about every

network device known to the linux kernel.  You had to compile your

own kernel during the install, and that's the one you need to make sure

supports your NIC.

If you compiled the driver as a module, you could see it with 

```
lsmod
```

You could also check your kernel output

```
# dmesg | grep eth

eth0: Lite-On 82c168 PNIC rev 32 at 0xe400, 02:00:08:xx:xx:xx, IRQ 11.

```

--rtn

----------

## andcon

it doesn't look like my NIC is installed properly since i got no feedback from dmesg | grep eth

or lsmod

Am I still able to install the NIC modules? or is it too late, and i'm going to have to install again?

just checking through the installation instructions again I came across the Final Network COnfiguration  again

22.Final Network Configuration

Add the names of any modules that are necessary for the proper functioning of your system to /etc/modules.autoload file (you can also add any options you need to the same line.) When Gentoo Linux boots, these modules will be automatically loaded. Of particular importance is your ethernet card module, if you happened to compile it as a module:

Code listing 22.1: /etc/modules.autoload

This is assuming that you are using a 3com card. Check /lib/modules/`uname -r`/kernel/drivers/net for your

card. 

3c59x

Edit the /etc/conf.d/net script to get your network configured for your first boot:

Code listing 22.2: Boottime Network Configuration

# nano -w /etc/conf.d/net

# rc-update add net.eth0 default

If I can find the correct module for my D-Link 504 NIC card can i enter it as above still, or is it too late?

----------

## rtn

You'll need to recompile your kernel.  

```
cd /usr/src/linux

make menuconfig

```

Make sure you find and include your ethernet drivers under

Network Device Support --->

Ethernet (10 or 100Mbit) --->

Unfortunatly, I don't have any idea which driver your card needs.

```
make dep && make clean bzImage modules modules_install
```

--rtn

----------

## andcon

Thanks for your help, one last thing... after i've recompiled the kernel will I have to go through the installation as if id just compiled the kernel? or will my Grub settings etc still be ok?

----------

## klieber

 *andcon wrote:*   

> If I can find the correct module for my D-Link 504 NIC card can i enter it as above still, or is it too late?

 

Are you sure you have a D-Link 504 NIC???  Iin your original post, you said you had a D-Link DSL-504 router.  The two are very different.

What kind of NIC do you have any we can probably tell you what driver to use?

--kurt

----------

## andcon

yes sorry, reading the wrong thing   :Shocked:   the actual NIC is the D-Link DFE-530TX+

----------

## rtn

 *andcon wrote:*   

> Thanks for your help, one last thing... after i've recompiled the kernel will I have to go through the installation as if id just compiled the kernel? or will my Grub settings etc still be ok?

 

After the kernel is compiled, you'll just have to mount your /boot

filesystem and copy the bzImage file there.  You'll probably want to

back up your current bzImage and make sure that your grub.conf 

includes stanzas for both kernels (just in case the new kernel doesn't

boot, it's much easier then using the boot cd...)

--rtn

----------

## klieber

 *andcon wrote:*   

> the actual NIC is the D-Link DFE-530TX+

 

IIRC, that NIC uses the Tulip driver.  When you're recompiling your kernel, try compiling that driver into the kernel.  If that still doesn't work, you can try compiling it as a module and modprobing it, but I have better luck compiling NIC drivers directly into the kernel.

hth

--kurt

----------

## rtn

From the Ethernet-HOWTO:

```
4.14.8.  DFE-530TX

  Status Supported, Driver Name: via-rhine

  Another card using the VIA Rhine chipset.  (see ``VIA Rhine'') Don't

  confuse this with the DE-530 which is a tulip based card.

```

Try that one.

--rtn

----------

## andcon

thanks guys, i'll better wait until the morning.... made too many mistakes in the past trying to rush things lol, want to get this right  :Smile:  i'll try and install the VIA Rhine drivers and let you know how I get on

----------

## andcon

i tried compiling my NIC in the kernel, by enabling it and also by adding it as a module, but it doesn't seem to be registering when i use lsmod or the #demsg | grep eth  commands

----------

## grj

I believe the approprite driver is the 8139too driver for that card. Now lets put all you instructions together.

First rebuild the kernel

cd /usr/src/linux

make menuconfig

under - Network Device Support

[*] Network device support

under - Network Device Support/Ethernet (10 or 100 Mbit) --->

<*> RealTek RTL-8139 PCI Fast Ethernet Adapter Support

<Exit>

<Exit>

<Exit>

<Yes> to save the new kernel configuration

make dep && make clean bzImage modules modules_install

nano -w /etc/modules.autoload

add this without quotes '8139too'

save the changes to modules.autoload

Now lets but the new kernel where it belongs

mount /boot

cp /usr/src/linux/arch/i386/boot/bzImage /boot

umount /boot

shutdown -r now

Hope this helps!

----------

## pheelay

I originally had the same problem!! My card is a D-Link DFE-530TXs - oh what a differenece that little 's' makes!!  I couldn't get linux to recognise it either the Via-Rhine or Tulip drivers   :Sad: 

Eventually, after many hours of googling, I found that I needed to use the Sundance Alta driver - how random.  Different chipset you see - DL-10050

Aw well - of course this message is probably of no use to anyone in this thread!   :Rolling Eyes: 

Phil

----------

## andcon

thanks for the help, the correct driver was the 8139 driver, my system is now capable of accessing the internet   :Cool:    now it just leaves me to install a window manager could take some time to download   :Rolling Eyes:    here goes lol 

Once again thanks for the help in getting me going  :Smile: 

----------

