From: Robert Heller on
At Tue, 11 May 2010 00:13:49 +0000 (UTC) Rahul <nospam(a)invalid.invalid> wrote:

>
> Robert Heller <heller(a)deepsoft.com> wrote in
> news:E4WdnafSeNbDA3XWnZ2dnUVZ_sidnZ2d(a)posted.localnet:
>
> > With CentOS (or any *RedHat* flavored distro, include RHEL itself or
> > Fedora Core), you 'bind' the device name (ethX) with the MAC address in
> > the ifcfg-ethX file in /etc/sysconfig/network-scripts/:
> >
>
> The other problem with this approach is that I don't think it takes
> wildcards. I won't know beforehand what exact MAC address needs to be eth0.
> But I do know that it is vendor broadcom that needs to be the eth0 (1
> GigE) and also that all their addresses are 00:26:*.
>
> Luckily, at least in theory, udev has a facility of wildcarding MACs.
> Unfortunately it doesn't seem to work as I thought it would. Yet. There is
> also a way to use vendor names as per the udev documentation.
> Unfortunatley, if I run udevinfo on the network cards this feild seems to
> come out empty.

I suspect that udev's wildcarding might not work with MAC addresses. It
is *also* quite possible that CentOS/RHEL's udev / ifconfig logic does
not really support this. *I* suspect that it is going to be necessary
to bind eth's by explit MAC addresses. The KS system does in fact allow
for this, but you will need to include parameters on a per machine basis.

>

--
Robert Heller -- Get the Deepwoods Software FireFox Toolbar!
Deepwoods Software -- Linux Installation and Administration
http://www.deepsoft.com/ -- Web Hosting, with CGI and Database
heller(a)deepsoft.com -- Contract Programming: C/C++, Tcl/Tk


From: Robert Heller on
At Tue, 11 May 2010 00:07:37 GMT unruh <unruh(a)wormhole.physics.ubc.ca> wrote:

>
> On 2010-05-11, Robert Heller <heller(a)deepsoft.com> wrote:
> > At Mon, 10 May 2010 22:17:34 +0000 (UTC) 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?
> >
> > With CentOS (or any *RedHat* flavored distro, include RHEL itself or
> > Fedora Core), you 'bind' the device name (ethX) with the MAC address in
> > the ifcfg-ethX file in /etc/sysconfig/network-scripts/:
> >
> > On my IBM Thinkpad X31 laptop (running CentOS 5.4):
> >
> > /etc/sysconfig/network-scripts/ifcfg-eth0:
> > # Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile)
> > DEVICE=eth0
> > BOOTPROTO=dhcp
> > HWADDR=00:0D:60:CC:82:03
> > IPV6INIT=yes
> > IPV6_AUTOCONF=yes
> > ONBOOT=yes
> > DHCP_HOSTNAME=gollum.deepsoft.com
> >
> > /etc/sysconfig/network-scripts/ifcfg-eth1:
> > # Intel Corporation PRO/Wireless LAN 2100 3B Mini PCI Adapter
> > DEVICE=eth1
> > BOOTPROTO=dhcp
> > ONBOOT=yes
> > HWADDR=00:04:23:72:b4:49
>
> Unfortunately I do not think that works. By the time the network scripts
> are run, the system has already assigned the network card names. I think
> that it has to be done in the udev rules. (Note that your naming
> convetion is wha tthe system would naturally assign, and thus you might
> not have realised that it was not working. Ie, try switching the two
> files so you assing eth0 to your wlan.)

Actually, it does indeed work. NIC *don't* get named devices in /dev/
(eg there is not in fact a /dev/eth0 or /dev/eth1). The above really
does work, at least on *every* RedHat flavored system *I* have ever
used. Ubuntu / Debian is something else again (I had to deal with a
Ubuntu server that almost *always* came up with eth1 and eth2 swapped.
No matter *what* I did (it seemed). I think every time it got rebooted
after a power failure, I had to manually fix the network -- a totally
pain in the butt. Once I installed CentOS on the box, the problems
totally vanished.


>
> >
> >
> >
> >>
> >
>

--
Robert Heller -- Get the Deepwoods Software FireFox Toolbar!
Deepwoods Software -- Linux Installation and Administration
http://www.deepsoft.com/ -- Web Hosting, with CGI and Database
heller(a)deepsoft.com -- Contract Programming: C/C++, Tcl/Tk


From: Dave U. Random on
"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"

From: Bit Twister on
On Mon, 10 May 2010 22:17:34 +0000 (UTC), Rahul 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?

Besides playing with a rules file, check /etc/mod* files for driver
and ethX.
Example from a Mandriva Linux install.
$ grep eth /etc/mod*
/etc/modprobe.conf_vorig:alias eth0 8139too
/etc/modprobe.conf_vorig:alias eth1 tulip
From: marrgol on
On 2010-05-11 00:17, Rahul wrote:
> 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?

IIRC in CentOS it should be:

KERNEL="eth*" SYSFS{address}=="00:07:*" NAME="eth2"

--
mrg