LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-25-2008, 10:08 PM   #1
freak_vss
LQ Newbie
 
Registered: Aug 2008
Posts: 3

Rep: Reputation: 0
How to assign a static IP


Hi,
I am a newbie and thought it would be appropriate to post in this part of forum because it relates to networking. I have recently installed VMware workstation on windows and have installed Oracle Enterprise Linux 5(which is same as Redhat 5)in it. The windows box is connected to a router (WRT54G).

I am working my way to configure a static IP to my virtual linux server so that everytime it boots up it will get the same IP from the router (say 192.168.1.110). I search through red hat documents and got a little idea that something has to be configured with the dhcp client configuration files (etc/sysconfig/network-scripts/ifcfg-eth0) but i am unable to figure out the exact procedure of doing it like what all files needs to be configured, etc. It would be a great help if someone could throw some light on it.

Thanks in advance,
Harris.
 
Old 08-25-2008, 10:30 PM   #2
KinnowGrower
Member
 
Registered: May 2008
Location: Toronto
Distribution: Centos && Debian
Posts: 347

Rep: Reputation: 34
I am not aware about vmware. The simple way is to through GUI.

System--->Administration--->network

It will ask you for root password

then network configuration windows will appear

with NIC device.

Double click

you wud see the options

1. Automatically ..................

2 Static IP.


Uncheck the first.

check the second . gave the ip

# Service network restart or restart the computer



or 2nd ooption is

$su -

#system-config-network

hopefully it will help
 
Old 08-25-2008, 11:02 PM   #3
freak_vss
LQ Newbie
 
Registered: Aug 2008
Posts: 3

Original Poster
Rep: Reputation: 0
Hi,
I did the following and it worked. Don't know how it is different from configuring the DHCP client on the linux box.

I added the following entry to /etc/sysconfig/network-scripts/ifcfg-eth0


BOOTPROTO=STATIC
IPADDR=192.168.1.110

And restarted the network interface

/etc/init.d/network stop

then

/etc/init.d/network start


This has been persistent through reboots.


I would be glad to know if there are any more ways of doing this.


Thanks,
Harris.
 
Old 08-25-2008, 11:45 PM   #4
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Did you make sure to assign the VM a bridged network interface? The default is NAT'd, which won't work with a static IP the way you assigned it.
 
Old 08-26-2008, 08:03 PM   #5
freak_vss
LQ Newbie
 
Registered: Aug 2008
Posts: 3

Original Poster
Rep: Reputation: 0
Yes, all the virtual hosts that i have are using VMWare bridge networking. I have selected the default and that is what it gave me, bridge network.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Howto Assign Multiple Static Public IP Addresses under SBC's PPPoE Static Ip system o trekgraham Linux - Networking 8 04-17-2007 10:51 AM
How To Assign Static Ip? betrussell23 Linux - Networking 5 09-27-2006 01:25 AM
assign static ip allelopath Linux - Software 1 04-27-2005 07:04 PM
assign static IP to the server ashley75 Linux - General 2 03-10-2005 03:47 PM
How do I assign a static IP to eth0 louisb Linux - Networking 4 02-19-2005 08:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration