== How Linux names network interfaces The usual explanation of how network interfaces get their names is that they're named based on what's in _/etc/modprobe.conf_ (_/etc/modules.conf_ if you're still running a 2.4 series kernel). You'll have lines like: > alias eth0 sk98lin > alias eth1 3c59x > alias eth2 e100 And indeed this usually works, and when your system boots nicely the 3Com 'Marvell' gigabit card is _eth0_, the 3Com 'Cyclone' 100mbit card is _eth1_, and the Intel 100mbit card is _eth2_. Then one day you boot your system single-user without network interfaces enabled and decide to bring up just _eth1_, so you do '_ifup eth1_' (or just '_modprobe eth1_'). And the world explodes in your face, because the nice simple explanation is a white lie. How the Linux kernel really names network interfaces is that ~~network interfaces are named in the order they're found~~: the first network interface found is _eth0_, the second is _eth1_, and so on. The names in the 'alias' lines in _/etc/modprobe.conf_ don't get passed to the kernel; they just help make the normal configuration more generic. So when you do '_modprobe eth1_' on a bare system _modprobe_ maps 'load eth1' to 'load the 3c59x driver', the driver finds a card with a single network interface, and as the first found it becomes _eth0_. Kaboom. (Similar things can happen if you remove a network card.) If you want stable names, the kernel does support renaming network interfaces; the usual approach is to name interfaces based on MAC addresses. On modern kernels you can use _udev_ rules (see [[here|http://www.reactivated.net/writing_udev_rules.html#example-iface]]); there's also _nameif_, and your distribution may already support it with the right magic settings. (On Red Hat and Fedora Core, I believe that you set _HWADDR_ in the _ifcfg-[[*|]]_ file in _/etc/sysconfig/network-scripts_. I'm not sure what Debian uses.) The kernel uses registration order based naming for other things too; the most famous (or infamous) case is SCSI drives, where the first one found is _sda_, the second one _sdb_, etc. (The kernel treats SATA drives as SCSI devices, so more and more people may have to care about this one.)