centos 7 修改网卡名字

1、编辑网卡信息

     

cd /etc/sysconfig/network-scripts/ #进入网卡目录
mv ifcfg-en067761 ifcfg-eth0 #重命名网卡

cat ifcfg-eth0

TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
NAME=eth0 #name修改为eth0
ONBOOT=yes
IPADDR=10.0.0.23
NETMASK=255.255.255.0
GATEWAY=10.0.0.254
DNS1=114.114.114.114

2.修改grub

cat /etc/sysconfig/grub #编辑内核信息

GRUB_TIMEOUT=5
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto rhgb net.ifnames=0 biosdevname=0 quiet" #修改项
GRUB_DISABLE_RECOVERY="true"

3.生成启动菜单

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-1100f7e6c97d4afaad2e396403ba7f61
Found initrd image: /boot/initramfs-0-rescue-1100f7e6c97d4afaad2e396403ba7f61.img
Done

4.重启、验证是否成功

reboot

ip  a 或者 ifconifg

               

猜你喜欢

转载自www.cnblogs.com/alex0702/p/10538307.html
今日推荐