1、重命名并修改网卡配置文件,将"NAME"参数更为我们熟悉的“eth*”,这里我将其改为"eth0"

 [root@localhost ~]# cd /etc/sysconfig/network-scripts/
[root@localhost network-scripts]# mv ifcfg-eno16777736 ifcfg-eth0
[root@localhost network-scripts]# vim ifcfg-eth0
HWADDR=:0C::BA::E3
TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=eth0 #修改此参数,和文件名称ifcfg-eth0保持一致
UUID=a937a6e4-f70d--b617-ea0b53cab76e
ONBOOT=yes

2、修改grub文件/etc/sysconfig/grub,在“GRUB_CMDLINE_LINUX”参数行中添加“net.ifnames=0 biosdevname=0”

 [root@localhost network-scripts]# vim /etc/sysconfig/grub
GRUB_TIMEOUT=
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="rd.lvm.lv=rhel/root vconsole.keymap=us vconsole.font=latarcyrheb-sun16 crashkernel=auto net.ifnames=0 biosdevname=0 rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
3、重新生成grub配置并更新内核参数:
运行命令:”grub2-mkconfig -o /boot/grub2/grub.cfg“
 [root@localhost network-scripts]# grub2-mkconfig -o /boot/grub2/grub.cfgGenerating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.-.el7.x86_64
Found initrd image: /boot/initramfs-3.10.-.el7.x86_64.img
Found linux image: /boot/vmlinuz--rescue-e5dec78a32184af9be1ffa5acfa5efbb
Found initrd image: /boot/initramfs--rescue-e5dec78a32184af9be1ffa5acfa5efbb.img
done

4、重启系统后,ifconfig查看:

 [root@localhost ~]# ifconfig
eth0: flags=<UP,BROADCAST,MULTICAST> mtu
ether :0c::ba::e3 txqueuelen (Ethernet)
RX packets bytes (47.0 KiB)
RX errors dropped overruns frame
TX packets bytes (0.0 B)
TX errors dropped overruns carrier collisions eth1: flags=<UP,BROADCAST,RUNNING,MULTICAST> mtu
ether :0c::ba::ed txqueuelen (Ethernet)
RX packets bytes (1.8 MiB)
RX errors dropped overruns frame
TX packets bytes (0.0 B)
TX errors dropped overruns carrier collisions
5、为了双重保险起见建议使用udev规则管理,在”/etc/udev/rules.d“目录中创建一个网卡规则”70-net.rules“,并写入下面的语句:
ACTION=="add",SUBSYSTEM=="net",DRIVERS=="*",ATTR{address}=="00:0c:29:ba:53:e3",ATTR{type}=="1",KERNEL=="eth*",NAME="eth0"
 [root@localhost ~]# cd /etc/udev/rules.d/
[root@localhost rules.d]# vim -net.rules
ACTION=="add",SUBSYSTEM=="net",DRIVERS=="*",ATTR{address}=="00:0c:29:ba:53:e3",ATTR{type}=="",KERNEL=="eth*",NAME="eth0"
[root@localhost rules.d]# udevadm trigger

RHEL7/CentOS7中更改网卡默认名称的更多相关文章

  1. CentOS7系统更改网卡名为eth0

    centOS7系统更改网卡名为eth0 1.编辑grub参数 [root@localhost ~]# vim /etc/sysconfig/grub 2.在GRUB_CMDLINE_LINUX行中添加 ...

  2. CentOs7中的网卡配置工具

    CentOs7中的网卡配置工具 摘自:https://blog.51cto.com/13572810/2087991 misslaziness1人评论2715人阅读2018-03-17 22:09:1 ...

  3. centos7中的网卡名称相关知识

    转载自https://www.cnblogs.com/zyd112/p/8143464.html 一致性网络设备命名(Consistent Network Device Naming) 背景介绍: 在 ...

  4. rhel和centos7下更改网卡名称ens33为eth0

    Linux使用小Tips 整理些Linux些常遇到的问题. 修改网卡ens33为eth0 在使用RHEL和Centos7,发现网卡名称变成了EnoX,挺不习惯.现更改回旧名称eth0看着顺眼. 备份/ ...

  5. centos7中的网卡一致性命名规则、网卡重命名方法

    一致性网络设备命名(Consistent Network Device Naming) 背景介绍: 在centos5的时候,我们习惯了eth0这样的网络设备命名,在centos6发现网络设备变成了em ...

  6. Centos7 系统更改apache默认网站目录(解决You don't have permission to access / on this server问题)

    当我们在Centos7中配置好Apache时,发现apache默认解析目录是在 /var/www/html,也就是说当访问服务器 IP 或者本地 localhost 时, 默认定位到这个目录里的 in ...

  7. ubuntu中更改apache默认目录的方法

    如上,在这两个文件中,我都改为/home/www 及/home/www/html

  8. centos7 搭建双网卡bond1(主备模式)实例

    前景须知: 在redhat6 中网卡叫bond,在redhat7及centos7中改名team,此处只记录centos7中双网卡主备搭建过程. 应用情景:实现网络的高可用,防止一条网线或交换机故障影响 ...

  9. Centos7更改网卡名称Eth0并配置静态IP

    1.首先查看一下centos7的网卡名称 eno33554984 2.更改为centos7之前版本的网卡名称 3.更改网卡文件的名称 4.禁用可预测命名规则. 通过编辑 /etc/default/gr ...

随机推荐

  1. Shiro简单配置

    注:这里只介绍Spring配置模式. 因为官方例子虽然中有更加简洁的ini配置形式,但是使用ini配置无法与spring整合.而且两种配置方法一样,只是格式不一样. 涉及的jar包 核心包shiro- ...

  2. 安装ntp

    #yum -y install ntp#service ntpd restart#vi /etc/ntp.confserver 0.aisa.pool.ntp.org iburstserver 1.a ...

  3. InvocationException: GraphViz's executables not found

    当我在visualize决策树,运行以下代码时,报错: InvocationException: GraphViz's executables not found import pydotplus f ...

  4. Python 多线程

    一.线程的使用 需导入模块: from threading import Thread 二.基本使用 def fun1(arg1, v): print(arg1) print('before') t1 ...

  5. java class的property的get和set方法生成规则

    package rh.intellicareAppServer.dao; public class test { String aA; String aa; public String getaA() ...

  6. Request.ServerVariables

    APPL_MD_PATH-->APPL_PHYSICAL_PATH-->C:\Users\TomZhang\Desktop\GAP\后台修改\UMS\UMSSite\AUTH_TYPE-- ...

  7. 利用微软AntiXss Library过滤输出字符,防止XSS攻击

    假如项目在前期没有过滤客户提交的字符,那么可以在输出的时候,对输出的字符进行过滤,防止出现XSS跨域攻击. 原理简单:利用ASP.NET API的管道原理,在MessageHandlers中添加一个自 ...

  8. 【解决】org.apache.hadoop.util.Shell$ExitCodeException: /bin/bash: line 0: fg: no job control

    [环境信息] Hadoop版本:2.4.0 客户端OS:Windows Server 2008 R2 服务器端OS:CentOS 6.4 [问题现象] 在通过Windows客户端向Linux服务器提交 ...

  9. 魅蓝note2在ubuntu14.04下mtp模式无法自动mount的解决方法

    是因为新机型没在列表里的原因. 处理方法如下: As far as I know, MTP works fine in Trusty. You can try this: Uncomment #use ...

  10. Windows消息大全(转)

    原链接地址: http://www.cnblogs.com/icebutterfly/archive/2011/08/05/2128864.html 表A-1 Windows消息分布 消息范围说 明 ...