# Nic Card

## dloenzen

Hello all.  I am new to linux, but quickly getting the hang of it.  I would like to know how to install a second nic in a production server.  It is a Netgear fa31fx which from what I understand uses a "tulip" driver?

Please assist.  I'll be very grateful.  Need help with Novell or MS, I'm your guy.  But with linux......................I'm a virgin!

Thank you.

----------

## drescherjm

Have you done a 

```
modprobe tulip
```

You can check if the tulip driver is loaded via

```

lsmod | grep tulip
```

----------

## dloenzen

I received "FATAL: Module tulip not found."

Thanks.

when I do a lsmod | grep tulip, nothing happens.  I just get returned to the prompt

----------

## drescherjm

Then you probably need to build your own kernel or possibly the tulip driver is compiled in the kernel. Can you post the output of the following command:

```
# zgrep TULIP /proc/config.gz
```

If it says CONFIG_TULIP is not set

You to add the tulip driver as a module you need the following lines in your 

/usr/src/linux/.config

```
CONFIG_NET_TULIP=y

CONFIG_TULIP=m

```

----------

## dloenzen

Then what happens after I modify the file?  What must I do to build my own kernel?  Will it trash the current configuration?

Thanks.

----------

## drescherjm

I changed my last post can you answer the zgrep question first. 

Also have you compiled your current kernel? Did you use genkernel?

----------

## dloenzen

John,

I did get the CONFIG_NET_TULIP is not set.  I don't understand the whole compile your kernel thing.  I couldn't fine /usr/src/linux/.config

----------

## dloenzen

John,

I am running emerge genkernel now.  looks like it has failed.  Couldn't download 'dmraid-1.0.0.rc10.tar.bz2'. Aborting

----------

## drescherjm

What version of genkernel? Did you do an emerge --sync recently? If not please do so. What kernel version are you using? If you are unsure the following command will tell you:

```
uname -a
```

----------

## dloenzen

Okay John.

I have done emerge --sync, emerge portage (not sure about the 6 config files in the /etc dir that need to be looked at), emerge genkernel.  I am at 2.6.15-gentoo-r7

----------

## drescherjm

Do you have a /usr/src/linux?

If not do you have anything in /usr/src?

Are you using grub or lilo?

----------

## dloenzen

I do have a /usr/src/linux (no .config in it though)

----------

## drescherjm

Can you see if it linked to your kernel version.

```
ls -al /usr/src
```

You should get something like

linux -> linux-2.6.15-gentoo-r7

----------

## dloenzen

Yes it is.

----------

## drescherjm

If that the link is to the correct kernel run the following commands:

```
 zcat /proc/config.gz > /usr/src/linux/.config

echo "CONFIG_NET_TULIP=y" >> /usr/src/linux/.config

echo "CONFIG_TULIP=m" >>  /usr/src/linux/.config

cp /usr/src/linux/.config /usr/share/genkernel/x86/kernel-config-2.6

```

This first set of commands create your .config file from what your kernel is currently using.

Then compile the kernel with genkernel

```
genkernel --mountboot all
```

----------

## drescherjm

I assume you are running x86 and not 64 bit? Please be careful as I edited the first commands to reflect that..

----------

## dloenzen

What do these two lines do?

zcat /proc/config.gz > /usr/src/linux/.config

cp /usr/src/linux/.config /usr/share/genkernel/x86/kernel-config-2.6

----------

## dloenzen

I did a uname -a and its says x86_64.  I type exactly what you suggested I type.

----------

## drescherjm

The first line uncompresses the kernel config for the current running kernel to your kernel sources.

The second line copies that to the place where genkernel keeps previous .config files. I believe the default operation of genkernel is to overwrite the one at /usr/src/linux with the one at /usr/share/genkernel/x86/kernel-config-2.6

----------

## dloenzen

I did a uname -a and its says x86_64.  I type exactly what you suggested I type.

----------

## drescherjm

 *dloenzen wrote:*   

> I did a uname -a and its says x86_64.  I type exactly what you suggested I type.

 

Oh so put that command back as 

```
cp /usr/src/linux/.config /usr/share/genkernel/x86_64/kernel-config-2.6
```

----------

## drescherjm

I hope I am not confusing you too much...

----------

## dloenzen

I've done everything else, do I need to redo it. (genkernel --mountboot all)

----------

## dloenzen

