Enter the directory: cd /etc/sysconfig/network-scripts/
Edit the file: vi ifcfg-eth0, change the first red box to static, and the second red box to the static ip you want to set
Reboot: reboot
Then check whether the ip has been set successfully: ifconfig press Enter