Need help activating two NIC in same computer using RH 7.3

Need help activating two NIC in same computer using RH 7.3

Post by Gabrie » Sat, 13 Jul 2002 14:25:27



Hi there,

I have 2 3COM network cards in the same computer.  I have managed to
activate them both using the 3x59x kernel module using the following
command:

        insmod 3c59x options=0,8

This makes both cards available as eth0 and eth1.  I can see them
using 'ifconfig -a'.

I have configured eth0 to be DHCP and eth1 to be static IP.  Only one
of them will be active at a time (meaning only one of them will have a
network cable connected).

Right now, I want to use eth1 (Static IP).  I set the bootable option
in /etc/sysconfig/network-scripts/ifcfg-eth0 to 'no' and when
'/etc/init.d/network start' is executed, I can see only loopback and
eth1 activated.  When I run 'ifconfig -a', I can see that eth1 has the
information about address, netmask, and gateway.  The eth0 info does
not show anything (as I would expect).

The problem is that I cannot get out or in.  No communication happens.
I checked 'netstat -rn' and I could see a default gateway set for
eth1, but nothing works.

If I activate eth0 (DHCP), then I am able to get out and in.  Why is
this happening?

Are there other configuration files that look for eth0?  I thought
that 'ifup eth1' should be enough to configure the network to see eth1
as THE communication port.

Do I need to execute other commands, e.g., route, to get eth1 to work?

Thanks,

Gabriel

 
 
 

Need help activating two NIC in same computer using RH 7.3

Post by Karl Heye » Sat, 13 Jul 2002 22:00:48



> Right now, I want to use eth1 (Static IP).  I set the bootable option
> in /etc/sysconfig/network-scripts/ifcfg-eth0 to 'no' and when
> '/etc/init.d/network start' is executed, I can see only loopback and
> eth1 activated.  When I run 'ifconfig -a', I can see that eth1 has the
> information about address, netmask, and gateway.  The eth0 info does
> not show anything (as I would expect).

using ifconfig itself should not show the eth0 interface correct?  It
should also show no errors for RX/TX

Quote:> The problem is that I cannot get out or in.  No communication happens.
> I checked 'netstat -rn' and I could see a default gateway set for
> eth1, but nothing works.

Can we see the routing table?  There should be at least three rules

route to 127/8 down lo
route to <eth1 IP>/<eth1 netmask> down eth1
default route to gateway on eth1

Make sure the firewall is down (iptables/ipchains -L -n -v) and then
ping something locally like the gateway.  If nothing shows then
run tcpdump -n -i eth1 and do another ping.  Lets see what appears in
tcpdump

karl

 
 
 

Need help activating two NIC in same computer using RH 7.3

Post by Gabrie » Mon, 15 Jul 2002 02:27:29


Quote:>using ifconfig itself should not show the eth0 interface correct?  It
>should also show no errors for RX/TX

You are right.  'ifconfig' does not show the inactive adapters.  I was
running 'ifconfig -a'.

Quote:>Can we see the routing table?  There should be at least three rules

>route to 127/8 down lo
>route to <eth1 IP>/<eth1 netmask> down eth1
>default route to gateway on eth1

I think I am back to the drawing board.  I deactivated everything,
just put 'alias eth0 3c59x' in the /etc/modules.conf file, removed the
configuration for eth1 and made the configuration for eth0 the static
IP address one.

The routing table looks like you suggest and everything works fine.
However, I can see eth1 listed in 'ifconfig -a'.  This confuses me.

I have to run more experiments to figure out who is who and what
happens when I undock the computer.  Will the adapter listed as eth1
become active as eth0?

Quote:>Make sure the firewall is down (iptables/ipchains -L -n -v) and then
>ping something locally like the gateway.  If nothing shows then
>run tcpdump -n -i eth1 and do another ping.  Lets see what appears in
>tcpdump

I do not have tcpdump.  Is that an optional command I need to install?

Bye,

Gabriel

 
 
 

Need help activating two NIC in same computer using RH 7.3

Post by Karl Heye » Mon, 15 Jul 2002 03:30:26



> I think I am back to the drawing board.  I deactivated everything,
> just put 'alias eth0 3c59x' in the /etc/modules.conf file, removed the
> configuration for eth1 and made the configuration for eth0 the static
> IP address one.

> The routing table looks like you suggest and everything works fine.
> However, I can see eth1 listed in 'ifconfig -a'.  This confuses me.

When eth0 is configured the driver is loaded but the driver will see
both NICs and allocate them to the ethN interfaces.  The MAC and ioport
values will show up with the ifconfig -a command, although if it is
just loaded then it won't have an IP.

