程式扎記: [Linux 文章收集] CentOS 7 Change Network Interface Name From Eno* To Eth0

標籤

2015年12月16日 星期三

[Linux 文章收集] CentOS 7 Change Network Interface Name From Eno* To Eth0

Source From Here
Introduction
After you installed CentOS 7.0 or RHEL 7.0 system, you maybe notice that the default name of network interface was changed from “Eth*” to “Eno*”. How do I change network interface name to “Eth0″ in CentOS 7.0? This post will show you the ways to change network interface.

CentOS 7 Change Network Interface Name
Step1# issue the ifconfig command to check the current network interface information, type:
$ sudo ifconfig
eno16777736: flags=4163 mtu 1500
...

Step2# edit “/etc/sysconfig/grub” configuration file using “vim” command:
$ sudo vim /etc/sysconfig/grub
  1. GRUB_DEFAULT=saved  
  2. GRUB_DISABLE_SUBMENU=true  
  3. GRUB_TERMINAL_OUTPUT="console"  
  4. GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/swap vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos/root crashkernel=auto  vconsole.keymap=us rhgb quiet"  
  5. GRUB_DISABLE_RECOVERY="true"  

then searching for “GRUB_CMDLINE_LINUX” line and appending the following content “net.ifnames=0 biosdevname=0“, just like the below:
  1. GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/swap vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos/root crashkernel=auto  vconsole.keymap=us rhgb quiet net.ifnames=0 biosdevname=0"  
Step3# Using “grub2-mkconfig” command to re-generate a new grub configuration file, type:
$ sudo grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-123.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-123.el7.x86_64.img
Warning: Please don't use old title `CentOS Linux, with Linux 3.10.0-123.el7.x86_64' for GRUB_DEFAULT, use `Advanced options for CentOS Linux CentOS Linux, with Linux 3.10.0-123.el7.x86_64' (for versions before 2.00) or `gnulinux-advanced-dbedd8fa-5d86-4ea0-8551-8444a48cd44f nulinux-3.10.0-123.el7.x86_64-advanced-dbedd8fa-5d86-4ea0-8551-8444a48cd44f' (for 2.00 or later)
Found linux image: /boot/vmlinuz-0-rescue-3303e35a730a41e3b4e99b544acea205
Found initrd image: /boot/initramfs-0-rescue-3303e35a730a41e3b4e99b544acea205.img
done

Step4# Rename “Eno” network file using”mv”command, type:
$ sudo mv /etc/sysconfig/network-scripts/ifcfg-eno16777736 /etc/sysconfig/network-scripts/ifcfg-eth0

Step5# Edit “/etc/sysconfig/network-scripts/ifcfg-eth0 ” configuration file and set the value of “Name” field to “eth0″.
  1. DEVICE=eth0  
  2. ...  
  3. NAME="System eth0"  
  4. ...  
Step6# reboot system, after rebooting system, using “ifconfig” command check network interface information again.
# ifconfig
eth0: flags=4163 UP,BROADCAST,RUNNING,MULTICAST mtu 1500
...


沒有留言:

張貼留言

網誌存檔