1.编辑网卡信息
[root@hadoop1 ~]# more /etc/sysconfig/network-scripts/ifcfg-eth0
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
IPV6_FAILURE_FATAL=no
NAME=eth0
UUID=d7088aa7-4b61-45a7-a35b-99eae03e0098
DEVICE=eth0
ONBOOT=yes
IPADDR=10.108.4.201
GATEWAY=10.108.4.254
NETMASK=255.255.255.0
DNS1=8.8.8.8
DNS2=4.2.2.2
2.修改grub
[root@localhost 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 net.ifnames=0 biosdevname=0 rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
3. 生成启动菜单
[root@localhost network-scripts]# grub2-mkconfig -o /boot/grub2/grub.cfg
4.验证是否修改成功
[root@localhost network-scripts]# reboot
[root@localhost network-scripts]# yum install net-tools
[root@localhost network-scripts]# ifconfig