I’ve just installed a Fedora 19 on VMware workstation 9.
The default network device is “ens33” instead of “eth0” on RHEL.
The reason I have to use “eth0” is that the license component of one of our products has be to be linked with “eth0”.
There are some posts discussing about similar issues, most of which are for older OS.
I haven’t found one that exactly match my situation.
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
The easiest way to restore the old way Kernel/modules/udev rename your ethernet interfaces is supplying these kernel parameters to Fedora 19:
- net.ifnames=0
- biosdevname=0
To do so follow this steps:
- Edit /etc/default/grub
- At the end of GRUB_CMDLINE_LINUX line append “net.ifnames=0
biosdevname=0“ - Save the file
- Type “grub2-mkconfig -o /boot/grub2/grub.cfg“
- Type “reboot“
If you didn’t supply these parameters during the installation, you will probably need to adjust and/or rename interface files at /etc/sysconfig/network-scripts/ifcfg-*.
Up to Fedora 18, just biosdevname=0 was enough.
As an example, in a certain machine, in a exhaustive research, I got:
-No parameters: NIC identified as “enp5s2“.
-Parameter biosdevname=0: NIC identified as “enp5s2“.
-Parameter net.ifnames=0: NIC identified as “em1“.
-Parameter net.ifnames=0 AND biosdevname=0: NIC identified as “eth0“.
Method 2
You can do this using a udev rule, like so:
cat > /etc/udev/rules.d/99-rename-to-eth0.rules << EOF
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="$(cat /sys/class/net/ens33/address)", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
EOF
Method 3
In Fedora 20, things seem to have changed a bit further.
1) grub kernel arguments
Yes, both “net.ifnames=0” and “biodevame=0” seem necessary.
2) /etc/sysconfig/network-scripts/ifcfg-ethX
Yes, these are necessary, too.
3) /etc/udev/rules.d/60-net.rules
If you have multiple interfaces and want to control naming of each device rather than letting the kernel do in its own way, /etc/udev/rules.d/60-net.rules seems necessary to override /usr/lib/udev/rules.d/60-net.rules like the following.
# PCI device 0x1011:0x0019 (tulip)
{SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:c0:f0:4c:f5:78", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
# PCI device 0x10ec:0x8168 (r8169)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="60:a4:4c:b5:26:48", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
4) yum remove biosdevname seems unecessary.
Method 4
This is different in Fedora 19 than in previous releases. There are two things to address:
- Remove biosdevname if it is installed. (
yum remove biosdevname, or put-biosdevnamein your kickstart. - Disable the udev rule:
ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules
More info can be found at http://fedoraproject.org/wiki/Features/SystemdPredictableNetworkInterfaceNames
Method 5
While the accepted answer does provide a solution that works, it does not explain why ens33 is being used. The links below provide background on why the network device is named something other than eth0 and how it’s now named in RHEL 7 variants:
- Predictable Network Interface Names – Explains the “why” well
- CHAPTER 8. CONSISTENT NETWORK DEVICE NAMING – RedHat (RHEL7) document explaining all the rules (see section 8.9 for disabling instructions)
It’s also worth noting that the values like “33” that appear in ens33 come from the PCI adapter slot value as returned by the BIOS. Use this command to see what values your system has listed for “Physical Slot”:
lspci -vv | grep -A20 Ethernet
Additional information on the “ens” part of the name can be found in the udev source code.
Method 6
For Fedora-24:
-
Edit
/etc/default/grub -
At the end of
GRUB_CMDLINE_LINUXline appendnet.ifnames=0 biosdevname=0 - Save the file
-
Type
grub2-mkconfig -o /boot/grub2/grub.cfg"
or type
grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
-
Type
reboot
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0