No, you aren't confusing me too much.  I wish I had a little better grasp at what I was doing, but that will come in time.  I originally typed the /x86_64 for the cp so all should be okay.   It has finished.

----------

## drescherjm

That is good. Now you need to activate your new kernel.

Are you using grub?

Are there new files in /boot ?

----------

## dloenzen

Grup I think.  Yes, there are new files in /boot

----------

## drescherjm

Can your post your /boot/grub/grub.conf file?

If this will be difficult (I am not sure you are reading the forum with the same box) we can work around that...

----------

## dloenzen

mail grub # vi grub.conf

# Which listing to boot as default. 0 is the first, 1 the second etc.

default 0

# How many seconds to wait before the default listing is booted.

timeout 5

# Nice, fat splash-image to spice things up  :Smile: 

# Comment out if you don't have a graphics card installed

splashimage=(hd0,0)/grub/splash.xpm.gz

title=Gentoo Linux 2.6.15-r7

# Partition where the kernel image (or operating system) is located

root (hd0,0)

kernel /linux-2.6.15-gentoo-r7 root=/dev/md2

~

~

~

~

~

~

~

~

~

~

~

"grub.conf" [converted] 12L, 455C                             1,1           All

----------

## drescherjm

Thanks, that answered a lot of questions.

We need to add a new entry to the end of this file.

title=Gentoo Linux 2.6.15-r7-new

root (hd0,0)

kernel /kernel-genkernel-x86_64-2.6.15-gentoo-r7 root=/dev/md2 

And then set default = 1

Also please verify that 

/boot/kernel-genkernel-x86_64-2.6.15-gentoo-r7 

exists. I believe that should be the new filename.

If so you can try rebooting. If it fails you should have the first config in the menu to fall back on. 

I have to go soon so if this fails someone else will have to help or we can pick it up tomorrow.

----------

## dloenzen

I need to get home so I will do this tomorrow.  Thanks for your help and I will talk to you then.

Thanks again.

David

----------

## dloenzen

We need to add a new entry to the end of this file.

title=Gentoo Linux 2.6.15-r7-new  <--  do I add this or change it?

root (hd0,0)  <--  do I add this or change it?

kernel /kernel-genkernel-x86_64-2.6.15-gentoo-r7 root=/dev/md2  <--  do I add this or change it?

And then set default = 1  < Is this exactly what this line says or do I just add default = 1

Also please verify that

/boot/kernel-genkernel-x86_64-2.6.15-gentoo-r7 

exists. I believe that should be the new filename.

If so you can try rebooting. If it fails you should have the first config in the menu to fall back on.  <--  How do I revert to the old?

----------

## drescherjm

I would add it so that you have a fall back if the new kernel does not work. I always have at least 2 kernels in my grub.conf file for this purpose.

 *Quote:*   

> And then set default = 1 < Is this exactly what this line says or do I just add default = 1 

 

change the line that reads 

```
default = 0
```

to 

```
default = 1
```

Also you may want to increase the timeout from 5 to 20 or so as 5 seconds may be difficult to hit if you need to switch to the old kernel.

----------

## dloenzen

What is the proper way for me to reboot this thing.  

Thanks John.

David

----------

## drescherjm

One other thing I was thinking of since we made tulip a module. You may need to force tulip to load at boot. To do that 

```
echo "tulip" >> /etc/modules.autoload.d/kernel-2.6
```

 *Quote:*   

> What is the proper way for me to reboot this thing. 

 

type reboot in the shell.

----------

## dloenzen

John,

I made the changes and rebooted.  I then did an ifconfig and did not see the new card.  I then did a modprobe tulip and  received "Module Tulip not found."  Sorry to be taken so much of your time, but I really appreciate your help.

----------

## drescherjm

I am very sorry. It looks like for some reason the commands 

```
zcat /proc/config.gz > /usr/src/linux/.config

echo "CONFIG_NET_TULIP=y" >> /usr/src/linux/.config

echo "CONFIG_TULIP=m" >>  /usr/src/linux/.config

cp /usr/src/linux/.config /usr/share/genkernel/x86_64/kernel-config-2.6 
```

did not work. 

can you do a 

```
zgrep TULIP /proc/config.gz
```

If that does not show 

```
CONFIG_NET_TULIP=y

CONFIG_TULIP=m

```

