rhel7修改網卡名爲eth0記錄

1)修改網卡配置文件並更名ios

cd /etc/sysconfig/network-scripts/vim

mv ifcfg-eno16777736 ifcfg-eth0ide

vi ifcfg-eth0 ui

NAME=eth0ip

2)修改grub文件並從新生成grub配置文件it

  vim /etc/default/grubio

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"console

grub2-mkconfig -o /boot/grub2/grub.cfgclass

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。第二步爲上邊

步驟的第一步和第二步,而後直接重啓就能夠了

相關文章
相關標籤/搜索