How to change network device name p4p1 to eth0 in Fedora 18?
Please give a detailed description, because I am a newbie.
How to change network device name p4p1 to eth0 in Fedora 18?
Please give a detailed description, because I am a newbie.
Try going to /etc/udev/rules.d. Edit the file 70-persistent-net.rules. There will be a line that has NAME="p4p1". Change it to NAME="eth0" and reboot.
Afterthought: You may also need to disable the routine "biosdevname" . Best way to do this is to edit the file /etc/default/grub to add "biosdevname=0" to the line GRUB_CMDLINE_LINUX. Then rebuild your grub.cfg file by executing the command "grub2-mkconfig -o /boot/grub2/grub.cfg" followed by a reboot.
Last edited by leehol; 22nd February 2013 at 05:16 PM.
https://docs.fedoraproject.org/en-US...r_Desktop.html3.3. Networking
3.3.1. Consistent network device naming
Fedora 18 continues the previous releases' use of biosdevname to set network device names in a deterministic manner. Ethernet ports embedded on server motherboards will be named emport_number, while ports on PCI cards will be named pslot_numberpport_number, corresponding to the chassis labels. This feature may be disabled by passing biosdevname=0 on the kernel command line, in which case, behavior will revert to using ethX names.
https://fedoraproject.org/wiki/Featu...rkDeviceNamingYou may continue to write rules in /etc/udev/rules.d/70-persistent-net.rules to change the device names to anything you wish. Such will take precedence over this physical location naming scheme. Such rules may look like:
This feature may be disabled by passing "biosdevname=0" on the kernel command line, in which case, behavior will revert to using ethX names.Code:SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:11:22:33:44:55", ATTR{type}=="1", KERNEL=="eth*", NAME="public"
Upgrading from an earlier version of Fedora (including 15-Alpha or -Beta) to Fedora 15 may result in a change of network device names from an earlier biosdevname naming scheme to the final naming scheme described here. Configuration files must be manually adjusted accordingly.
WARNING: Every single time you read "REMOVE", "DELETE" or the like translate it to "RENAME" or "Comment out", never delete anything without making a backup of it first, if things go wrong you can at least go back to the way things were.
Resources:
https://alteeve.ca/w/Changing_Ethern...d_Fedora_15%2B
http://www.debianadmin.com/rename-ne...-in-linux.html
http://www.science.uva.nl/research/a...InterfaceNames
I don't think Fedora has the net rules by default anymore, at least my install doesn't have it.
I fix it by first removing biosdevname
yum remove biosdevname
I then manually rename /etc/sysconfig/network-scripts/ifcfg-whatever to ifcfg-eth0 (or whatever interface is in question)
I then edit the file itself, replacing the biosdev name with eth0 in the Name= line.
Then reboot.
This works for me. I make no claims that it's a good way or won't break something else, but it's what I've been doing since they made the decision to do the biosdevname thing. For what it's worth, I also make sure that I have NM_CONTROLLED=no in my /etc/sysconfig/network-scripts/ifcfg-whatever file.
Note that in F19, this no longer works. Easiest way seems to be to run rpm -e biosdevname, and also add net.ifnames=0 to the end of the kernel line in /etc/default/grub. I then edited /etc/sysconfig/network-scripts/ifcfg-<ifname> as mentioned above.
The other method which also works is to create an /etc/udev/rules.d/70
http://rackerhacker.com/2011/09/25/g...-in-fedora-15/
gives a good explanation.
Unfortunately, this seems to be another instance where we'll have to get used to it--I suspect it will continue to get harder and harder to work around.
Well, on a test of TC4, the ifnames=0 doesn't seem to work. Only thing working now is to use the udev rules that I link in the post above.
EDIT.
Ok, I may have made a typo somewhere, but I don't think so. It looks as if even adding a udev rules file isn't working.
Maybe a bug, maybe yet another RH feature, no more time to check right now.
EDIT again
Oh....kay. Adding both biosdevnames=0 and net.ifnames=0 seems to have fixed the problem. The udev rules.d file isn't necessary.
Last edited by smr54; 4th April 2013 at 04:01 PM.
Glad to hear it, but I am finding that after doing all this, I still need to put (on F19 and probably 18) net.ifnames=0 in /etc/default/grub on the kernel line, and then running grub2-mkconfig -o /boot/grub2/grub.cfg
In the immortal words of Dan, "Why ?"
The biosdevname feature is a major imrovement over eth0, 1 .. .wher ethe order and name have no relation to the physical interfaces and ames like ethh0 <-> eth1 can swap anytime the kernel or udev config changes.
So what exactly is the advantage of switching to eth0 .. ? I don't see it at all.
==
Having said that - to change the interface name you can use ....
ip link set p4p1 down
ip link set p4p1 name eth0
ip link set p4p1 up
or the ancient and possibly deprecated 'ifrename' utility is simple and effective.
actually, they had changed the udev rules where eth* was pretty well ironed out and didn't change. They had it where udev would detect the network cards, and look in it's own udev rules file to determine how to name them. If it had assigned a device name for the adapter before, it would be in it's rules file with a specific hardware address, and udev would use that to name it, if it had never been detected before, then udev would assign a new device name, and add it to it's rules file.
This pretty much kept the device naming consistent over reboots, with the only glitch occurring if you ever removed a network adapter. It wouldn't go back and change it's rules file, so if you removed eth1 and installed a new adapter, it would get named eth2 (if you didn't already have an eth2) skipping eth1. If you wanted it to go back and reuse the eth* names, you had to delete the old entries from the rules file.
Fedora 19 has changed up the device naming once again, and it's even weirder names![]()
the answer for me is: Matlab! their activation system relies on a network device named eth?
Just to be clear, I've used a combination of the tips posted by smr54,
for me (FC19) the solution was:
1) yum remove biosdevname
2) add net.ifnames=0 to GRUB_CMDLINE_LINUX in /etc/default/grub
3) grub2-mkconfig -o /boot/grub2/grub.cfg
4) rename /etc/sysconfig/network-scripts/ifcfg-whatever to ifcfg-eth0
5) change to NAME=eth0 inside ifcfg-eth0
Last edited by Jann5s; 7th July 2013 at 04:41 PM.
The naming is done by udev, and only if the interface does not have a name yet.
So, you just have to write a custom rule. What I did in FC19 is to create the file '/etc/udev/rules.d/75-persistent-net.rules' with the content:
Replace <THE MAC ADDRESS> by the mac address of the card.Code:SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="<THE MAC ADDRESS>", NAME="eth0"
Create a line by interface. The name will be set at the next boot.
:confused:
Excellent solution skull; worked perfectly. Thanks.