Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Linux - Kernel This forum is for all discussion relating to the Linux kernel.


  Search this Thread
Old 08-11-2009, 11:57 AM   #1
LQ Newbie
Registered: Mar 2009
Location: San Francisco, CA
Posts: 26

Rep: Reputation: 15
Naming interfaces within NIC driver


I have been trying to create my own names for interfaces. I set the name just before registering a newly created netdevice object in the driver's probe routine. However, using a series of printk's I can see that another thread changes the names to the "standard" strings, e.g. eth0, eth1, eth2, etc.

I have found some userspace commands that are useful and should allow me to rename the interfaces, but I am still curious as to what is changing these names on me.

Code snippet from probe():

sprintf(netdev->name, "eth%d", eth_count);
err = register_netdev(netdev);
printk("NETDEV NAME: %s\n", netdev->name);
printk("NETDEV NAME: %s\n", netdev->name);

Where eth_count is a global that I initialize to 4 and increment. The first printk displays the name I set. The second one displays the "standardized" name!

Old 08-12-2009, 01:29 AM   #2
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
Why don't you define an alias in the modprobe config file for the device?
/etc/modprobe.d/module-renames:alias    e1000-new       e1000


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple Interfaces + Cisco 515 and default NIC streamalot Linux - Networking 0 06-12-2006 01:43 PM
Is there a way to have grub translate its own naming to naming scheme under Linux zhjim Linux - Software 6 05-28-2006 08:09 AM
Naming device driver Crunch *BSD 2 02-12-2005 10:46 AM
1 nic, 2 interfaces show up.. grcore Linux - Hardware 8 01-08-2005 01:46 PM
mail server the naming naming convention problem kashan Linux - Newbie 0 07-16-2004 02:08 PM > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 06:05 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration