原文件 /etc/sysconfig/network-scripts/ifcfg-eth0
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="dhcp"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="eth0"
UUID="61a94798-ae8c-4215-a79c-aea37a2e5c39"
DEVICE="eth0"
ONBOOT="yes"
修改为
BOOTPROTO="static"
IPADDR="192.168.0.102"
NETWASK="255.255.255.0"
GATEWAY="192.168.0.1"
2、重启网络
service network restart
修改hostname
vim /etc/hostname
重启电脑
reboot