How to configure network card in redhat or centos
| August 26th, 2009Define Ip and netmask
vi
/etc/sysconfig/network-scripts/ifcfg-eth0
You should have something like this
# Broadcom Corporation NetXtreme II BCM5708 Gigabit Ethernet
DEVICE=eth0
BOOTPROTO=static
BROADCAST=192.168.1.255
HWADDR=00:1A:64:99:6A:8C
IPADDR=192.168.1.41
NETMASK=255.255.254.0
#NETWORK=192.168.1.0
ONBOOT=yes
ifcfg-eth0 for your first network card, if you have more than one you can create file ifcfg-eth1, ifcfg-eth2, and so on
Define gateway
vi /etc/sysconfig/network
You should have something like this
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=devserver
GATEWAY=192.168.1.2
Restart your network
/etc/init.d/network restart
Define DNS
vi /etc/resolv.conf
You should have something like this
nameserver 10.0.80.11
nameserver 10.0.80.12
nameserver 202.67.222.222
Now try ping your gateway or other ip



