将RHEL7系统网卡名称eno16777736改为eth0
在红帽RHEL7与Centos7系统中网卡命名规则被重新定义,您的网卡名称可能会是”eno167777xx”,可是已经习惯了eth0这种名称了,怎么办?那么按照《Linux就该这么学》书中的方法将让您将网卡重新命名为eth0,炒鸡煎蛋!!
In the Red Hat RHEL7 and Centos7 system, the name of the net card has been redefined, and your card may be called "eno16777xx", but it's used to the name eth0. So what if you rename the card eth0, fried chicken eggs according to the method used in Linux's book?
- 一台Rhel7或Centos7系统的Linux主机。
第1步:当红帽RHEL7系统安装完成,您的网卡名称会是这样的。
Step 1: When the Red Hat RHEL7 system is installed, the name of your card will be the same.
第2步:将网卡配置文件的NAME参数项修改为eth0。
Step 2: Amend the NAME parameter entry for the network card configuration file to eth0.
第3步:将网卡配置文件ifcfg-eno1677736重命名为ifcfg-eth0:
Step 3: Rename the web card configuration file ifcfg-eno 1677336 as ifcfg-eth0:
第4步:修改grub文件来禁用内核继续使用该命名规则,步骤:
Step 4: Amend the grub file to disable the kernel from continuing to use the naming rule, step by step:
编辑grub配置文件”/etc/sysconfig/grub“:
Edit grub profile "/etc/sysconfig/grub":
在”GRUB_CMDLINE_LINUX“变量中添加一句”net.ifnames=0 biosdevname=0“.
Add "net.ifnames=0 biosdevname=0" to "GRUB_CMDLINE_LINUX" variable.
第5步:重新生成grub配置并更新内核参数:
Step 5: Regenerate grub configuration and update kernel parameters:
运行命令:”grub2-mkconfig -o /boot/grub2/grub.cfg“
Run command: "grub2-mkconfig-o/boot/grub2/grub.cfg"
第6步:添加udev的规则(很有必要!)
Step 6: add the rules forudev (required!)
需要在”/etc/udev/rules.d“目录中创建一个网卡规则”70-persistent-net.rules“,并写入下面的语句:
You need to create a webcard rule in the "/etc/udev/rules.d" directory "70-persistent-net.rules" and write the following statement:
SUBSYSTEM=="net",ACTION=="add",DRIVERS=="?*",ATTR{address}=="您的网卡MAC地址",ATTR{type}=="1" ,KERNEL=="eth*",NAME="eth0"
SUBSYSTEM==&quat;net&quat;,ACTION==&quat;add&quat;, DRIVERS==&quat; *&quat; *, ATTR{address}=&quat; your Internet card MAC address &quat;, ATT{type}=&quat; 1&quat;, KERENEL==&quat; eth*&quat; NAME=&quat; et0&quat;
第7步:重启系统后验证下吧!
Step 7: Verify when the system is restarted!
END
- 请确保您的系统是RHEL7或Centos7系统。
注册有任何问题请添加 微信:MVIP619 拉你进入群
打开微信扫一扫
添加客服
进入交流群
1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。