[SOLVED] Can’t change Network interface name from enpxx to eth0

Issues related to configuring your network
Post Reply
bowbth
Posts: 5
Joined: 2018/04/26 08:53:49

[SOLVED] Can’t change Network interface name from enpxx to eth0

Post by bowbth » 2018/05/12 16:17:48

I have a fresh install Centos7.
I’m trying to change Network interface name to eth0.

My interface name from ifconfig is enp2s0

I’ve following almost of guide from google
- add net.ifnames=0 biosdevname=0 in /etc/default/grub
-change interface name in network-scripts/ifcfg
-manual add network rule in 70-persistent
(after do all the steps of each guide,reboot the system)
However, there was no change of interfacename

What should I do?
Thanks
Last edited by bowbth on 2018/05/13 09:50:03, edited 1 time in total.

User avatar
TrevorH
Forum Moderator
Posts: 23676
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Can’t change Network interface name from enpxx to eth0

Post by TrevorH » 2018/05/12 16:19:19

Amending /etc/default/grub does nothing unless you rerun grub2-mkconfig and overwrite your current grub.cfg file (location varies depending on UEFI or not, usually in /boot/grub2.grub2.cfg).
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

bowbth
Posts: 5
Joined: 2018/04/26 08:53:49

Re: Can’t change Network interface name from enpxx to eth0

Post by bowbth » 2018/05/12 16:28:51

Sorry!
I didn’t add all the details in my post.
Acually, I already did all the things you said by following the guide.
(rerun grub2-mkconfig and overwrite grub.cfg, change device and name in network-scripts to eth0)

User avatar
TrevorH
Forum Moderator
Posts: 23676
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Can’t change Network interface name from enpxx to eth0

Post by TrevorH » 2018/05/12 16:30:05

What is the output from cat /proc/cmdline ?
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

bowbth
Posts: 5
Joined: 2018/04/26 08:53:49

Re: Can’t change Network interface name from enpxx to eth0

Post by bowbth » 2018/05/12 16:37:35

Code: Select all

[root@ajanvara-B85M-HD3 ~]# cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-3.10.0-862.2.3.el7.x86_64 root=/dev/mapper/centos_ajanvara--b85m--hd3-root ro crashkernel=auto rd.lvm.lv=centos_ajanvara-b85m-hd3/root rd.lvm.lv=centos_ajanvara-b85m-hd3/swap rhgb quiet LANG=en_US.UTF-8
[root@ajanvara-B85M-HD3 ~]# cat /proc/cmdline ?
BOOT_IMAGE=/vmlinuz-3.10.0-862.2.3.el7.x86_64 root=/dev/mapper/centos_ajanvara--b85m--hd3-root ro crashkernel=auto rd.lvm.lv=centos_ajanvara-b85m-hd3/root rd.lvm.lv=centos_ajanvara-b85m-hd3/swap rhgb quiet LANG=en_US.UTF-8
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos_ajanvara-b85m-hd3/root rd.lvm.lv=centos_ajanvara-b85m-hd3/swap rhgb quiet net.ifnames=0 biosdevname=0"
GRUB_DISABLE_RECOVERY="true"

User avatar
TrevorH
Forum Moderator
Posts: 23676
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Can’t change Network interface name from enpxx to eth0

Post by TrevorH » 2018/05/12 16:45:08

BOOT_IMAGE=/vmlinuz-3.10.0-862.2.3.el7.x86_64 root=/dev/mapper/centos_ajanvara--b85m--hd3-root ro crashkernel=auto rd.lvm.lv=centos_ajanvara-b85m-hd3/root rd.lvm.lv=centos_ajanvara-b85m-hd3/swap rhgb quiet LANG=en_US.UTF-8
No mention of biosdevname=0 net.ifnames=0 in that so I suspect you're amending the wrong file. If yours is a UEFI system then /boot/grbu2/grub.cfg is not used and you need to look at a similarly named file in /boot/efi/EFI/centos/grub.cfg
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

bowbth
Posts: 5
Joined: 2018/04/26 08:53:49

Re: Can’t change Network interface name from enpxx to eth0

Post by bowbth » 2018/05/12 17:47:04

That’s it! you’re right
shame on me :oops:
Thanks
ps. how can I mark this topic has been resolved?

hunter86_bg
Posts: 1373
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: Can’t change Network interface name from enpxx to eth0

Post by hunter86_bg » 2018/05/13 06:40:16

Just edit the topic name and put '[SOLVED]' infront.

Post Reply