Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have some Dell hosts in our environment. I would like to be able to provide consistent network interface naming across platforms. I know that biosdevname attempts to make the interfaces consistent with regard to their physical/hardware layout. But this is not the kind of consistency I'm looking for. I'm looking for consistent names to allow my 10gbps ports and 1gbps to have the same name across different hardware platforms.

What I would like is that no matter how I have my interfaces physically allocated on my host that:

  1. The First interface will be em1 and it will always be the first 1gbps interface
  2. The second interface will be em2 and it will always be the first 10gbps interface

For example,

If in scenario 1 I have

 --- --- --- ---
| 1 | 2 | 3 | 4 |
 --- --- --- ---

Where: 1 and 2 are 10gbps interfaces - and port 1 is plugged in 3 and 4 are 1gbps interfaces - and port 3 is plugged in

em1 would be port 3 - because this is the first running 1gbps port em2 would be port 1 - because this is the first running 10gbps port

If in scenario 2 I have

 --- --- --- ---
| 1 | 2 | 3 | 4 |
 --- --- --- ---

Where: 1 and 2 are 1gbps interfaces - port 1 is plugged in 3 and 4 are 10gbps interfaces - port 3 is plugged in

em1 would be port 1 - because this is the first running 1gbps port em2 would be port 3 - because this is the first running 10gbps port

Is there a way to automate this interface naming selection criteria (aka. look for first running 1gbps interface and automatically configure it as em1, look at first running 10gbps interface and configure it as em1)

EDIT: Providing use case so it doesn't seem "as crazy"

This is for a KVM deployment, they want to be able to automatically attach vlan sub interfaces (aka em2.vlan# to pre-defined bridges attached to domains/guests). In order to ensure we know which interface we're adding a vlan to, we need some kind of consistency in network naming.

We've thrown around the idea of creating bonds of single interfaces to ensure that we have a consistent interface name. That might work fine, but would still be a manual process to figure out which interface is the first 10gbps interface to configure as bond0.

If there are other ideas of how to add vlan sub interfaces to the 10gbps port consistently without having to know the underlying naming convention for each machine that would be appreciated as well.

I realize things like openvswitch might work but we're kinda just trying to go very basic network connectivity here.

share|improve this question
1  
Is this really a thing? I'm trying to figure out why anyone would want to do this... probably my lack of imagination, but would you indulge me and tell me why you want to do this or what your ultimate objective is? –  HopelessN00b May 5 at 19:42
1  
Yes, it probably can be done. Have fun tweaking udev after you turn biosdevname off. I would strongly discourage using the em* names as they literally mean 'Ethernet on Motherboard first interface' (em1). If you're going to do that at least use eth* names or something else so the next admin doesn't have to reverse engineer why 'em1' isn't actually the first ethernet interface on the motherboard. I'm with @HopelessN00bGeniusofnetwork, I can't see why this would be useful. If my boss asked me to implement this I'd probably slap him across the face then look for a new job. –  yoonix May 5 at 20:36
1  
You want the interface names to change depending on whether or not a cable is plugged in? That sounds like a troubleshooting nightmare. –  Grant May 5 at 21:06
1  
Adding edit providing rationale and purpose for the requirements. –  rainereality May 5 at 22:13

2 Answers 2

up vote 6 down vote accepted

Stop fighting windmills.

Instead of forcing your (broken) naming on interfaces, change your KVM provisioning tool to use tools like ethtool to detect the interface that should be used and create the vlan's on it.

share|improve this answer
    
So you're saying use ethtool to detect active interfaces/10gbps ports and configure based on that? –  rainereality May 5 at 22:57
    
That is indeed what I am saying :) –  Dennis Kaarsemaker May 5 at 22:57
4  
Cool, that definitely makes more sense. I always forget about some of these tools and how to implement them usefully. Thanks for knocking me back into sensibility :) –  rainereality May 5 at 22:58

Here's what we can do on HP ProLiant servers for deterministic network device naming. Please read through and see if anything resonates.

If your previous installation used the traditional naming scheme, after upgrading the OS, the system continues to use the traditional naming (or same) scheme. To get the mapping from the current ethN names to the new emX or pXpY names, issue the biosdevname –d command. For more information, refer to the following Linux man page: http://linux.die.net/man/1/biosdevname

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.