The default NIC names for the newly installed Ubuntu16.04 and Centos7 are ens33. Want to change to eth0.
First, CentOS:
- Modify/etc/sysconfig/grub file (backup before modification)
Add 2 parameters (Net.ifnames=0 biosdevname=0) for the grub_cmdline_linux variable, and the modification is done as follows:
grub_cmdline_linux= "Crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap net.ifnames=0 biosdevname=0 RHGB Quiet
Notice that the spaces are separated before and after.
- Rebuilding the Grub configuration file
Execute command: Grub2-mkconfig-o/boot/grub2/grub.cfg
- Modify/etc/sysconfig/network-scripts/ifcfg-ens33
Modify the file name to Ifcfg-eth0
Open the file and modify the name and device parameters to eth0.
- Rebooting the system
- Ifconfig, the discovery has been modified to complete
Second, Ubuntu
- Vim/etc/default/grub
grub_cmdline_linux= "net.ifnames=0 biosdevname=0" (as in the first step above, add these two parameters)
- Rebuilding the Grub configuration file
Execute command: Grub2-mkconfig-o/boot/grub2/grub.cfg
- There are some places on the Internet to modify the/etc/network/interfaces file, I do not change here. (There is only one Lo address)
- Rebooting the system
- Ifconfig, the discovery has changed to complete
Linux modifies NIC name enss33 to Eth0--ubuntu16 and Centos7