Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Reset persistent network interface BSD names System
Please note that this hint is specifically describing wired-Ethernet interfaces, however it also directly relates to wireless-Ethernet interfaces (such as AirPort, AirPort Extreme, or wireless PCI cards), and Ethernet-over-FireWire interfaces (including the built-in FireWire ports).

Picture a tower which has two ethernet interfaces -- one built-in, and a second via a PCI card (but no AirPort interface). Normally, Mac OS X will assign the built-in interface a BSD name of en0 and the PCI card interface a BSD name of en1.

Now, imagine the following three possible scenarios for a computer with the above specifications:
  1. You replace (or upgrade) the PCI Ethernet card in a tower.
  2. You move a hard drive from one tower to another tower with similarly two Ethernet interfaces (perhaps a brain/hard drive transfer, AKA a massive hardware upgrade).
  3. You clone a hard drive from one tower to another tower with similarly two Ethernet interfaces (perhaps as a backup for a mission-critical server or workstation).
Now your two Ethernet interfaces are named en0 (built-in) and en2 (PCI card). Why is the PCI card now labeled as en2 instead of en1, and why is that possibly bad?

I'll answer the second question first. That's possibly bad if you have a bunch of configuration files that specifically refer to en1. For instance, a firewall/gateway computer that bridges en0 (internet interface) to en1 (LAN interface). If en1 doesn't exist, then all of your LAN traffic won't go anywhere and won't do anything. This has implications for your IPFW2 startup and configuration files, and also your DHCPD startup files.

So why does the system exhibit this behavior? Because there are files in your system which record very specific information about your secondary Ethernet interface. If the information does not exactly match, then the system keeps the old information linked with the en1 BSD name, and creates a new BSD name for the new ethernet interface. So how do you solve this problem? There are two solutions:
  1. You can hand edit your configuration files, replacing en1 with en2. That's lame, especially if you miss any iterations (it's like looking for a needle in a haystack), or if you have to make another transition in the future.
  2. Before you make the transition, record all of the pertinent settings and modes from the Network System Preferences pane. Actually, you should have this information backed-up in a dead-tree edition in case of a catastrophic failure anyway. Then make your transition. Once complete, boot your modified tower and move the following files to a safe location (your Desktop, perhaps). Here is a cute command line command which you can enter into the [the following command is all one line; the backslashes should allow a copy and paste to work]:
    sudo mv /Library/Preferences/SystemConfiguration
    /NetworkInterfaces.plist /Library/Preferences/SystemConfiguration
    /preferences.plist ~username/Desktop
    Enter your admin password, then restart your computer. Once restarted, you will need to re-enter your settings and modes into your now blank Network preference pane. Also, you will need to update your Computer Name in the Sharing preference pane.
Unfortunately, this isn't a check-box-one-click-solution (read: instant-gratification fix), but it's pretty quick, and it saves you from having to nano-dive through a bunch of flat files. Also, this provides you a couple of simple options for hardware updates and backups that require very minimal downtime.

Note that I'm not sure how Mac OS X will deal with naming the new G5 towers' built-in Ethernet ports, since there are now two built-in 1Gb Ethernet ports, and an AirPort Extreme interface. Will the 1Gbs be named en0 and en1 with the AirPort being named en2? I also don't know how the default naming scheme order would play-out for a tower with one built-in Ethernet interface, an AirPort card interface, and a PCI Ethernet interface. I would assume en0, en1, and en2 in that order. Thankfully, FireWire interfaces follow a different, but similar scheme for their BSD names: fw0, fw1, fw2, etc.
  • Currently 2.80 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (5 votes cast)

Reset persistent network interface BSD names | 3 comments | Create New Account
Click here to return to the 'Reset persistent network interface BSD names' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Reset persistent network interface BSD names
Authored by: kwielandinstl on Oct 21, '05 07:54:18AM

Couldn't you just create a symlink from en1 to en2 in /dev , or is OSX much different then *BSD in this regard?

[ Reply to This | # ]
Reset persistent network interface BSD names
Authored by: nathanw on Oct 21, '05 11:24:49AM

In traditional BSD systems, network interfaces don't have nodes in /dev. The device names exist only in a special namespace accessed by ifconfig and the underlying library routines.

[ Reply to This | # ]
Reset persistent network interface BSD names
Authored by: bdog on Oct 21, '05 09:25:57AM

Or maybe you can just change the value for "BSD Name" in that plist after deleting the old config (which would currently have the BSD Name that you want to use for the other, newer config)? I don't know if it works that simply or not.

[ Reply to This | # ]