RHEL7修改网卡名称为eth0

记录下RHEL7修改网卡名称为eth0的过程步骤。

1)修改网卡配置文件并改名
cd /etc/sysconfig/network-scripts/
mv ifcfg-eno16777736 ifcfg-eth0
vi ifcfg-eth0
NAME=eth0

2)修改grub文件并重新生成grub配置文件
  vim /etc/default/grub
GRUB_CMDLINE_LINUX="rd.lvm.lv=rhel/root crashkernel=auto  rd.lvm.lv=rhel/swap vconsole.font=latarcyrheb-sun16 vconsole.keymap=us net.ifnames=0 biosdevname=0 rhgb quiet"
grub2-mkconfig -o /boot/grub2/grub.cfg

3)设置udev文件

vim /etc/udev/rules.d/70-persistent-net.rules
SUBSYSTEM=="net",ACTION=="add",DRIVERS=="?*",ATTR{address}=="00:0C:29:7C:96:05",ATTR{type}=="1",KERNEL=="eth*",NAME="eth0"

4)重启
reboot

以上方法的确可以成功,自己使用另一种方法,即第一步使用nmtui,进行Networ
kManager。具体步骤为nmtui---> Edit a connection---->改网卡名为eth0。第二步为上边
步骤的第一步和第二步,然后直接重启就可以了

猜你喜欢

转载自www.linuxidc.com/Linux/2017-04/142488.htm
今日推荐