Page 1 of 1
[SOLVED] Can’t change Network interface name from enpxx to eth0
Posted: 2018/05/12 16:17:48
by bowbth
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
Re: Can’t change Network interface name from enpxx to eth0
Posted: 2018/05/12 16:19:19
by TrevorH
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).
Re: Can’t change Network interface name from enpxx to eth0
Posted: 2018/05/12 16:28:51
by bowbth
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)
Re: Can’t change Network interface name from enpxx to eth0
Posted: 2018/05/12 16:30:05
by TrevorH
What is the output from cat /proc/cmdline ?
Re: Can’t change Network interface name from enpxx to eth0
Posted: 2018/05/12 16:37:35
by bowbth
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"
Re: Can’t change Network interface name from enpxx to eth0
Posted: 2018/05/12 16:45:08
by TrevorH
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
Re: Can’t change Network interface name from enpxx to eth0
Posted: 2018/05/12 17:47:04
by bowbth
That’s it! you’re right
shame on me
Thanks
ps. how can I mark this topic has been resolved?
Re: Can’t change Network interface name from enpxx to eth0
Posted: 2018/05/13 06:40:16
by hunter86_bg
Just edit the topic name and put '[SOLVED]' infront.