Skip to contentSkip to conversation

Udev naming conventions.

DISCUSSION Scott Farwell 2 participants 2 messages Jun 12, 2007

lore
Share & tools
lore
#0 lore raw

I want to control what Ethernet interfaces are named eth0, eth1, eth2, eth3, etc....based on MAC address but I don't want them named anything other than eth0 - ethx so that it remains backwards compatible with software written to check eth0.

So I'm not wanting to rename anything, I just want to bind each ethx device name to a specific hardware port based on MAC address. That way if I physically lost eth1 for some reason (burned up chip) I wouldn't end up with my 3rd Ethernet port(eth2) renamed to eth1 on the next bootup.

I was told that udev is the way to enable device persistence, but it appears that it requires me to rename my interfaces something other than eth0 - ethx.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#1 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Quoted 6 lines · Scott Farwell

So I'm not wanting to rename anything, I just want to bind each ethx device name to a specific hardware port based on MAC address.

I was told that udev is the way to enable device persistence, but it appears that it requires me to rename my interfaces something other than eth0 - ethx.

Not anymore. :-) It used to require non-ethX names, because trying to rename eth2 to eth1 while trying to rename eth1 to eth2 would fail (because both target devices existed). But a delay loop and temporary target names were added to udevd when renaming NICs, so that renames like that should eventually complete. (Assuming a rule exists for both NICs, of course.)

You need udev-095 or later (earlier versions didn't have the rename loop code), but that shouldn't be too bad.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGbx6iS5vET1Wea5wRA0QeAJ9/B+xy8dJNGqdYddv6eCD5m6GCGwCg4944 pB1cucJ3OTHPit+V+6HyfKk=nvP2
-----END PGP SIGNATURE-----

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel