Join our Discussion Boards - Here

How To Configure a Network Card by Command Line on Centos 5.2

Use the command line gui tool

system-config-network-tui &

or

Go to /etc/sysconfig/network-scripts/

cd /etc/sysconfig/network-scripts/

edit ifcfg-eth0 or ifcfg-eth1 etc..

/etc/sysconfig/network-scripts/ifcfg-eth0

Add the following text

DEVICE=eth0
BOOTPROTO=static
DHCPCLASS=
HWADDR=00:30:48:56:A6:2E
IPADDR=10.10.29.66
NETMASK=255.255.255.192
ONBOOT=yes

Save file

Define the gateway and hostname in /etc/sysconfig/network file.

Restart networking

/etc/init.d/network restart

Setup the DNS servers in /etc/resolv.conf

Make sure it all works 

ping google.com

You must be logged in to post a comment.