自己的服务器到期,转移自己博客内容至此。
一、更改网卡文件名字
[root@haproxy_backup ~]# ifconfig #查看本机网卡信息 ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 [root@haproxy_backup ~]# cd /etc/sysconfig/network-scripts/ #进入网卡文件目录 [root@haproxy_backup network-scripts]# mv ifcfg-ens33 ifcfg-eth0 #更改网卡名字 [root@haproxy_backup network-scripts]# vi ifcfg-eth0 #编辑文件,修改以下两项 NAME=”eth0″ DEVICE=”eth0″
二、修改并生成grub配置
[root@haproxy_backup network-scripts]# vi /etc/sysconfig/grub #修改grub文件 [root@haproxy_backup network-scripts]# cat /etc/sysconfig/grub #修改后的内容 GRUB_TIMEOUT=5 GRUB_DISTRIBUTOR=”$(sed ‘s, release .*$,,g’ /etc/system-release)” GRUB_DEFAULT=saved GRUB_DISABLE_SUBMENU=true GRUB_TERMINAL_OUTPUT=”console” GRUB_CMDLINE_LINUX=”crashkernel=auto rd.lvm.lv=cl/root rd.lvm.lv=cl/swap rhgb net.ifnames=0 biosdevname=0 quiet” #添加红色底纹内容 GRUB_DISABLE_RECOVERY=”true” [root@haproxy_backup network-scripts]# grub2-mkconfig -o /boot/grub2/grub.cfg Generating grub configuration file … #重新生成grub启动菜单 Found linux image: /boot/vmlinuz-3.10.0-514.el7.x86_64 Found initrd image: /boot/initramfs-3.10.0-514.el7.x86_64.img Found linux image: /boot/vmlinuz-0-rescue-baa6d7e67f5b4239b7e7c950597017e4 Found initrd image: /boot/initramfs-0-rescue-baa6d7e67f5b4239b7e7c950597017e4.img done [root@haproxy_backup network-scripts]# reboot #重启系统 [root@haproxy_backup ~]# ifconfig #查看网卡信息 eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
更改完成!