2012年11月22日星期四

Add a static IP to a Redhat/Fedora/CentOS box

To edit/create first NIC file, type command:
# vi /etc/sysconfig/network-scripts/ifcfg-eth0

Append/modify as follows:

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

Add / setup a new route
# route add default gw 192.168.1.254 eth0

Setup DNS Server as follows:
# vi /etc/resolv.conf

nameserver 10.0.80.11
nameserver 10.0.80.12
nameserver 202.67.222.222

ref: 
Linux change ip address
http://www.cyberciti.biz/faq/linux-change-ip-address/

Howto Red hat enterprise Linux 5 configure the network card
http://www.cyberciti.biz/faq/rhel-centos-fedoracore-linux-network-card-configuration/

Linux setup default gateway with route command
http://www.cyberciti.biz/faq/linux-setup-default-gateway-with-route-command/