vi /etc/sysconfig/network-scripts/ifcfg-eth0 TYPE="Ethernet"
BOOTPROTO="none"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
NAME="eth0"
UUID="549a3ab7-6cbc-49de-85e2-a366226a127c"
DEVICE="eth0"
ONBOOT="yes"
IPADDR="192.168.0.101" # [Enter your static IP here]
PREFIX="24"
GATEWAY="192.168.0.1" # [Enter your Default Gateway]
DNS1="8.8.8.8" # [Your Domain Name System 1]
DNS2="8.8.4.4" # [Your Domain Name System 2]
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"
IPV6_PRIVACY="no"/etc/init.d/network restartOr
service network restartAfter restarting network, make sure to check the IP address and network status
ip addr show ping -c4 google.com