ifdown: Interface eth0 not configured – the solution

After I imaged the disks from a failing Debian server to newer hardware, I got the error message ifdown: Interface eth0 not configured after issuing the command ifdown eth0. There’s not a lot of documentation out there about this so hopefully this writeup will help you if you’re getting this puzzling message.

This should be the same in Ubuntu, for what it’s worth.

interface eth0 not configured
If you change network cards or motherboards, you might lose eth0 and get the error message ifdown: interface eth0 not configured. Fixing it requires digging into kernel modules and an obscure file in /etc/udev.

ifdown: Interface eth0 not configured

The machine booted without much in the way of error messages or complaints. That didn’t surprise me; I’ve even moved hardware from one generation of Intel to another generation of AMD or the other way around and gotten away with it. What puzzled me, though, was that there was absolutely no sign of eth0 or eth1.

Normally what you do when networking acts up is bounce the network interface. Issuing the trusty command ifdown eth0 gave me the puzzling error message of ifdown: interface eth0 not configured.

But it was configured. It was right there in /etc/network/interfaces where it’s supposed to be.

Digging into kernel modules

It was time to dive into kernel modules.

This system had Broadcom NICs in it, so the kernel module was bnx2. If it had an Intel NIC, I’d probably have to mess with the e1000e module. Another common module is rtl8169, for cheap Realtek NICs. If you’re unsure what your system has, you can find some clues in the file /etc/udev/rules.d/70-persistent-net.rules, but I’m getting ahead of myself.

After messing around entirely too long, it occurred to me to issue these commands to see what was going on:

rmmod bnx2
modprobe bnx2
tail /var/log/kernel.log

And that told me something called udev was renaming eth0 to eth10. That was nice of it. But it wasn’t what I wanted. I wanted the network card to be eth0, not something unconfigured called eth10.

Changing the network card mapping

That pesky udev keeps its rules in /etc/udev/rules.d/ where I found a file called 70-persistent-net.rules. That file was a listing of the old system’s NICs and my new system’s NICs.

I found the old eth0 and eth1 on the first two lines of the file. I found my new eth10 and eth11 on the last two lines. The lines all look something like this:

# PCI device 0x14e4:0x1659 (bnx2)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="13:37:13:37:13:37", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

The string “13:37:13:37:13:37” is the MAC address of the NIC. I wish that was my real MAC address. The PCI device line helps you figure out what card it is, especially if you have multiple cards in play. Note the name of the kernel module in parenthesis.

The easiest thing to do is to back up the file, delete all of the old lines altogether, find your current card(s), decide which one you want to be eth0 and eth1, change the lines, then save the file.

That’s what I did. Then I ran these commands again:

rmmod bnx2
modprobe bnx2
tail /var/log/kernel.log

At that point, kernel.log suggested I had eth0 again. So I did an ifdown eth0 and ifup eth0 and indeed I did. No error messages this time. I could even ping Google.

So, fixing networking after moving Debian to new hardware isn’t all that hard. And that mysterious error message ifdown: interface eth0 not configured isn’t so unhelpful after all. It’s mostly a matter of knowing where to look. I hope I’ve made it easier for you.

One thought on “ifdown: Interface eth0 not configured – the solution

Comments are closed.

%d bloggers like this:
WordPress Appliance - Powered by TurnKey Linux