From: Balwinder S Dheeman on
On 05/11/2010 07:16 AM, Dave U. Random wrote:
> "R" =3D=3D Rahul <nos...(a)invalid.invalid>:
> R> I have 2 different eth cards in a bunch of machines: a 1Gig and a 10Gi=
> g.=20
> R> Each is a different vendor. How can I always make the 1 Gig come up as=
> eth0=20
> R> and the 10Gig as a eth2?=20
> R>=20
> R> KERNEL=3D"eth*" ATTR{address}=3D=3D"00:07:*" NAME=3D"eth2"
>
> $ grep eth0 /etc/udev/rules.d/z25_persistent-net.rules
>
> SUBSYSTEM=3D=3D"net", DRIVERS=3D=3D"?*", ATTRS{address}=3D=3D"00:12:34:56=
> :78:90", NAME=3D"eth0"

1) Best swap the cards, if these are not on-borad or integrated on
mother board; tested, will definitely work.

2) On Debian machines, prioritize your network interfaces by editing
/etc/network/intercafes file; tested, long back.

3) Hand edit /etc/udev/rules.d/70-persistent-net.rules files; untested

--
Balwinder S "bdheeman" Dheeman Registered Linux User: #229709
Anu'z Linux(a)HOME (Unix Shoppe) Machines: #168573, 170593, 259192
Chandigarh, UT, 160062, India Plan9, T2, Arch/Debian/FreeBSD/XP
Home: http://werc.homelinux.net/ Visit: http://counter.li.org/
From: Robert Riches on
On 2010-05-10, Rahul <nospam(a)invalid.invalid> wrote:
> I have 2 different eth cards in a bunch of machines: a 1Gig and a 10Gig.
> Each is a different vendor. How can I always make the 1 Gig come up as eth0
> and the 10Gig as a eth2?
>
> The MACs are of course all different, but the first 4 places of each vendor
> are unique. i.e. Vendor1's cards (the 1GigE's) start with 00:26 and the
> Vendor2's (10 Gig) with 00:07.
>
> Normally I net install the machines automatially using PXE+Kickstart. I am
> using CentOS 5.4.
>
> Is udev the correct solution? I tried adding to /etc/udev/rules.d a file
> havin the line:
>
> KERNEL="eth*" ATTR{address}=="00:07:*" NAME="eth2"
>
> but it didn't seem to work. Are there any other solutions? Or maybe I am
> doing something wrong?

In addition to the the other suggestions, there's one other that
_might_ work. I have used it with sound cards, but I don't know
whether it will work for NICs. To force a particular sound card
to be seen first, put something like this in /etc/modprobe.conf:

options snd slots=snd-intel8x0

There might be a way to adapt that for NICs.

--
Robert Riches
spamtrap42(a)verizon.net
(Yes, that is one of my email addresses.)
From: Rahul on
Balwinder S Dheeman <bsd.SANSPAM(a)anu.homelinux.net> wrote in
news:kh1nb7xij6.ln2(a)news.homelinux.net:

> 1) Best swap the cards, if these are not on-borad or integrated on
> mother board; tested, will definitely work.
>

Can't do that unfortunately. My 1 Gig cards are on the Motherboard
integrated. My 10 Gig Card is an addon PCI.

Also, is the order gurranteed? i.e. let's say I had (for arguments sake)
the correct order in machine1 by swapping the cards. Will the same order
persist in machine2 as well? Assuming the machines are identical? What
decides the order in which the system probes cards or is it foolish to
depend on this order. Further, let's assume I get a certain order on a
machine, then, without explicit udev rules, is this order gurranteed on
future reboots?

--
Rahul
From: Rahul on
marrgol <marspamrgol(a)gspammail.com> wrote in news:4be8c492$0$19177$65785112
@news.neostrada.pl:

> IIRC in CentOS it should be:
>
> KERNEL="eth*" SYSFS{address}=="00:07:*" NAME="eth2"
>

I tried this. There seems to be one other confounding factor. I find files
of this sort:

cat /etc/sysconfig/network-scripts/ifcfg-eth0
# Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet
DEVICE=eth0
HWADDR=00:26:B9:58:EB:0A
ONBOOT=yes

This seems to be overriding what I put in udev. Any idea what produces this
file with an hardcoded HWADDR?

--
Rahul
From: Rahul on
Robert Heller <heller(a)deepsoft.com> wrote in news:XOCdnS7ZDKR-
NHXWnZ2dnUVZ_v6dnZ2d(a)posted.localnet:

> I suspect that udev's wildcarding might not work with MAC addresses. It
>

Could be. Hard to say. The udev manpage did say:

"Most of the fields support a shell style pattern matching."

"Most" is open to interpretation, of course. :)

--
Rahul