Mailing List Archive

Two network cards - any special configuration required?
Today I find out that I need to install Gentoo on computer with two
network cards. I have never installed any OS on computer with two
network cards so I don't know is there any special configuration that I
need to worry about. Thing that confuses me is how computer will decide
which an when to use eth0 or eth1...

TNX

--
gentoo-user@gentoo.org mailing list
Re: Two network cards - any special configuration required? [ In reply to ]
On Wed, October 13, 2004 10:25, Khan said:
> Today I find out that I need to install Gentoo on computer with two
> network cards. I have never installed any OS on computer with two
> network cards so I don't know is there any special configuration that I
> need to worry about. Thing that confuses me is how computer will decide
> which an when to use eth0 or eth1...

I have one system with 3 networkcards and it works perfectly. I cannot
point you to some usefull documentation, but you since must edit
/etc/conf.d/net and there are a lot of comments in there, you will have a
good guide to setup such a configuration. In there you will also find a
way to 'name' your cards based on their MAC address (in case a new kernel
will init them in a different order)


Rudmer




--
gentoo-user@gentoo.org mailing list
Re: Two network cards - any special configuration required? [ In reply to ]
It's really not that big a deal. Some hints:

Configuration is done in /etc/conf.d/net. It's rather self-explaining.

You propably have to check if /etc/init.d/net.eth1 is present. If not
just symlink net.eth0 accordingly:

cd /etc/init.d
ln -s net.eth0 net.eth1

If you want to start both eth0 and eth1 at init verify that they're in
rc-update:

rc-update -s
rc-update add net.eth0 default
rc-update add net.eth1 default

If you use two identical NICs you may compile the drivers into the
kernel. Sad thing is though that there's no way to assign a logical
device ethx to a specific physical NIC.

If you have two different NICs compile them as modules. The you will be
able to assign ethx to a specific NIC as follows:

create two text files

/etc/modules.d/nic1 and
/etc/modules.d/nic2

where nic1 and nic2 have to carry the same name as the NIC module e.g.

/etc/modules.d/3c59x or
/etc/modules.d/8139too

Put the following line into these files:

/etc/modules.d/nic1:
alias eth0 nic1

/etc/modules.d/nic2:
alias eth1 nic2

and perform an update-modules.

When you use that method you should not load the NIC modules through
/etc/modules.autoload.d. Instead /etc/init.d/net.ethx will automagically
pull the correct modules according to /etc/modules.d


Have fun.

Khan schrieb:
> Today I find out that I need to install Gentoo on computer with two
> network cards. I have never installed any OS on computer with two
> network cards so I don't know is there any special configuration that I
> need to worry about. Thing that confuses me is how computer will decide
> which an when to use eth0 or eth1...
>
> TNX
>
> --
> gentoo-user@gentoo.org mailing list
>
>
>

--
Mit freundlichen Grüßen

Heinz Sporn

SPORN it-freelancing

Mobile: ++43 (0)699 / 127 827 07
Email: heinz.sporn@sporn-it.com
heinz.sporn@utanet.at
Snail: Steyrer Str. 20
A-4540 Bad Hall
Austria / Europe

--
gentoo-user@gentoo.org mailing list
Re: Two network cards - any special configuration required? [ In reply to ]
On Wed, 13 Oct 2004 10:28:14 +0200 (CEST) "Rudmer van Dijk"
<rudmer@legolas.dynup.net> wrote:
| On Wed, October 13, 2004 10:25, Khan said:
| I have one system with 3 networkcards and it works perfectly. I cannot
| point you to some usefull documentation, but you since must edit
| /etc/conf.d/net and there are a lot of comments in there, you will
| have a good guide to setup such a configuration. In there you will
| also find a way to 'name' your cards based on their MAC address (in
| case a new kernel will init them in a different order)

Naming by MAC only works if you're on a broken box which violates the
Ethernet spec. MACs are per-machine, not per-NIC. If you're after
persistent names, there's some clever way to do it using udev -- best to
check the docs rather than me trying to remember it though :)

