March 31, 2008

222 words 2 mins read

“Renaming” ethernet adapters in Debian

I have a Dell PowerEdge 1950 server running Debian Sarge. It recently experienced the joy of a motherboard replacement (which will hopefully make the hardware faults go away). This normally isn’t a big deal, except for the fact that I use the onboard gigabit NICs. See Debian “knows” which network card is which by MAC address and when you replace the motherboard you get 2 new MACs. So instead of having eth0 & eth1, you’ve got eth2 & eth3. I google’d around for a long time and couldn’t find out how to make Debian “forget” the old NIC’s, so I went with instructions I found on how to “Rename” the adapters using udev. Sadly… It didn’t work.

As it turns out though, /etc/udev/rules.d/z25_persistent-net.rules is the home of where Debian remembers the network adapters. So I popped open that file and found my two old adapters and the two new ones. A few lines commented out, a few renamed lines (oh, and a reboot) — and I was off to the races.

Oh, and if you are wondering why I cared about eth0/1 versus eth2/3 — The G729 licenses for Asterisk are tied to the MAC of eth0. So without an eth0 my G729 enabled phones didn’t work, and I couldn’t re-register the licenses. Sigh… Oh well, I can use my phone now!