1: Enter in Terminal: cd/etc/sysconfig/network-scripts/
2: See if there is this file: Ifcfg-eth0, if there are then input edits, vi ifcfg-eth0:
3: Start editing, fill in the IP address, subnet mask, gateway, DNS and so on. Where "These are the ones that must be."
Device=eth0
Bootproto=static
Onboot=yes
ipaddr=198.1.102.140
netmask=255.255.224.0
gateway=198.1.96.1
Where: eth0 corresponding file name: Ifcfg-eth0
If you need to configure more than one IP, you need multiple files, each with one IP, with the file name: ifcfg-eth0_x,
And the file is device=eth0:x, where X can start from 1. For example file: Ifcfg-eth0_1 correspondence device=eth0:1
Other netmask and gateway are the same except that ipaddr needs to change.
4: When finished editing, save exit (: Wq).
5: Restart the network service. Service network restart or/etc/init.d/network restart
6:ping the gateway, ping the extranet for testing. Can ping to indicate that the network is normal.
Set up static IP in Linux