--
Ciaran McCreesh : Gentoo Developer (Vim, Fluxbox, Sparc, Mips)
Mail : ciaranm at gentoo.org
Web : http://dev.gentoo.org/~ciaranm
Re: Two network cards - any special configuration required? [ In reply to ]
On Wed, 13 Oct 2004 10:56:42 +0200, Heinz Sporn
<heinz.sporn@sporn-it.com> wrote:
> You propably have to check if /etc/init.d/net.eth1 is present. If not
> just symlink net.eth0 accordingly:
>
> cd /etc/init.d
> ln -s net.eth0 net.eth1
>
Don't forget that if you want one nic to use DHCP and the other to
have a fixed ip that you need two different configuration files and
that symlinking won't work!

--
"May the source be with you"

--
gentoo-user@gentoo.org mailing list
Re: Two network cards - any special configuration required? [ In reply to ]
On Wed, 13 Oct 2004 10:05:07 +0100, Ciaran McCreesh <ciaranm@gentoo.org> wrote:
> On Wed, 13 Oct 2004 10:28:14 +0200 (CEST) "Rudmer van Dijk"
> <rudmer@legolas.dynup.net> wrote:
> | On Wed, October 13, 2004 10:25, Khan said:
> | I have one system with 3 networkcards and it works perfectly. I cannot
> | point you to some usefull documentation, but you since must edit
> | /etc/conf.d/net and there are a lot of comments in there, you will
> | have a good guide to setup such a configuration. In there you will
> | also find a way to 'name' your cards based on their MAC address (in
> | case a new kernel will init them in a different order)
>
> Naming by MAC only works if you're on a broken box which violates the
> Ethernet spec. MACs are per-machine, not per-NIC. If you're after
> persistent names, there's some clever way to do it using udev -- best to
> check the docs rather than me trying to remember it though :)
>
MAC are per NIC settings, per machine would be problematic if you'd
connect with 2 NICs on the same network. It will be rather interesting
to see what ARP would do and which networknode would crash first!

--
"May the source be with you"

--
gentoo-user@gentoo.org mailing list
Re: Two network cards - any special configuration required? [ In reply to ]
quoth the Bart Braem:
> Don't forget that if you want one nic to use DHCP and the other to
> have a fixed ip that you need two different configuration files and
> that symlinking won't work!

Not true. This is exactly what I do. In /etc/conf.d/net:

iface_eth0="dhcp"
iface_eth1="192.168.0.1 broadcast 192.168.0.255 netmask 255.255.255.0"

Then make the symlink and it will work fine. To have the ethernet cards probed
in the same order at boot persistently then add:

ether=0,0,eth1

to your kernel command line in grub.conf (or lilo.conf). You may have to
switch cables the first time if it doesn't work, but after that they will be
probed correctly. That is to say, setup the nics as above...and if networking
doesn't work, physically swap the cables in the two nics and they will work.

-d
--
Part of the problem since 1976
http://badcomputer.no-ip.com
Get my public key from
http://keyserver.linux.it/pks/lookup?op=index&search=bulliver
"...the number of UNIX installations has grown to 10, with more expected..."
- Dennis Ritchie and Ken Thompson, June 1972
Re: Two network cards - any special configuration required? [ In reply to ]
On Wed, 13 Oct 2004 03:56:15 -0700, Darren Kirby
<bulliver@badcomputer.no-ip.com> wrote:
> quoth the Bart Braem:
> > Don't forget that if you want one nic to use DHCP and the other to
> > have a fixed ip that you need two different configuration files and
> > that symlinking won't work!
>
> Not true. This is exactly what I do. In /etc/conf.d/net:
>
> iface_eth0="dhcp"
> iface_eth1="192.168.0.1 broadcast 192.168.0.255 netmask 255.255.255.0"
>
> Then make the symlink and it will work fine.

You're absolutely right, I forgot that the eth scripts configuration
happens elsewhere.

--
"May the source be with you"

--
gentoo-user@gentoo.org mailing list
Re: Two network cards - any special configuration required? [ In reply to ]
On Wed, 13 Oct 2004 11:37:50 +0200 Bart Braem <bart.braem@gmail.com>
wrote:
| > Naming by MAC only works if you're on a broken box which violates
| > the Ethernet spec. MACs are per-machine, not per-NIC. If you're
| > after persistent names, there's some clever way to do it using udev
| > -- best to check the docs rather than me trying to remember it
| > though :)
| >
| MAC are per NIC settings, per machine would be problematic if you'd
| connect with 2 NICs on the same network. It will be rather interesting
| to see what ARP would do and which networknode would crash first!