Quote:> I have to run more experiments to figure out who is who and what
> happens when I undock the computer.  Will the adapter listed as eth1
> become active as eth0?

No,  The order may change if order on the bus changes, for instance if
it changed slots, but your not doing that. When you have the more than
one of the same card then the bus scanning order is important.

Quote:>>Make sure the firewall is down (iptables/ipchains -L -n -v) and then
>>ping something locally like the gateway.  If nothing shows then
>>run tcpdump -n -i eth1 and do another ping.  Lets see what appears in
>>tcpdump

> I do not have tcpdump.  Is that an optional command I need to install?

It can only be run as root so you might have but it may be an optional
install.

karl.

 
 
 

Need help activating two NIC in same computer using RH 7.3

Post by Gabrie » Tue, 16 Jul 2002 15:08:44


Quote:>When eth0 is configured the driver is loaded but the driver will see
>both NICs and allocate them to the ethN interfaces.  The MAC and ioport
>values will show up with the ifconfig -a command, although if it is
>just loaded then it won't have an IP.

>>  Will the adapter listed as eth1 become active as eth0?

>No,  The order may change if order on the bus changes, for instance if
>it changed slots, but your not doing that. When you have the more than
>one of the same card then the bus scanning order is important.

Then, that means that I should be able to use eth1 without ever
configuring eth0.  I will play more with my /etc/modules.conf file.  I
think that having this should work:

        alias eth0 3c59x
        alias eth1 3c59x

Then, I should be able to configure eth0 or eth1 or both.  Is there an
"easy" way to activate either eth0 or eth1 based on my kind of boot?
I already have a kernel environment variable that I set.  I was
thinking that I could check for it in /etc/init.d/network to decide
which eth interface to bring up.  Is this OK?

Quote:>>>Make sure the firewall is down (iptables/ipchains -L -n -v) and then
>>>ping something locally like the gateway.  If nothing shows then
>>>run tcpdump -n -i eth1 and do another ping.  Lets see what appears in
>>>tcpdump

>> I do not have tcpdump.  Is that an optional command I need to install?

>It can only be run as root so you might have but it may be an optional
>install.

I will check my distribution CD and see if it is there.

Thanks,

Gabriel

 
 
 

Need help activating two NIC in same computer using RH 7.3

Post by Karl Heye » Tue, 16 Jul 2002 21:33:15



>>No,  The order may change if order on the bus changes, for instance if
>>it changed slots, but your not doing that. When you have the more than
>>one of the same card then the bus scanning order is important.

> Then, that means that I should be able to use eth1 without ever
> configuring eth0.  I will play more with my /etc/modules.conf file.  I

The driver will have to see the card but it doesn't need to give it an
IP or run DHCP on it.

Quote:> think that having this should work:

>    alias eth0 3c59x
>    alias eth1 3c59x

yep!

Quote:> Then, I should be able to configure eth0 or eth1 or both.  Is there an
> "easy" way to activate either eth0 or eth1 based on my kind of boot?
> I already have a kernel environment variable that I set.  I was
> thinking that I could check for it in /etc/init.d/network to decide
> which eth interface to bring up.  Is this OK?

I believe the distributions allow for something like home/office
configurations so that may be what you want.  You have the general idea
though, ifup eth0 is what gets run so it's just a matter of determining
when to run ifup eth0 and when to run ifup eth1

karl.

 
 
 

Need help activating two NIC in same computer using RH 7.3

Post by Gabrie » Wed, 17 Jul 2002 13:29:22


OK, so I finally understand what the heck is going on.  When the
laptop is docked, the adapter in the docking station is recognized as
eth0 and the adapter in the laptop is recognized as eth1.  When the
laptop is undocked, then the adapter in the laptop is recognized as
eth0.

I think I can get this to work is I can force the laptop's adapter to
be always eth1.

Is there a way to force a NIC to be eth1 even if there is no other NIC
installed?

Thanks,

Gabriel

 
 
 

Need help activating two NIC in same computer using RH 7.3

Post by Karl Heye » Wed, 17 Jul 2002 20:01:53



> OK, so I finally understand what the heck is going on.  When the
> laptop is docked, the adapter in the docking station is recognized as
> eth0 and the adapter in the laptop is recognized as eth1.  When the
> laptop is undocked, then the adapter in the laptop is recognized as
> eth0.

> I think I can get this to work is I can force the laptop's adapter to
> be always eth1.

> Is there a way to force a NIC to be eth1 even if there is no other NIC
> installed?

Not normally as the card detection order determines the ethN
allocation, but saying that you can alter the names of the interfaces
afterwards with something like

ip link set eth0 name <be imaginative>

ip is part of the iproute package, a more advanced of configuring the
networking. Note that the interface has to be inactive if you change
the name.

karl.