Home arrow Help Docs arrow Configuring more than one NIC/Lan card on a system
Main Menu
Home
Help Docs
Newbies
Corporates
Gnu/Linux Distros
Programming
Databases
Links
Search
Regular
News
Interviews
Aaj Ka Tip
Aaj Ka Command
Community
Blogs
Wiki
Forums
Services
Free Software

Configuring more than one NIC/Lan card on a system Print E-mail

Configuring more than one NIC/LAN card on a system

Note:

1.The following procedure has been tested and implemented on Slackware 10.0. It would not be tough to do the same on other distributions, albeit you should know the files or service of that particular distribution.

Procedure of configuring only one lan card on a system is generally a piece of cake. Generally, because most of the time your system itself detects it and you just have to assign an IP address to it using "netconfig"/"ifconfig" command. Carry on if you are even not being able to detect any of the card.

Configuring the second lan card may also be an easy task if your machine loads its module itself without bothering you about it..

First of all check whether your system is detecting the lan card of not. How would you check it ??? Watching that the lights of lan card are on or not ??? NO.

root@bond:~# lspci

NAME

lspci - list all PCI devices

DESCRIPTION

lspci is a utility for displaying information about all

PCI buses in the system and all devices connected to them.

root@bond:~# lspci

01:0b.0 Ethernet controller: MYSON Technology Inc SURECOM EP-320X-S 100/10M Ethernet PCI Adapter

01:0d.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)

It should have such type of entries which shows that machine is at least detecting both the lan cards.

If it doesn't, then try plugging the lan card properly in the slot again. Otherwise change the slot. If it still doesn't.....then chances are there that your NIC is not working properly.

( i've seen cases where the same LAN card works fine on windows but not on Linux )

In this it will have entries like:

Ethernet controller; Unknown device 1904:2031(rev 01)

So now i'm supposing that you LAN cards are getting detected.

Now two cases here:

1. Modules for your LAN card may already be present there in your kernel.

2. They may not be there and you have to insert them manually.

So lets check out luck first. Assign the IP address to both of them.

If you have only one LAN card, then you can assign IP address to it using #netconfig.

For assigning IP address to more than one lan card ........do the following

root@bond:~# cat /etc/rc.d/rc.inet1.conf

Will have entries like this::::::

# Config information for eth0:

IPADDR[0]="192.168.1.2"

NETMASK[0]="255.255.255.0"

USE_DHCP[0]=""

DHCP_HOSTNAME[0]=""

# Config information for eth1:

IPADDR[1]="192.168.0.1"

NETMASK[1]="255.255.255.0"

USE_DHCP[1]=""

DHCP_HOSTNAME[1]=""

# Config information for eth2:

IPADDR[2]=""

NETMASK[2]=""

USE_DHCP[2]=""

DHCP_HOSTNAME[2]=""

# Config information for eth3:

IPADDR[3]=""

NETMASK[3]=""

USE_DHCP[3]=""

DHCP_HOSTNAME[3]=""

Now run the following command in order to check whether IP has been assigned to your LAN card/cards.

#ifconfig

root@bond:~# ifconfig

eth0 Link encap:Ethernet HWaddr 00:E0:4C:77:13:4F

inet addr:192.168.1.2 Bcast:192.168.1.255 Mask:255.255.255.0

UP BROADCAST MULTICAST MTU:1500 Metric:1

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

TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

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

Interrupt:12 Base address:0xbb00

eth1 Link encap:Ethernet HWaddr 00:A1:B0:10:19:2E

inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

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

TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

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

Interrupt:10 Base address:0xcc00

If you have been reached so far then you can quit reading this article. If it doesn't, then only this article will have some value for you.

The problems which you may face could be one of the following or may be somewhat very dangerous (lol)

1. Sometimes system detects both lan cards, other times only one of them.

2. The lan card which you have plugged first is only getting detected and not the second one, although you are making network configuration for the second one also.

3. While checking for the lan card through command "ifconfig ethx" its throwing the error "ethx: error fetching interface information: Device not found".

The one of the most common reason behind such problems would be that your system might not be loading the relevant modules for that particular lan card.

So here comes the solution for such problems

To know the modules for your lan card perform the following steps:

( This method may or may not work. Other one too is discussed later on )

1. Remove both the lan cards from your system.

2. Without plugging any lan card, boot your machine and then shut it down. This is in order to remove any network card configuration from your system.

3. Insert the first lan card.

4. running "netconfig", configure this lan card. During this procedure it will ask you to detect your lan card. Let it do that. Then it will tell you the "module" that your lan card is using. Note it down.

5. shutdown the machine. Remove the first lan card.

6. Plug in the second lan card and repeat the 4th step.

Or

Check the company of you LAN card. Search for its module/driver on www.google.com. Now make sure its in /lib/modules/2.4.26/kernel/drivers/net/

This is the module you have to insert into kernel.

Now you know both the modules which your lan cards are using. So its half done.

Insert the missing module:

#/sbin/modprobe module name ( without the ".o" extension )

or

#insmod (full path of the module)

run #lsmod. You will notice the entry of the module which you just inserted.

This way you have to know the modules for the LAN cards.

Now you will have to restart the network services.

On Red Hat its #service network restart

On slackware10.0 #/etc/rc.d/rc.inet1 stop

#/etc/rc.d/rc.inet1 start

On slackware 10.2 #/etc/rc.d/rc.inet1 restart

run

#ifconfig

Now it should show the entries for both the cards I.e somewat like

root@bond:~# ifconfig

eth0 Link encap:Ethernet HWaddr 00:E0:4C:77:13:4F

inet addr:192.168.1.2 Bcast:192.168.1.255 Mask:255.255.255.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

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

TX packets:533253 errors:0 dropped:0 overruns:0 carrier:0

collisions:0

RX bytes:533214033 (508.5 Mb) TX bytes:49349527 (47.0 Mb)

eth1 Link encap:Ethernet HWaddr 00:A1:B0:10:19:2E

inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

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

TX packets:427686 errors:1 dropped:0 overruns:0 carrier:0

collisions:0

RX bytes:33219705 (31.6 Mb) TX bytes:272298590 (259.6 Mb)

voilla !!! you have done it.

Reboot..........

now again run

#ifconfig

Jejus !!! i'm again there from where i started....why ???

B'coz whatever we did were temporary entries. Its time to make them permanent.

You need to edit the /etc/modules.conf file

# vi /etc/modules.conf ( its for 2.4.x and "/etc/modprobe.conf" is for 2.6.x kernels )

and added the following lines to it......

alias eth0 8139too

alias eth1 fealnx

where "8139too" and "fealnx" are respective modules for my lan cards.

s

Just make entries for you lan card........that's it !!!

Bond ( )

< Previous   Next >



gnulinuxclub
Join Us
About Us
Contact Us
Support Us
Acknowlegdement
Login(only for dev.)

Royalty Free Images

O'Reilly User Group discount!




Powered By GIMP GIMP
Contact Webmaster Copyleft 2011 gnulinuxclub.org