Bzzzzt, ping, you lose! The Ethernet spec puts MAC addresses on a
per-machine basis, and does not consider having multiple NICs on the
same subnet. The only reason your NICs have their own MAC addresses is
because the PC BIOS didn't include its own MAC (unlike anything OFW or
OBP based).

--
Ciaran McCreesh : Gentoo Developer (Vim, Fluxbox, Sparc, Mips)
Mail : ciaranm at gentoo.org
Web : http://dev.gentoo.org/~ciaranm
Re: Two network cards - any special configuration required? [ In reply to ]
On Wed, 13 Oct 2004 16:49:33 +0100, Ciaran McCreesh <ciaranm@gentoo.org> wrote:
> On Wed, 13 Oct 2004 11:37:50 +0200 Bart Braem <bart.braem@gmail.com>
> wrote:
> | > Naming by MAC only works if you're on a broken box which violates
> | > the Ethernet spec. MACs are per-machine, not per-NIC. If you're
> | > after persistent names, there's some clever way to do it using udev
> | > -- best to check the docs rather than me trying to remember it
> | > though :)
> | >
> | MAC are per NIC settings, per machine would be problematic if you'd
> | connect with 2 NICs on the same network. It will be rather interesting
> | to see what ARP would do and which networknode would crash first!
>
> Bzzzzt, ping, you lose! The Ethernet spec puts MAC addresses on a
> per-machine basis, and does not consider having multiple NICs on the
> same subnet. The only reason your NICs have their own MAC addresses is
> because the PC BIOS didn't include its own MAC (unlike anything OFW or
> OBP based).
>
>
>
That's something new and I find it a bit hard to believe. On the other
hand: always glad to learn: do you have any links to sites explaining
this? I can't find anything at Cisco or IEEE.

Bart
--
"May the source be with you"

--
gentoo-user@gentoo.org mailing list
Re: Two network cards - any special configuration required? [ In reply to ]
Ciaran McCreesh wrote:
> On Wed, 13 Oct 2004 11:37:50 +0200 Bart Braem <bart.braem@gmail.com>
> wrote:
> | > Naming by MAC only works if you're on a broken box which violates
> | > the Ethernet spec. MACs are per-machine, not per-NIC. If you're
> | > after persistent names, there's some clever way to do it using udev
> | > -- best to check the docs rather than me trying to remember it
> | > though :)
> | >
> | MAC are per NIC settings, per machine would be problematic if you'd
> | connect with 2 NICs on the same network. It will be rather interesting
> | to see what ARP would do and which networknode would crash first!
>
> Bzzzzt, ping, you lose! The Ethernet spec puts MAC addresses on a
> per-machine basis, and does not consider having multiple NICs on the
> same subnet. The only reason your NICs have their own MAC addresses is
> because the PC BIOS didn't include its own MAC (unlike anything OFW or
> OBP based).
>

Not true. From the IEEE 802-2001 spec (section 9.2.3):

"The recommended approach is for each device associated with a distinct
point of attachment to a LAN to have its own unique MAC address.
Typically, therefore, a LAN adapter card (or, e.g., an equivalent chip
or set of chips on a motherboard) should have one unique MAC address for
each LAN attachment that it can support at a given time.

NOTE—It is recognized that an alternative approach has gained currency
in some LAN implementations, in which the device is interpreted as a
complete computer system, which can have multiple attachments to
different LANs. Under this interpretation, a single LAN MAC address is
used to identify all of the system’s points of attachment to the LANs in
question. This approach, unlike the recommended one, does not
automatically meet the requirements of IEEE Std 802.1D-1998 MAC bridging."

You can get the whole spec at http://standards.ieee.org/getieee802/802.html


--
Manuel A. McLure KE6TAW <manuel@mclure.org> <http://www.mclure.org>
...for in Ulthar, according to an ancient and significant law,
no man may kill a cat. -- H.P. Lovecraft

--
gentoo-user@gentoo.org mailing list