Environment:
CentOS6 minimal install without XWindow
To permanent change the IP, Submask, DNS etc
Step 1: Configure Hostname
cd /etc/sysconfig
vi network
# Modify HOSTNAME:
HOSTNAME=myHostname
Step 2: Configure NIC
cd /etc/sysconfig/network-scripts
# There may have different filenames in different computers.
# But the naming rule is ifcfg-*
vi ifcfg-eth0
# Add the following K/V pair
# NIC name
DEVICE=LocalNIC
IPADDR=192.168.1.200
SUBMASK=255.255.255.0
GATEWAY=192.168.1.1
HWADDR=00:0C:29:42:59:92
NM_CONTROLLED=yes
# Turn this when you need this NIC enable when system startup
# If this option is NO. That means you can not access network by this NIC.
ONBOOT=yes
Step 3 : Configure DNS
cd /etc
vi resolv.conf
# Add the following K/V pair
# You can add most 3 DNS server here.
nameserver 8.8.8.8
nameserver 8.8.4.4
Step 4 : Reboot computer and check you network
To temporary change your network configuration you can use the following commands