centos 7修改网卡名称

本文详细介绍如何在CentOS系统中进行网络配置的修改,包括修改GRUB配置以禁用网络设备名更改、重新加载GRUB配置、更改编程网络接口名称及重启网络服务的具体步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、修改配置

[root@localhost network-scripts]# vim /etc/default/grub 

GRUB_CMDLINE_LINUX行加入net.ifnames=0 biosdevname=0
GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0 crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet"

2、重新加载配置

[root@localhost network-scripts]# grub2-mkconfig -o /boot/grub2/grub.cfg 
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-957.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-957.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-ccf3d5b13ad841fda22e7b52d42376df
Found initrd image: /boot/initramfs-0-rescue-ccf3d5b13ad841fda22e7b52d42376df.img
done

 3、修改网上名称

[root@localhost network-scripts]# pwd
/etc/sysconfig/network-scripts
[root@localhost network-scripts]# mv ifcfg-eno16777736 ifcfg-eth0
[root@localhost network-scripts]# vim ifcfg-eth0

主要修改:
NAME=eth0 
DEVICE=eth0
其它的根据业务要求修改。

4、重启网络

[root@localhost network-scripts]# systemctl restart network

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值