Then do you have a /etc/kernels/kernel-config-x86_64-2.6.15-r7 file?

----------

## dloenzen

I got CONFIG_NET_TULIP is not set. I have /etc/kernels/kernel-config-x86_64-2.6.15-gentoo-r7

----------

## drescherjm

 *Quote:*   

> I have /etc/kernels/kernel-config-x86_64-2.6.15-gentoo-r7

 

I believe that was your problem. I did these commands to make it easier to find the tulip driver as that can be a pain through the menu but this looks like this is a pain also sorry... The reason why the first command did not work is the priority that genkernel grabs previous .config files. 

Can you execute this:

```
zcat /proc/config.gz > /usr/src/linux/.config

echo "CONFIG_NET_TULIP=y" >> /usr/src/linux/.config

echo "CONFIG_TULIP=m" >>  /usr/src/linux/.config

cp /usr/src/linux/.config /usr/share/genkernel/x86_64/kernel-config-2.6

cp /usr/src/linux/.config /etc/kernels/kernel-config-x86_64-2.6.15-gentoo-r7
```

Then execute

```
genkernel --mountboot  --oldconfig  all
```

This should do a minimal rebuild of your kernel.

After this do a 

```

grep TULIP /usr/src/linux/.config
```

It should be 

```
CONFIG_NET_TULIP=y

CONFIG_TULIP=m
```

followed by a few lines. 

If that is so. It worked. You can reboot.

----------

## dloenzen

John, I'm sorry to keep bugging you, but I did what you said and I'm still getting:

# CONFIG_NET_TULIP is not set

----------

## drescherjm

 *Quote:*   

> John, I'm sorry to keep bugging

 

No that is my fault as I gave you the instructions I would have done at the terminal but in this case it is very difficult to figure out what has gone wrong...

 *dloenzen wrote:*   

> # CONFIG_NET_TULIP is not set

 

That was on this command 

```
grep TULIP /usr/src/linux/.config
```

If so I have no idea why it keeps doing that so you will have do it manually:

```
genkernel --mountboot --oldconfig --menuconfig all
```

Then when the menu comes up select 

 Device Drivers

Then Select

 Network device support

Then Select 

 Tulip family network device support 

Then press the space bar so there so the first line looks like this

 [*] Tulip" family network device support

Then use the space bar to make all the drivers in the list have [M]

Then keep exiting till it asks you if you want to save where you say yes.

After that it should compile and install so can reboot when this is finished.

----------

## dloenzen

Okay John, when I type this:  grep TULIP /usr/src/linux/.config

I get all the right tulip answers.  However, when I do an ifconfig, I don't see the additional card.  when I did the modprobe tulip, I got nothing.

----------

## drescherjm

Did you reboot?

----------

## dloenzen

Yes

----------

## drescherjm

From that I believe the driver is loaded.

```
lsmod | grep tulip
```

should return results.

I assume you have eth0 and are adding eth1 

did you 

```
ifconfig eth1
```

If that shows an interface  we are almost there... 

```
cd /etc/init.d

ln -s lo net.eth1
```

Then edit /etc/conf.d/net to add an ipaddress for eth1 unless it is dhcp where you can forget this step.

Then do the following:

```
/etc/init.d/net.eth1 start
```

----------

## dloenzen

the last step of code:  /etc/init.d/net.eth1 start

Returns an error of:

bash: /etc/init.d/net.eth1: No such file or directory. 

I've check, its there, but, it doesn't have near the code in it as does net.eth0

----------

## drescherjm

Sorry my mistake again. This time a typing error...

```

cd /etc/init.d

rm net.eth1

ln -s net.lo net.eth1
```

And proceed with the start command that failed above.

----------

## drescherjm

 *Quote:*   

> I've check, its there, but, it doesn't have near the code in it as does net.eth0

 

After these new commands net.eth0 and net.eth1 should be identical and both should point to net.lo

----------

## dloenzen

John,

Thank you so very much for your help.  It is guys like you that make linux viable.

Thanks again,

David

----------

## drescherjm

Your welcome. I hope you learned some gentoo in the process...

BTW, If you want the eth1 to start every time the machine is booted you do so with the following command:

```
rc-update add net.eth1 default
```

----------

## dloenzen

Thanks for letting me know that!  I sure would have been scratching my head the first time I rebooted.  I did learn some good stuff and I will make it a point to research each command.

----------

