This note is assuming you installed CentOS 6.2 Minimal.
First, after you install the system, go to your network scripts folder.
cd /etc/sysconfig/network-scripts
Then, edit your ifcfg-int file. For this example, I’m only use eth0, but you can easily use eth1, etc.
vi ifcfg-eth0
Enter the following for a static IP:
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
BROADCAST=broadcastIP
NETWORK=network address
NETMASK=netmast
IPADDR=IPAddress
USERCTL=no
Then, edit your network file.
vi /etc/sysconfig/network
Add your default gateway along with your local hostname.
NETWORKING=yes
HOSTNAME=host.name
GATEWAY=gatewayIPAddress
Open your resolv.conf file.
vi /etc/resolv.conf
Finally, add one (or more) DNS Servers to your resolv.conf file.
nameserver 4.2.2.1
nameserver 8.8.8.8
Restart your network service.
service network restart
You should be all set. Perform a ping on a target IP and a target host to verify IP and DNS functionality.
[root@demobox sysconfig]# ping 4.2.2.1
PING 4.2.2.1 (4.2.2.1) 56(84) bytes of data.
64 bytes from 4.2.2.1: icmp_seq=1 ttl=60 time=2.92 ms
64 bytes from 4.2.2.1: icmp_seq=2 ttl=60 time=2.92 ms
64 bytes from 4.2.2.1: icmp_seq=3 ttl=60 time=3.05 ms
64 bytes from 4.2.2.1: icmp_seq=4 ttl=60 time=3.02 ms
^C
— 4.2.2.1 ping statistics —
4 packets transmitted, 4 received, 0% packet loss, time 3494ms
rtt min/avg/max/mdev = 2.923/2.982/3.054/0.088 ms
[root@demobox sysconfig]# ping google.com
PING google.com (74.125.45.113) 56(84) bytes of data.
64 bytes from yx-in-f113.1e100.net (74.125.45.113): icmp_seq=1 ttl=56 time=3.77 ms
64 bytes from yx-in-f113.1e100.net (74.125.45.113): icmp_seq=2 ttl=56 time=3.85 ms
64 bytes from yx-in-f113.1e100.net (74.125.45.113): icmp_seq=3 ttl=56 time=3.91 ms
64 bytes from yx-in-f113.1e100.net (74.125.45.113): icmp_seq=4 ttl=56 time=3.90 ms
^C
— google.com ping statistics —
4 packets transmitted, 4 received, 0% packet loss, time 3361ms
rtt min/avg/max/mdev = 3.770/3.862/3.914/0.072 ms
[root@demobox sysconfig]#



