No Account Yet?

You are not logged in.

Add to: JBookmarks Add to: Facebook Add to: Windows Live Add to: Digg Add to: Del.icoi.us Add to: Reddit Add to: StumbleUpon Add to: Slashdot Add to: Netscape Add to: Furl Add to: Yahoo Add to: Blogmarks Add to: Technorati Add to: Newsvine Add to: Google Information
Configuring IP on Linux from the Command Line (RedHat,CentOS,Fedora) E-mail
Linux HowTo's - Linux Networking HowTo's
Written by Tim Inkpen   
Saturday, 07 June 2008 09:10

Configuring IP on Linux from the Command Line (RedHat,CentOS,Fedora)

This guide assumes that you are adding an the IP on eth0. If you are doing this on another Eth card (i.e. eth1) just adjust the eth numbers accordingly

 


Step 1 -Add IP Address

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

 

and configure like the following (pick any IP address available on your network)

 

DEVICE=eth0

BOOTPROTO=none

BROADCAST=192.168.1.255

IPADDR=192.168.1.105

NETMASK=255.255.255.0

NETWORK=192.168.1.0

HWADDR=00:50:FC:4B:B8:98

ONBOOT=yes

TYPE=Ethernet

USERCTL=no

IPV6INIT=no

PEERDNS=no

GATEWAY=192.168.1.1

 

Step 2 Restart the NIC

network service restart

 

Step 3 - Add the Default Route:

Default Route:

route add default gw ip_address_of_your_default_gateway eth0

route add default gw 192.168.1.1 eth0

 

To make gw/route permanent:

vi /etc/sysconfig/network

 

to make look like this:

 

NETWORKING=yes
HOSTNAME= localhost.localdomain
GATEWAY=192.168.1.1
  

Step 4 - Add DNS Servers

 

vi /etc/resolv.conf

 

so it looks like this:

 

search yourdomain.com
nameserver 192.168.1.37
nameserver 192.168.1.36
nameserver 192.168.1.38

 

 

Comments
Search RSS
Anonymous   |202.88.227.xxx |2008-08-09 02:24:31
very useful
Only registered users can write comments!

3.22 Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

Last Updated ( Saturday, 07 June 2008 17:16 )