Cleaning up eth[0-9]_rename files on Fedora core hosts


I kickstart’ed a Fedora Core 10 host last week, and decided to add a second NIC to the host to do some network bonding testing. Once the I added the NIC and rebooted the host, I noticed that one of the interfaces had the “_rename” extension:

eth0_rename Link encap:Ethernet HWaddr 00:0C:29:B7:1B:7B
inet addr:192.168.1.148 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:feb7:1b7b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:593 errors:0 dropped:0 overruns:0 frame:0
TX packets:363 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:52869 (51.6 KiB) TX bytes:67112 (65.5 KiB)
Interrupt:18 Base address:0x2000

eth1 Link encap:Ethernet HWaddr 00:0C:29:B7:1B:85
inet addr:192.168.1.128 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:feb7:1b85/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:50 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4738 (4.6 KiB) TX bytes:1236 (1.2 KiB)
Interrupt:16 Base address:0x2080

Network interface names are assigned by udev at boot time, and after a bit of poking around in /etc/udev I came across the following udev rule file:

# This file was automatically generated by the /lib/udev/write_net_rules
# program run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single line.

# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] (rule written by anaconda)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:a0:ad:c7", ATTR{type}=="1",
KERNEL=="eth*", NAME="eth0"

# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:b7:1b:85", ATTR{type}=="1",
KERNEL=="eth*", NAME="eth0"

# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:b7:1b:85", ATTR{type}=="1",
KERNEL=="eth*", NAME="eth1"

It appears that the the same mac address got assigned to both eth0 and eth1, which was causing one of the devices to get renamed during system initialization. To fix this issue, I updated the MAC address that was associated with eth0 rule, which allowed everything to come up cleanly. Udev is pretty sweet, and I will have to add it to my list of things to blog about it in the future.

This article was posted by Matty on 2009-04-11 14:09:00 -0400 -0400