在CENTOS7/RHEL7修改网卡名称

简介:

1、禁用可预测命名规则

# vim /etc/default/grub

添加两句: net.ifnames=0 biosdevname=0


GRUB_TIMEOUT=5

GRUB_DEFAULT=saved

GRUB_DISABLE_SUBMENU=true

GRUB_TERMINAL_OUTPUT="console"

GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root rd.lvm.lv=centos/swap net.ifnames=0 biosdevname=0 rhgb quiet"

GRUB_DISABLE_RECOVERY="true"


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

Generating grub configuration file ...

Found linux image: /boot/vmlinuz-3.10.0-229.el7.x86_64

Found initrd image: /boot/initramfs-3.10.0-229.el7.x86_64.img

Found linux image: /boot/vmlinuz-0-rescue-a8ecfd39a4014521ae54ccef4ada1c67

Found initrd image: /boot/initramfs-0-rescue-a8ecfd39a4014521ae54ccef4ada1c67.img

done


2、修改网卡配置文件

# cd /etc/sysconfig/network-scripts/

# mv ifcfg-enoxxxxxx ifcfg-eth0


3、修改设备对应名称

# vim /etc/udev/rules.d/70-persistent-ipoib.rules

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:e0:17:54", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"


4、重启系统即可



mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

yum clean all

yum makecache



systemctl   动作   服务名.service

yum -y install   net-tools



CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙。

firewall:

systemctl start firewalld.service#启动firewall

systemctl stop firewalld.service#停止firewall

systemctl disable firewalld.service#禁止firewall开机启动










本文转自 295631788 51CTO博客,原文链接:http://blog.51cto.com/hequan/1768380,如需转载请自行联系原作者
目录
相关文章
|
6月前
|
数据可视化 Linux
Linux centos7.x系统 下没有ens33 网卡的解决方案
此时还没有enp0s31f6网卡相关的配置信息 , 所以我们需要配置enp0s31f6网卡相关的信息
381 0
|
负载均衡 Linux
配置Centos7网卡聚合链路
配置Centos7网卡聚合链路
557 0
配置Centos7网卡聚合链路
|
19天前
|
Linux 虚拟化
VMware workstation 中centos7虚拟机在nat模式下怎么配置网卡,指定我想要的IP并且可以联网
https://blog.csdn.net/2302_78534730/article/details/132825156?spm=1001.2014.3001.5502
132 0
|
18天前
|
网络协议
centos8 网卡 Nmcli(是network的简写 Nmcli)配置网络
centos8 网卡 Nmcli(是network的简写 Nmcli)配置网络
19 0
|
8月前
|
存储 Linux Shell
虚拟机安装(安装(克隆)虚拟机 配置网络 安装Centos7 配置(修改)虚拟机的静态IP 修改网卡的配置文件 测试网络是否互通外部工具 连接linux系统 设置服务器时间 修改主机名)(下)
虚拟机安装(安装(克隆)虚拟机 配置网络 安装Centos7 配置(修改)虚拟机的静态IP 修改网卡的配置文件 测试网络是否互通外部工具 连接linux系统 设置服务器时间 修改主机名)
370 0
|
8月前
|
分布式计算 Hadoop Linux
虚拟机安装(安装(克隆)虚拟机 配置网络 安装Centos7 配置(修改)虚拟机的静态IP 修改网卡的配置文件 测试网络是否互通外部工具 连接linux系统 设置服务器时间 修改主机名)(上)
虚拟机安装(安装(克隆)虚拟机 配置网络 安装Centos7 配置(修改)虚拟机的静态IP 修改网卡的配置文件 测试网络是否互通外部工具 连接linux系统 设置服务器时间 修改主机名)
281 0
|
Linux
Centos删除virbr0网卡
Centos删除virbr0网卡
129 0
centos 配置静态地址并修改网卡名
centos 配置静态地址并修改网卡名
|
Linux 开发工具 索引
centos 7如何将 网卡ens33 修改成 eth0
centos 7如何将 网卡ens33 修改成 eth0
502 0
centos 7如何将 网卡ens33 修改成 eth0
|
Linux
Centos 7网卡启动失败
Centos 7网卡启动失败
180 0

热门文章

最新文章