You can configure network card by editing text files stored in /etc/sysconfig/network-scripts/ directory. First change directory to /etc/sysconfig/network-scripts/:

# cd /etc/sysconfig/network-scripts/

You need to edit / create files as follows:

* /etc/sysconfig/network-scripts/ifcfg-eth0 : First Ethernet card configuration file
* /etc/sysconfig/network-scripts/ifcfg-eth1 : Second Ethernet card configuration file

To edit/create first NIC file, type command:

# vi ifcfg-eth0

Append/modify as follows:


# Intel Corporation 82801EB/ER (ICH5/ICH5R) integrated LAN Controller
DEVICE=eth0
HWADDR=00:e0:81:28:5b:cc
ONBOOT=yes
TYPE=Ethernet
NETMASK=255.255.255.0
IPADDR=192.168.2.100
GATEWAY=192.168.2.1

Save and close the file. Define default gateway (router IP) and hostname in /etc/sysconfig//network file:

# vi /etc/sysconfig/network

Append/modify configuration as follows:

NETWORKING=yes
HOSTNAME=www.theidaemon.com
GATEWAY=192.168.2.1

Save and close the file. Restart networking:

# /etc/init.d/network restart

Make sure you have correct DNS server defined in /etc/resolv.conf file:

# vi /etc/resolv.conf

Setup DNS Server as follows:


nameserver 192.168.2.1
nameserver 202.67.222.222

Save and close the file. Now you can ping the gateway/other hosts:

$ ping 192.168.2.101

Output:

# ping 192.168.2.101
PING 192.168.2.101 (192.168.2.101) 56(84) bytes of data.
64 bytes from 192.168.2.101: icmp_seq=1 ttl=128 time=0.195 ms
64 bytes from 192.168.2.101: icmp_seq=2 ttl=128 time=0.198 ms
64 bytes from 192.168.2.101: icmp_seq=3 ttl=128 time=0.188 ms

You can also check for Internet connectivity with nslookup or host command:

# nslookup google.com
Server: 192.168.2.1
Address: 192.168.2.1#53

Name: google.com
Address: 72.14.207.99

You can also use host command:

# host theidaemon.com
theidaemon.com has address 74.52.68.114
theidaemon.com mail is handled by 0 theidaemon.com.