INTRODUCTION

Static IP in CentOS 6.3

In this post will learn how to setup static IP address in CentOS 6.3. After fresh install of CentOS 6.3 system, will not get IP address automatically and network interface will be down by default. In order to make it active and available on every time system reboot you need to configure IP setting automatic or static in a configuration file.

`

SOLUTION

See below the default CentOS 6.3 network card configuration file.

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

Output

DEVICE=”eth0″
BOOTPROTO=”dhcp”
HWADDR=”00:1C:C4:48:6C:ED”
NM_CONTROLLED=”yes”
ONBOOT=”no”
TYPE=”Ethernet”
UUID=”2cb817b1-2553-4cf6-9d16-48a0ef32d3b2″

Here are steps to configure static IP address and auto start of network card once system rebooted.

Step 1:

To configure static IP open network card configuration file in vi editor

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

Change the Following settings

DEVICE=”eth0″
BOOTPROTO=”static”
IPADDR=192.168.1.1
NETMASK=255.255.255.0
HWADDR=”00:1C:C4:48:6C:ED”
NM_CONTROLLED=”no”
ONBOOT=”yes”
TYPE=”Ethernet”

Now Save and exit

:wq

Step 2:

Stop Network Manager service and make sure it will not active after reboot.

service NetworkManager stop
chkconfig NetworkManager off

Step 3:

To assign gateway IP address open use following command:

vi /etc/sysconfig/network

Change the Gateway settings according to your network settings.

NETWORKING=yes
HOSTNAME=lx.broexperts.com
GATEWAY=192.168.1.100

Step 4:

CentOS uses resolv.conf file to assign DNS IP addresses, let’s edit this file:

vi /etc/resolv.conf

Mention the nameserver ip address

nameserver 192.168.1.200

Step 5:

Finally Restart Network service

service network restart

That’s all..

Similar Posts