# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.0.116
NETMASK=255.255.0.0
GATEWAY=192.168.0.1
ONBOOT=yes
TYPE=Ethernet
重启配置文件使之生效
# /etc/init.d/network restart
原文链接:https://www.f2er.com/centos/378376.html