Ask Your Question

How to change the network interfacename to "p4p2" on Fedora 28

asked 2018-07-01 13:32:51 -0500

zyxregister gravatar image

I want to change my network interface name to "p4p2". I added "net.ifname=0 biosdevname=0" to grub file and updated it. Also, I changed the ifcfg-p4p2 file, where the value of NAME and DEVICE was changed to "p4p2".When I reboot the computer, the ifconfig commmand output still is "eth0" but not "p4p2". However, when I changed the name to "jlx", it succeeded. And on centos, it's also no problem. Therefore, why did this happend? How can I change to name to "p4p2"

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2018-07-01 21:08:02 -0500

fcomida gravatar image
edit flag offensive delete link more

answered 2018-07-01 14:35:40 -0500

Michael W. gravatar image

Try udev-rules. I expect Fedora to not be completely different from other distributions. At least in Ubuntu, Debian, manjaro a udev rule allows to set the interface name by other attributes like MAC-Address. Fedora uses also udev to find devices.

Example file /etc/udev/rules.d/70-persistent-net.rules:

# MAC is 12:34:56:78:90:ab
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="12:34:56:78:90:ab", NAME="p4p2"


edit flag offensive delete link more


Yes,I changed the file /etc/udev/rules.d/70-persistent-net.rules. When I change the name to "jlx", it worked. But I tried to change the name to "p4p2", it failed. I didn't know why?

zyxregister gravatar imagezyxregister ( 2018-07-01 22:13:22 -0500 )edit

As described in the link posted by @fcomida , chapter 8.6. These are systematically created names. I could imagine that if such name is detected, "the systemd naming scheme will take precedence" (cited), and overwrites your name again. To confirm this, you need to look into your dmesg and system logs (also inside journald). There should be located a line describing the name change.

Michael W. gravatar imageMichael W. ( 2018-07-02 15:18:34 -0500 )edit

Question Tools

1 follower


Asked: 2018-07-01 13:32:51 -0500

Seen: 459 times

Last updated: Jul 01 '18