Centos7修改网卡名

实验目标:
将网卡ens32改为eth0

[root@localhost ~]# cd /etc/sysconfig/network-scripts/
[root@localhost network-scripts]# mv ifcfg-ens32 ifcfg-eth0	
[root@localhost network-scripts]# vim ifcfg-eth0			#编辑网卡名
DEVICE=eth0
[root@localhost network-scripts]# vim /etc/default/grub		#添加net.ifname参数
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos/root net.ifnames=0 biosdevname=0 rd.lvm.lv=centos/swap rhgb quiet"
[root@localhost network-scripts]# grub2-mkconfig -o /boot/grub2/grub.cfg		#重新生成GRUB配置并更新内核参数	
[root@localhost network-scripts]# reboot			#重启
[root@localhost ~]# ifconfig					#查看结果	
发布了62 篇原创文章 · 获赞 16 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/qq_41674452/article/details/87777103
今日推荐