Tuesday, August 14, 2012

Configuring IP on RedHat

This post will give you step by step guide to configure a static ip address to an interface in the RedHat operating system. Since I am also a newbie this post will not be that hard to understand.

First go to the root, 

#su -l

Then open the file which contains details about the interface.

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

This will open that file in the vi editor. Now all you have to do is adding some entries to the file.

Following web site will contain details about the vi editor,

                  http://www.cs.rit.edu/~cslab/vi.html

Entries that should be added,

DEVICE="eth0"
HWADDR="08:00:27:4F:CF:22"
NM_CONTROLLED = "no"
ONBOOT="yes"
IPADDR=10.1.1.1
NETMASK=255.255.255.0

Above entry is to add ip address 10.1.1.1 with a mask of 24 to the ethernet0 interface.

After that make sure you save the vi file and exit.

Finally restart the interfaces,

#/etc/inti.d/networks restart

To verify the configuration you can simply type,

#ifconfig 

Then check under the eth0 interface and verify all the configuration.

Thank you,
Pradeepa.

No comments:

Post a Comment