1. 程式人生 > >CentOS 6 和 CentOS 7修改網卡名的方法

CentOS 6 和 CentOS 7修改網卡名的方法

基礎知識

CentOS 6 和 CentOS 7修改網卡名的方法

一.CentOS6

step 1:vim /etc/udev/rules.d/70-persistent-net.rules
                在 NAME=“ ***” 處 改為所要改的網卡名

![]技術分享圖片

step2: cd /etc/sysconfig/network-scripts/
            mv ifcfg-eth* ifcfg-eth0
            mv ifcfg-eth* ifcfg-eth0
            使用 mv命令將ifcfg-eth* 改為 ifcfg-eth0 ifcfg-eth1

技術分享圖片

 step3:  vim ifcfg-eth0

技術分享圖片

 step4:sercive network restart 大功告成

技術分享圖片

 step5:ip a  或者 ifocnfig 查看一下網卡配置

技術分享圖片

二.CentOS7

step1: cd /etc/syconfig/network-scripts/
            mv ifcfg-ens33 ifcfg-eth0

技術分享圖片

step2:vim ifcfg-eth0

技術分享圖片

step3: vim /etc/sysconfig/grub 
            在GRUB_CMDLINE_LINUX 行 quiet 前加上net.ifnames=0 biosdevname=0

技術分享圖片
技術分享圖片

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

技術分享圖片

step5:reboot  用ip a 查看網卡配置

技術分享圖片
修改成功

CentOS 6 和 CentOS 7修改網卡名的方法