2009-12-12

renamed network interface eth0 to eth1

Miraculously, after my old server motherboard died, Ubuntu booted right up on the new board. The only problem I've run into so far is that since the new board's network interface had a different MAC address from my old eth0, udev decided to call it eth1.
Dec 11 00:54:16 hierax kernel: [   15.251176] udev: renamed network interface eth0 to eth1
I first noticed this when the system didn't get the static ip I had configured in /etc/network/interfaces. I changed the definition there from eth0 to eth1, bounced the interface, and everything seemed to be working until I noticed that some backend applications were unable to resolve domain names. Commands such as ping and nslookup timed out on name lookups, but IP lookups were fine. It was pretty clear that the problem was that it couldn't reach a DNS server; I did some research and remembered that they can be configured in /etc/resolv.conf, so I took at look and found that the file consisted of the following:
# Generated by NetworkManager
Some backgroud: apparently network configuration via NetworkManager is the default for Ubuntu desktop systems, so when I first installed, I disabled it in /etc/NetworkManager/nm-system-settings.conf:
[main]
plugins=ifupdown,keyfile

[ifupdown]
managed=false
Perhaps it was a remnant of NetworkManager's configuration, but I still don't know why the system forgot how to contact a DNS server. Anyway I tried adding my network's gateway to /etc/resolv.conf, and name lookups started working again.
nameserver 192.168.1.1
After a bit more research on NetworkManager (there seems to be very little documentation), I found a blog post with an additional solution to make sure NetworkManager doesn't overwrite my /etc/resolv.conf change, so I added the following line to /etc/dhcp3/dhclient.conf:
prepend domain-name-servers 192.168.1.1;
No more trouble so far.

No comments:

Post a Comment