udev and network devices
Posted 08-03-2009 at 06:57 AM by stureedy
After all these years, I finally figured out how to configure udev to load my network devices in the correct order.
In the past I compiled my own kernels and could force the card I wanted to be eth0 by compiling it into the kernel, then loading the card I wanted as eth1 as a module. This worked well. Of course, udev provides a "better" way, and now that it's five years old, I finally decided to learn it!
As with most things Linux, it was easy to do, once I figured out how. (It's the figuring out how that takes all the time! -)
For my home server running Slackware 12.2, the answer was to modify the file: /etc/udev/rules.d/70-persistent-net.rules to look like:
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:03:47:fc:33:ec", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:ba:42:ec:5d", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
This makes the on-board Intel NIC eth0 and my cheapy PCI D-Link card eth1.
Yes, I'm behind the times: I still have machines running kernel 2.4. But, I am learning!
Enjoy your day and enjoy Linux!
Stu...
In the past I compiled my own kernels and could force the card I wanted to be eth0 by compiling it into the kernel, then loading the card I wanted as eth1 as a module. This worked well. Of course, udev provides a "better" way, and now that it's five years old, I finally decided to learn it!
As with most things Linux, it was easy to do, once I figured out how. (It's the figuring out how that takes all the time! -)
For my home server running Slackware 12.2, the answer was to modify the file: /etc/udev/rules.d/70-persistent-net.rules to look like:
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:03:47:fc:33:ec", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:ba:42:ec:5d", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
This makes the on-board Intel NIC eth0 and my cheapy PCI D-Link card eth1.
Yes, I'm behind the times: I still have machines running kernel 2.4. But, I am learning!
Enjoy your day and enjoy Linux!
Stu...
Total Comments 0