How can I prevent udevd from renaming eth0 to em1

JD jd1008 at gmail.com
Wed Oct 17 22:24:12 UTC 2012


On 10/17/2012 03:59 PM, Digimer wrote:
> On 10/17/2012 05:44 PM, JD wrote:
>> On 10/17/2012 02:38 PM, Digimer wrote:
>>> On 10/17/2012 04:01 PM, JD wrote:
>>>> On 10/16/2012 05:05 PM, JD wrote:
>>>>> On 10/16/2012 02:27 AM, Reindl Harald wrote:
>>>>>> Am 16.10.2012 04:58, schrieb JD:
>>>>>>> I googled this and came across 2 purported
>>>>>>> solutions, neither of which worked.
>>>>>>> 1. Uninstall package biosdevname and reboot.
>>>>>>>
>>>>>>> That did not prevent udevd from renaming eth0 to em1.
>>>>>>>
>>>>>>> 2. Add the line
>>>>>>> biosdevname=0
>>>>>>> to /boot/grub2/grub.cfg
>>>>>>>
>>>>>>> That did not work either.
>>>>>>> Any other way to get around this renaming?
>>>>>> find out your MAC-address with "ifconfig -a"
>>>>>> make a udev-rule like below (ONE line) for the MAC
>>>>>> reboot the machine after that and you are done
>>>>>>
>>>>>> [root at rh:~]$ cat /etc/udev/rules.d/70-persistent-net.rules
>>>>>> # PCI device 0x8086:0x1502 (e1000e)
>>>>>> SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",
>>>>>> ATTR{address}=="78:ac:c0:b1:76:e4", ATTR{dev_id}=="0x0",
>>>>>> ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
>>>>>>
>>>>>>
>>>>>>
>>>>> I made the change and rebooted.
>>>>>
>>>>> $ dmesg | grep em1
>>>>> [    5.949297] udevd[219]: renamed network interface eth0 to em1
>>>>> $ ifconfig eth0
>>>>> eth0: error fetching interface information: Device not found
>>>>>
>>>>> $ cat /etc/udev/rules.d/70-persistent-net.rules
>>>>> # 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, and change only the value of the NAME= key.
>>>>>
>>>>> # PCI device 0x168c:0x0023 (ath9k)
>>>>> SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",
>>>>> ATTR{address}=="edited-out", ATTR{dev_id}=="0x0", ATTR{type}=="1",
>>>>> KERNEL=="wlan*", NAME="wlan0"
>>>>>
>>>>> # PCI device 0x1039:0x0900 (sis900)
>>>>> SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",
>>>>> ATTR{address}=="edited-out", ATTR{dev_id}=="0x0",
>>>>> ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
>>>>>
>>>>> # USB device 0x0bda:0x8187 (usb) (custom name provided by external
>>>>> tool)
>>>>> SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",
>>>>> ATTR{address}=="edited-out", ATTR{dev_id}=="0x0", ATTR{type}=="1",
>>>>> KERNEL=="wlan*", NAME="wlan1"
>>>>>
>>>> So, does anyone have any other suggestion how to
>>>> prevent udevd from renaming eth0 to em1?
>>> Here is what I wrote down for changing ethernet devices to any arbitrary
>>> name you want, including ethX, under Fedora 17 (15+, actually).
>>>
>>> https://alteeve.ca/w/Changing_Ethernet_Device_Names_in_EL7_and_Fedora_15%2B
>>>
>>>
>>> You don't need to mess with biosdevname, juts set/edit
>>> 70-persistent-net.rules (details described in the above link).
>>>
>> The author says on that web page:
>>
>> You can download and run this and it will print a skeleton udev file. If
>> the output looks good, re-run it again and pipe the output to the
>> 70-persistent-net.rules file.
>>
>> Well, I ran his script. It outputs nothing, and exits with status 0.
> That's me. It does an 'ifconfig -a' and, parses the interfaces and spits
> out entries formatted for udev.d. So if it printed nothing, check to see
> if 'ifconfig -a' shows any interfaces.
>
> digimer
Briefly....
$ ifconfig -a
em1       Link encap:Ethernet  HWaddr xx:xx:...etc

lo        Link encap:Local Loopback

virbr0    Link encap:Ethernet  HWaddr xx:xx:...etc

virbr0-nic Link encap:Ethernet  HWaddr xx:xx:...etc

wlan0     Link encap:Ethernet  HWaddr xx:xx:...etc




More information about the users mailing list